tui: entities — face crop dialog (manual rect adjustment) #140

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

User story

As a user setting up a character entity, I want to fine-tune the detected face rect by adjusting its bounds in a dedicated overlay, so that the face mask used downstream (e.g. for face-swap workflows) matches what I actually want.

Background

GTK has a face crop dialog at crates/loom-gtk/src/pages/entity/face_crop_dialog.rs:24. The TUI has the face_rect field but no editor. After AI face detection (#133) the user should be able to nudge the rect.

Acceptance criteria

Overlay

  • New OverlayKind::FaceCrop { entity_id } opens via c (from entity Detail when a face_rect exists, or after AI detection)
  • Renders the entity reference image with a draggable rect outline at face_rect
  • Top status bar: pos: (x, y) · size: WxH · normalised: (0.41, 0.32) (0.18, 0.24)

Adjustment

  • Arrow keys move the rect by 1px (with Shift ×10)
  • + / - grows / shrinks the rect (keeps centered)
  • [ / ] adjusts width only, ; / ' adjusts height only

Preset shapes

  • 1 reset to AI-detected rect
  • 2 reset to centered square (image min dimension)

Confirm / cancel

  • Enter saves the new rect to entity.face_rect and persists via storage.save_entity
  • Esc discards

Tests

  • Unit: rect normalisation survives ±1px arrow → save → reload
  • Unit: shrink/grow keeps the rect within image bounds

Out of scope

  • Free-form polygon mask
  • Face landmarks (eyes / mouth)
  • Multi-face per entity

References

  • crates/loom-gtk/src/pages/entity/face_crop_dialog.rs:24 (GTK reference)
  • crates/loom-tui/src/screens/entities.rs (face_rect: Option<FaceRect>)
  • Depends on: #133
## User story As a user setting up a character entity, I want to fine-tune the detected face rect by adjusting its bounds in a dedicated overlay, so that the face mask used downstream (e.g. for face-swap workflows) matches what I actually want. ## Background GTK has a face crop dialog at `crates/loom-gtk/src/pages/entity/face_crop_dialog.rs:24`. The TUI has the `face_rect` field but no editor. After AI face detection (#133) the user should be able to nudge the rect. ## Acceptance criteria ### Overlay - [ ] New `OverlayKind::FaceCrop { entity_id }` opens via `c` (from entity Detail when a `face_rect` exists, or after AI detection) - [ ] Renders the entity reference image with a draggable rect outline at `face_rect` - [ ] Top status bar: `pos: (x, y) · size: WxH · normalised: (0.41, 0.32) (0.18, 0.24)` ### Adjustment - [ ] Arrow keys move the rect by 1px (with `Shift` ×10) - [ ] `+` / `-` grows / shrinks the rect (keeps centered) - [ ] `[` / `]` adjusts width only, `;` / `'` adjusts height only ### Preset shapes - [ ] `1` reset to AI-detected rect - [ ] `2` reset to centered square (image min dimension) ### Confirm / cancel - [ ] `Enter` saves the new rect to `entity.face_rect` and persists via `storage.save_entity` - [ ] `Esc` discards ### Tests - [ ] Unit: rect normalisation survives ±1px arrow → save → reload - [ ] Unit: shrink/grow keeps the rect within image bounds ## Out of scope - Free-form polygon mask - Face landmarks (eyes / mouth) - Multi-face per entity ## References - `crates/loom-gtk/src/pages/entity/face_crop_dialog.rs:24` (GTK reference) - `crates/loom-tui/src/screens/entities.rs` (`face_rect: Option<FaceRect>`) - Depends on: #133
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#140
No description provided.