feat(tui): wire AI jobs to PluginBridge for prompt enhance & tags #104
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!104
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "tui/ai-wire-94"
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
PluginBridge.enhance_prompt()andPluginBridge.generate_tags()to the TUI generate screen via async tokio tasksAppAction::AiResultvariant andScreen::handle_ai_resulttrait method to route AI job completions back to the active screenAiJobTrackerguards against duplicate in-flight jobs; results apply to prompt fields via existingapply_prompt_enhance/apply_tag_generationhelpersCloses charles/loom#94
Test plan
cargo clippy -p loom-tui -- -D warningscleancargo test -p loom-tuipasses (113 tests)just qapasses (full workspace fmt + lint + test)🤖 Generated with Claude Code
Review — PR #104: AI jobs wired to PluginBridge for prompt enhance & tags
Clean dispatch pattern. The
AiResultenum +handle_ai_resulttrait method is a good design.Concern: synchronous file read in
dispatch_tagsdispatch_tagscallsstd::fs::read(path)on the main thread to load the preview image for base64 encoding. For a large image (e.g. 4K, ~10MB), this blocks the event loop noticeably. Consider spawning the read + encode into the sametokio::spawnas the bridge call:Nit
imagination: 0.5is hardcoded indispatch_prompt_enhance. Should this be configurable or derived from a setting?prompt_style: "tags"is also hardcoded. The user might want prose-style enhancement. Consider reading from settings or the screen's mode.notify_no_bridgeis a free function taking&AppHandle— it works, butAppCtx::notifyis the pattern everywhere else. Minor inconsistency.00059bd1abtoa68faa4ef3a68faa4ef3tob0b75c3e41