feat: add Gallery TUI for interactive configuration and generation

- Implemented a terminal user interface (TUI) for configuring the gallery generator using Textual.
- Included functionality to manage sources with add/remove
- Integrated a log pane to display generation output from subprocess calls.
- Implemented save functionality to persist configuration changes.
This commit is contained in:
Kylian Schmidt
2026-05-08 15:47:02 +02:00
parent 17acd478d3
commit 19fc15abb4
8 changed files with 843 additions and 41 deletions
+4 -8
View File
@@ -248,14 +248,11 @@ export class ExportManager {
// Generate a unique temporary filename
const tempFileName = `export_request_${Date.now()}.json`;
// Get work directory from config or fallback
const workDir = window.galleryConfig?.workDir || '/work/kschmidt/web';
// Save the request to a JSON file that can be picked up by a Python script
const requestData = JSON.stringify(payload, null, 2);
// Show improved export instructions with full command
this.showExportInstructions(requestData, tempFileName, workDir);
this.showExportInstructions(requestData, tempFileName);
}
/**
@@ -274,9 +271,9 @@ export class ExportManager {
/**
* Show export instructions to user
*/
showExportInstructions(requestData, tempFileName, workDir) {
showExportInstructions(requestData, tempFileName) {
const tempFilePath = `/tmp/${tempFileName}`;
const fullCommand = `echo '${requestData.replace(/'/g, "'\\''")}' > ${tempFilePath} && cd ${workDir} && python export_plots.py ${tempFilePath}`;
const fullCommand = `echo '${requestData.replace(/'/g, "'\\''")}' > ${tempFilePath} && python export_plots.py ${tempFilePath}`;
const instructions = `
<div class="export-instructions">
@@ -304,7 +301,6 @@ export class ExportManager {
<h4>📋 Command Breakdown:</h4>
<ul>
<li><strong>Creates temporary file:</strong> <code>${tempFilePath}</code></li>
<li><strong>Changes to work directory:</strong> <code>${workDir}</code></li>
<li><strong>Runs export script:</strong> <code>python export_plots.py</code></li>
<li><strong>Output file:</strong> Will be saved in the work directory</li>
</ul>