tui: gallery — replay generation key binding (R) #131

Closed
opened 2026-04-14 20:10:58 +00:00 by claude-desktop · 0 comments
Collaborator

User story

As a user, I want to press R on a gallery item to load its parameters into the Generate screen, so that I can iterate on a previous output without retyping anything.

Background

Issue #31 was closed but only the replay_params() helper exists on GalleryScreen (crates/loom-tui/src/screens/gallery.rs:202) — there's no key handler, no AppAction, and no Generate-side receiver. This ticket finishes the wiring.

Acceptance criteria

  • R (and r in detail view) on the focused item sends AppAction::ReplayGeneration(GenerationParams)
  • Works from grid, list, and detail views
  • Notification "replaying: {model}" surfaces on the Generate screen after navigation
  • If the focused item's image_path exists and original mode was i2i/inpaint/controlnet, the mode and init_image_path are restored on the Generate screen

App routing

  • New AppAction::ReplayGeneration(Box<GenerationParams>) variant
  • Handler in app.rs navigates to Generate screen and calls a new GenerateScreen::apply_replay(params) method
  • apply_replay overwrites self.params and syncs the rat-widget TextArea state for prompt/negative

Confirm-on-overwrite

  • If Generate has an unsaved prompt/negative (non-empty and differs from the replay), push OverlayKind::Confirm first
  • On confirm, apply the replay; on cancel, abort

Tests

  • Unit: apply_replay overwrites all known params fields
  • Integration: pressing R on a gallery item with focus on Main results in current_screen() == Generate and matching prompt

Out of scope

  • AI defect/region analysis (separate follow-up)
  • Mode-restoration UI when init image is missing (just skip silently)

References

  • crates/loom-tui/src/screens/gallery.rs:202 (replay_params)
  • crates/loom-tui/src/screens/generate.rs (apply_preset for similar pattern)
  • Closed predecessor: #31
## User story As a user, I want to press `R` on a gallery item to load its parameters into the Generate screen, so that I can iterate on a previous output without retyping anything. ## Background Issue #31 was closed but only the `replay_params()` helper exists on `GalleryScreen` (`crates/loom-tui/src/screens/gallery.rs:202`) — there's no key handler, no `AppAction`, and no Generate-side receiver. This ticket finishes the wiring. ## Acceptance criteria ### Gallery binding - [ ] `R` (and `r` in detail view) on the focused item sends `AppAction::ReplayGeneration(GenerationParams)` - [ ] Works from grid, list, and detail views - [ ] Notification "replaying: {model}" surfaces on the Generate screen after navigation - [ ] If the focused item's `image_path` exists and original mode was i2i/inpaint/controlnet, the mode and `init_image_path` are restored on the Generate screen ### App routing - [ ] New `AppAction::ReplayGeneration(Box<GenerationParams>)` variant - [ ] Handler in `app.rs` navigates to Generate screen and calls a new `GenerateScreen::apply_replay(params)` method - [ ] `apply_replay` overwrites `self.params` and syncs the rat-widget TextArea state for prompt/negative ### Confirm-on-overwrite - [ ] If Generate has an unsaved prompt/negative (non-empty and differs from the replay), push `OverlayKind::Confirm` first - [ ] On confirm, apply the replay; on cancel, abort ### Tests - [ ] Unit: `apply_replay` overwrites all known params fields - [ ] Integration: pressing `R` on a gallery item with focus on Main results in `current_screen() == Generate` and matching prompt ## Out of scope - AI defect/region analysis (separate follow-up) - Mode-restoration UI when init image is missing (just skip silently) ## References - `crates/loom-tui/src/screens/gallery.rs:202` (`replay_params`) - `crates/loom-tui/src/screens/generate.rs` (`apply_preset` for similar pattern) - Closed predecessor: #31
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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#131
No description provided.