feat: auto-preview, timestamped/grouped output, folder memory; fix batch format

- Auto-preview the first image after a folder loads (both panels), so the
  canvas isn't empty (§17.8).
- Group exports as <output_dir>/<timestamp>/<print_stem>/<garment_stem>.<ext>;
  one timestamp per export run, shared across the batch (§17.9).
- Remember the last garment/print folders and reopen the picker there;
  persisted via config, wired through main_window (§17.10).
- Shrink the 3 box templates further and lower them (chest placement).
- Fix: batch export ignored the chosen format/quality/output dir because the
  queue never received ExportOptions. Export panel now emits
  export_options_changed → queue.set_export_options (+ initial sync) (§17.11).

Docs: PRD 6.1/6.8/9, architecture 4.12, UI design 5.1, tasks.md 17.8–17.11.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-17 15:13:01 +08:00
co-authored by Claude Opus 4.8
parent 0cb1544654
commit edcd5d1e18
11 changed files with 208 additions and 40 deletions
+18
View File
@@ -260,6 +260,10 @@ class MainWindow(QMainWindow):
self.template_panel.template_applied.connect(self.queue_panel.set_transform)
self.template_panel.template_applied.connect(self.export_panel.set_transform)
# Output settings (dir/format/quality) flow to the queue for batch export
self.export_panel.export_options_changed.connect(self.queue_panel.set_export_options)
self.queue_panel.set_export_options(self.export_panel.current_options()) # initial sync
def _load_print_preview(self, path):
"""Load a print into the canvas and sync its native size to the template panel."""
self.image_canvas.load_print(path)
@@ -414,9 +418,15 @@ class MainWindow(QMainWindow):
except ValueError:
logger.warning("Unknown last_batch_mode %r, keeping default", raw_mode)
# Restore where the folder pickers open (last-used folders)
self.image_list_panel.set_garment_start_dir(self._config.get("last_garment_dir", ""))
self.image_list_panel.set_print_start_dir(self._config.get("last_print_dir", ""))
# Persist future changes (connected after restore to avoid echo writes)
self.template_panel.template_changed.connect(self._on_template_persist)
self.queue_panel.batch_mode_changed.connect(self._on_batch_mode_persist)
self.image_list_panel.garment_folder_opened.connect(self._on_garment_dir_persist)
self.image_list_panel.print_folder_opened.connect(self._on_print_dir_persist)
def _on_template_persist(self, name):
self._config["last_template"] = name
@@ -426,6 +436,14 @@ class MainWindow(QMainWindow):
self._config["last_batch_mode"] = getattr(mode, "value", str(mode))
save_config(self._config)
def _on_garment_dir_persist(self, path):
self._config["last_garment_dir"] = path
save_config(self._config)
def _on_print_dir_persist(self, path):
self._config["last_print_dir"] = path
save_config(self._config)
# ------------------------------------------------------------------
# Style (ref: docs/07-ui-design.md §10)
# ------------------------------------------------------------------