feat(tui): quick-wins batch — replay, move-to-folder, batch toolbar, preset toggles, themes #147

Merged
charles merged 7 commits from tui/quick-wins-batch into main 2026-04-15 18:34:25 +00:00
Collaborator

Five small, high-impact features from the GTK↔TUI parity audit.

Commits

Commit Issue Title
04cc9c4 #131 gallery replay generation key binding (R)
7126acd #138 gallery move-to-folder action with picker overlay
3652c63 #136 gallery batch operation toolbar for multi-select
bd0ed45 #144 presets — surface hires/ADetailer state and toggle keys
2d3a79a #145 color theme system + Settings → Appearance picker

Highlights

  • R in grid/list/detail replays the focused item's params on the Generate screen
  • m opens a folder picker; works on multi-selection if active, otherwise the focused item; new GalleryStorage::move_to_folder updates the rows in batch
  • When multi-selection is non-empty, the bottom hint row becomes a batch toolbar showing dd · m · * · Esc
  • * (favorite) now operates on the multi-selection when present

Presets

  • Each preset row shows hires (hires 2.0x (15 steps, denoise 0.55)) and ADetailer chips when enabled
  • h toggles enable_hr, A toggles adetailer, ←/→ adjusts hr_scale ±0.1 — all auto-save

Theme system

  • New Theme struct in loom-tui/src/theme.rs with 11 named slots
  • 6 built-in themes: default-dark · tokyo-night · gruvbox · nord · solarized-dark · monochrome
  • Settings → Appearance → "TUI theme" — type any name, hot-reloads on LoomEvent::SettingsChanged
  • Foundation only — wiring per-screen Color::* calls to ctx.theme().* is a follow-up

Test plan

  • Press R in gallery — Generate screen opens with matching prompt
  • Press m in gallery — folder picker opens; picking "(root)" moves to root
  • Multi-select 3 items with Space — toolbar appears showing "3 selected"
  • Toggle h and A on a preset — chips appear, ←/→ adjusts hr_scale
  • Settings → Appearance → set theme to tokyo-night — saved (visual change requires per-screen wiring)
  • All cargo test pass

Closes charles/loom#131
Closes charles/loom#138
Closes charles/loom#136
Closes charles/loom#144 (foundation; full editor follow-up)
Closes charles/loom#145 (foundation; per-screen wiring follow-up)

🤖 Generated with Claude Code

Five small, high-impact features from the GTK↔TUI parity audit. ## Commits | Commit | Issue | Title | |---|---|---| | `04cc9c4` | #131 | gallery replay generation key binding (R) | | `7126acd` | #138 | gallery move-to-folder action with picker overlay | | `3652c63` | #136 | gallery batch operation toolbar for multi-select | | `bd0ed45` | #144 | presets — surface hires/ADetailer state and toggle keys | | `2d3a79a` | #145 | color theme system + Settings → Appearance picker | ## Highlights ### Gallery - **R** in grid/list/detail replays the focused item's params on the Generate screen - **m** opens a folder picker; works on multi-selection if active, otherwise the focused item; new `GalleryStorage::move_to_folder` updates the rows in batch - When multi-selection is non-empty, the bottom hint row becomes a **batch toolbar** showing `dd · m · * · Esc` - `*` (favorite) now operates on the multi-selection when present ### Presets - Each preset row shows hires (`hires 2.0x (15 steps, denoise 0.55)`) and `ADetailer` chips when enabled - **h** toggles `enable_hr`, **A** toggles `adetailer`, **←/→** adjusts `hr_scale` ±0.1 — all auto-save ### Theme system - New `Theme` struct in `loom-tui/src/theme.rs` with 11 named slots - 6 built-in themes: default-dark · tokyo-night · gruvbox · nord · solarized-dark · monochrome - Settings → Appearance → "TUI theme" — type any name, hot-reloads on `LoomEvent::SettingsChanged` - Foundation only — wiring per-screen `Color::*` calls to `ctx.theme().*` is a follow-up ## Test plan - [ ] Press `R` in gallery — Generate screen opens with matching prompt - [ ] Press `m` in gallery — folder picker opens; picking "(root)" moves to root - [ ] Multi-select 3 items with Space — toolbar appears showing "3 selected" - [ ] Toggle `h` and `A` on a preset — chips appear, `←/→` adjusts hr_scale - [ ] Settings → Appearance → set theme to `tokyo-night` — saved (visual change requires per-screen wiring) - [ ] All `cargo test` pass Closes charles/loom#131 Closes charles/loom#138 Closes charles/loom#136 Closes charles/loom#144 (foundation; full editor follow-up) Closes charles/loom#145 (foundation; per-screen wiring follow-up) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Wires up the long-existing ``GalleryScreen::replay_params`` helper:

- New ``AppAction::ReplayGeneration(Box<GenerationParams>)`` variant
- App handler navigates to Generate, focuses main, and calls
  ``GenerateScreen::apply_replay`` which overwrites params and syncs
  the rat-widget TextArea state for both prompts
- ``R`` (uppercase) bound in gallery grid/list (lowercase ``r`` still
  refreshes from storage) and detail view
- Mode auto-restored: I2i if ``init_image_path`` is present, else T2i
- ``ApplyPreset`` now also focuses main on navigate (consistency)

Closes charles/loom#131

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- New ``GalleryStorage::move_to_folder(ids, folder)`` updates the
  folder column in batch (file moves on disk are out of scope).
- New ``OverlayKind::FolderPicker`` + ``FolderPickerOverlay`` reuses
  the ``string_picker`` component with a "(root)" entry plus the
  current folder list.
- ``m`` in gallery opens the picker. Operates on the multi-selection
  if present, otherwise the focused item.
- New ``AppAction::MoveItemsToFolder`` runs the storage write on a
  blocking task and publishes ``LoomEvent::GalleryChanged`` so the
  view auto-refreshes.

Closes charles/loom#138

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When ``multi_selection`` is non-empty, the bottom hint row is replaced
by a toolbar showing the count and visual labels for the available
batch actions: dd delete · m move · * favorite · Esc clear.

``toggle_favorite`` (``*``) now operates on the multi-selection when
present, applying a single boolean across all selected items derived
from the focused item's current state. Single-item flow is unchanged
when nothing is multi-selected.

Default hint row also updated to advertise R (replay) and m (move).

Closes charles/loom#136

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Each preset row now shows ``hires N.Nx (S steps, denoise D.DD)`` and
``ADetailer`` chips when the corresponding fields are enabled.

New keys on the focused preset (auto-save to storage on each change):

- ``h``     toggle ``enable_hr``
- ``A``     toggle ``adetailer``
- ``←/→``   adjust ``hr_scale`` ±0.1 (only when hires is enabled)

Hint row updated. ``Preset::adetailer`` (bool) is the only ADetailer
field on the model; richer ADetailer params (face/hand model,
confidence) are out of scope until the model itself grows them.

Closes charles/loom#144 (partially — full inline editor for hr_steps,
denoising_strength, upscaler picker is a follow-up)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
feat(tui): color theme system + Settings → Appearance picker
All checks were successful
qa / qa (pull_request) Successful in 28m4s
2d3a79a24c
- New ``crates/loom-tui/src/theme.rs`` with a ``Theme`` struct
  centralising 11 named color slots (accent, border_focus, border_idle,
  selection_bg/fg, placeholder, error/success/warn/info, fg).
- 6 built-in themes: default-dark · tokyo-night · gruvbox · nord ·
  solarized-dark · monochrome.
- ``Theme::by_name`` falls back to default-dark with a warn on unknown
  names.
- ``AppCtx`` and ``App`` carry an ``Arc<Theme>`` populated from the new
  ``AppSettings::tui_theme`` field; ``LoomEvent::SettingsChanged``
  triggers ``reload_theme`` (non-blocking ``try_read``; if contended,
  the next tick re-attempts).
- Settings → Appearance gains a "TUI theme" text field; type any of
  the built-in names to swap themes immediately.

Screens still hardcode ``Color::*`` in their renderers — wiring each
to ``ctx.theme().*`` is the follow-up that makes the picker visible.
This commit is the foundation.

Closes charles/loom#145 (foundation; per-screen wiring is follow-up)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Merge remote-tracking branch 'origin/main' into tui/quick-wins-batch
Some checks failed
qa / qa (pull_request) Failing after 3m32s
404ee7bc59
# Conflicts:
#	crates/loom-tui/src/app.rs
#	crates/loom-tui/src/testing.rs
style: fmt after merge
All checks were successful
qa / qa (pull_request) Successful in 29m8s
6db9cf511b
charles deleted branch tui/quick-wins-batch 2026-04-15 18:34:26 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/loom!147
No description provided.