feat(tui): wire Presets screen to storage for CRUD & apply #108
No reviewers
Labels
No labels
area:agents
area:ai
area:config
area:dashboard
area:design
area:design-review
area:devtools
area:entities
area:gallery
area:generate
area:image
area:infra
area:meta
area:model-browser
area:navigation
area:presets
area:security
area:sessions
area:settings
area:sharing
area:test
area:ux
area:webhook
area:workdir
type:bug
type:chore
type:meta
type:user-story
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/loom!108
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "tui/preset-wire-91"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
PresetsScreentoGalleryStoragefor full preset lifecycle: load on screen entry, create (a), rename (e/r), delete (d), duplicate (y)Enterto apply focused preset to the Generate screen via newAppAction::ApplyPreset, navigating there automaticallyE(export to~/.local/share/loom/presets/<name>.toml) andI(import all.tomlfrom that directory)Screen::as_any_mut()trait method andGenerateScreen::apply_preset()for cross-screen downcastCloses charles/loom#91
Test plan
cargo clippy -p loom-tui -- -D warningscleancargo test -p loom-tuipasses (118 tests)acreates,ddeletes,yduplicates,Enterapplies and navigates to Generate🤖 Generated with Claude Code
Review — PR #108: Presets screen wired to storage for CRUD & apply
Well-rounded. CRUD + export/import + apply-to-generate all work. Good
sanitize_filenameimplementation.Concern:
as_any_mutonScreentraitThis PR adds
fn as_any_mut(&mut self) -> &mut dyn std::any::Anyto theScreentrait, requiring all screen implementations to add the boilerplate. PR #109 does the same thing independently. Coordinate to avoid merge conflicts — ideally this goes into a shared base PR.Concern:
action_renameappends " (renamed)"This is acknowledged as a workaround, but it's a one-way operation — pressing
rrepeatedly appends more suffixes (guarded byends_withcheck, so actually it doesn't). Still, the rename UX is odd: the user pressesrand the name silently changes. No feedback about what happened. Consider at minimum a notification showing old → new name, or better yet, reusing the inlineEditModepattern from the entities screen (#101).Concern:
action_importassigns fresh UUIDsGood for avoiding collisions, but this means re-importing the same TOML file creates duplicates every time. Consider checking for name collisions and either skipping or updating existing presets.
Concern:
eandrboth map to renameThis wastes a keybind. If
eis meant for "edit" andrfor "rename", they should do different things. If they're aliases, remove one and free the key for another action.Minor
apply_presetpreserves prompt/seed/dimensions, only overwriting model/sampler/steps/CFG. Good design choice — documented clearly.~/.local/share/loom/presets/is hardcoded vialoom_core::config::data_dir(). Make sure this aligns with XDG on all platforms.2b21e2ce8ato9e5cad1bc59e5cad1bc5to07442e0ed0