tui: entities — face detection & AI describe #133

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

User story

As a user building a character library, I want AI-assisted description generation and face detection on entity reference images, so that I spend less time typing and more time iterating.

Background

Issue #37 was closed but EntitiesScreen has neither Ctrl+D (describe) nor Ctrl+F (face) handlers; the face_rect: Option<FaceRect> field exists (crates/loom-tui/src/screens/entities.rs:54) but is never written. This ticket finishes the wiring.

Acceptance criteria

Describe (Ctrl+D)

  • From the entity Detail focus, calls bridge.describe_image(reference_path) via the AI plugin
  • Spinner in the status bar while the job runs
  • On completion the returned text fills entity.prompt_natural
  • If the field is non-empty, push a Confirm overlay before overwriting
  • Errors surface via the notification bar; field preserved on failure

Face detection (Ctrl+F)

  • Calls bridge.detect_face(reference_path) via the AI plugin
  • Detected normalised rect stored on face_rect and persisted via storage.save_entity
  • On the entity Detail view, draw a cyan rectangle overlay on the reference image at the detected location

AI tracker integration

  • Use the existing AiJobTracker pattern from Generate so duplicate keypresses while a job is in flight are rejected with a notification

Tests

  • Unit: successful describe replaces empty prompt_natural; non-empty triggers Confirm
  • Unit: face_rect persists across save_entity / list_entities round-trip

Out of scope

  • Face crop dialog (separate ticket — that's a UI for choosing a crop manually)
  • Per-entity LoRA management (separate ticket)
  • Backend implementation of the AI calls (plugin responsibility)

References

  • crates/loom-tui/src/screens/entities.rs:54 (face_rect)
  • crates/loom-tui/src/screens/generate.rs (AiJobTracker pattern)
  • Closed predecessor: #37
## User story As a user building a character library, I want AI-assisted description generation and face detection on entity reference images, so that I spend less time typing and more time iterating. ## Background Issue #37 was closed but `EntitiesScreen` has neither `Ctrl+D` (describe) nor `Ctrl+F` (face) handlers; the `face_rect: Option<FaceRect>` field exists (`crates/loom-tui/src/screens/entities.rs:54`) but is never written. This ticket finishes the wiring. ## Acceptance criteria ### Describe (`Ctrl+D`) - [ ] From the entity Detail focus, calls `bridge.describe_image(reference_path)` via the AI plugin - [ ] Spinner in the status bar while the job runs - [ ] On completion the returned text fills `entity.prompt_natural` - [ ] If the field is non-empty, push a Confirm overlay before overwriting - [ ] Errors surface via the notification bar; field preserved on failure ### Face detection (`Ctrl+F`) - [ ] Calls `bridge.detect_face(reference_path)` via the AI plugin - [ ] Detected normalised rect stored on `face_rect` and persisted via `storage.save_entity` - [ ] On the entity Detail view, draw a cyan rectangle overlay on the reference image at the detected location ### AI tracker integration - [ ] Use the existing `AiJobTracker` pattern from Generate so duplicate keypresses while a job is in flight are rejected with a notification ### Tests - [ ] Unit: successful describe replaces empty `prompt_natural`; non-empty triggers Confirm - [ ] Unit: `face_rect` persists across `save_entity` / `list_entities` round-trip ## Out of scope - Face crop dialog (separate ticket — that's a UI for choosing a crop manually) - Per-entity LoRA management (separate ticket) - Backend implementation of the AI calls (plugin responsibility) ## References - `crates/loom-tui/src/screens/entities.rs:54` (`face_rect`) - `crates/loom-tui/src/screens/generate.rs` (`AiJobTracker` pattern) - Closed predecessor: #37
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#133
No description provided.