tui: AI jobs integration — wire AiJobWorker for all AI features #94

Closed
opened 2026-04-12 13:24:56 +00:00 by claude-desktop · 0 comments
Collaborator

User Story

As a loom-tui user, I want all AI-assisted features (prompt enhancement, tag generation, entity description, face detection, defect detection, region analysis) to work end-to-end, so that I can use AI to improve my workflow from the terminal.

Context

src/ai.rs has an AiJob tracker framework, and the spec defines 6 AI features triggered by keyboard shortcuts. But none of them call AiJobWorker. This ticket wires all AI features to loom-core's job system.

Acceptance Criteria

Generate Screen

  • Ctrl+E — prompt enhancement: calls AiJobWorker, spinner in status bar, result replaces/appends to prompt (user-configurable behavior)
  • Ctrl+T — tag generation: calls AiJobWorker on current init image, appends tags to prompt

Entity Screen

  • Ctrl+D — entity description: calls AiJobWorker, fills description field with result
  • Ctrl+F — face detection: calls AiJobWorker on reference image, highlights face region in thumbnail
  • Ctrl+X — defect detection: calls AiJobWorker, shows overlay with detected defects
  • Ctrl+R — region analysis: calls AiJobWorker, shows overlay describing image regions

UX

  • Spinner shown in status bar while any AI job is in flight
  • Notification on completion (success) or failure (error message)
  • Multiple AI jobs can be in flight concurrently; status bar shows count

Tests

  • Unit test: AiJob state machine transitions (pending → running → complete/failed)
  • Integration test: mock AiJobWorker returns result, screen state updates correctly

Out of Scope

  • AI model configuration (that's in Settings screen)
  • Prompt enhancement UI/UX options (append vs. replace — configurable in Settings)

References

  • Spec §6 (AI-Assisted Workflow)
  • Existing code: src/ai.rs
  • Tracking issue: #47
## User Story As a **loom-tui user**, I want all AI-assisted features (prompt enhancement, tag generation, entity description, face detection, defect detection, region analysis) to work end-to-end, so that I can use AI to improve my workflow from the terminal. ## Context `src/ai.rs` has an `AiJob` tracker framework, and the spec defines 6 AI features triggered by keyboard shortcuts. But none of them call `AiJobWorker`. This ticket wires all AI features to loom-core's job system. ## Acceptance Criteria ### Generate Screen - [ ] `Ctrl+E` — prompt enhancement: calls `AiJobWorker`, spinner in status bar, result replaces/appends to prompt (user-configurable behavior) - [ ] `Ctrl+T` — tag generation: calls `AiJobWorker` on current init image, appends tags to prompt ### Entity Screen - [ ] `Ctrl+D` — entity description: calls `AiJobWorker`, fills description field with result - [ ] `Ctrl+F` — face detection: calls `AiJobWorker` on reference image, highlights face region in thumbnail ### Gallery Detail View - [ ] `Ctrl+X` — defect detection: calls `AiJobWorker`, shows overlay with detected defects - [ ] `Ctrl+R` — region analysis: calls `AiJobWorker`, shows overlay describing image regions ### UX - [ ] Spinner shown in status bar while any AI job is in flight - [ ] Notification on completion (success) or failure (error message) - [ ] Multiple AI jobs can be in flight concurrently; status bar shows count ### Tests - [ ] Unit test: `AiJob` state machine transitions (pending → running → complete/failed) - [ ] Integration test: mock `AiJobWorker` returns result, screen state updates correctly ## Out of Scope - AI model configuration (that's in Settings screen) - Prompt enhancement UI/UX options (append vs. replace — configurable in Settings) ## References - Spec §6 (AI-Assisted Workflow) - Existing code: `src/ai.rs` - Tracking issue: #47
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#94
No description provided.