Skip to content

feat(vault-tui): per-field reveal/copy in the detail pane (+ card CVV)#35

Merged
UnbreakableMJ merged 1 commit into
mainfrom
tui-per-field-copy
Jun 16, 2026
Merged

feat(vault-tui): per-field reveal/copy in the detail pane (+ card CVV)#35
UnbreakableMJ merged 1 commit into
mainfrom
tui-per-field-copy

Conversation

@UnbreakableMJ

Copy link
Copy Markdown
Contributor

What

Makes the TUI detail pane focusable and per-field navigable. Tab now cycles folders → items → detail; with the detail pane focused, j/k move a field cursor and Space/c reveal/copy the selected field. This closes the gap where the card CVV (and any non-primary field) couldn't be revealed or copied — previously Space/c only hit the item's primary field.

Bounded scope (the chosen option): reuses the fields already shown + the masked CVV; no Field-enum expansion for the long-tail identity fields (a tracked follow-up).

How (crates/vault-tui/ only)

  • app.rsFocus::Detail; an App.detail_field cursor; a DetailField table via detail_fields(cipher_type) (card: Holder/Brand/Number*/Exp/CVV*; identity: Person/Email/Phone/Address; * = masked). Logins are intentionally excluded (they already have c/u/o/t + Space). move_*/focus_next gain Detail arms; the cursor resets when the item selection changes; selected_detail_field/detail_focused helpers.
  • main.rstoggle_reveal (Space) and c act on the cursor-selected field when the detail pane is focused; masked fields (number/CVV) fetch on demand, exactly like the password path. Item-list Space/c behavior is unchanged. ensure_detail/copy_field now also accept detail focus.
  • ui.rsrender_detail iterates detail_fields for card/identity with a cursor highlight ( + amber), and the pane border highlights when focused.

Tests

detail_fields per type (card includes the masked CVV/CardCode), cursor navigation/clamping, cursor reset on item-selection change, and the 3-way focus cycle. The existing render_detail UI tests (card masks number, identity shows contacts) still pass after the rewrite.

Verification

fmt --check, fresh-isolated clippy --all-features -D warnings, cargo test --workspace --all-targets, cargo deny check, both headless builds — all green.

Manual: select a card → Tab to the detail pane → j/k to CVVSpace reveals it (re-masks on move), c copies it. Item-focused Space/c still hit the primary field.

Out of scope (tracked follow-up)

Long-tail identity granular Field selectors (first/middle/last/company/ssn/passport/license/address parts) — a separate, selector-heavy slice.

🤖 Generated with Claude Code

The detail pane is now focusable (Tab cycles folders → items → detail).
With it focused, j/k move a field cursor and Space/c reveal/copy the
selected field — so the card CVV (and any non-primary field) can finally
be revealed and copied, not just the item's primary field.

- app.rs: `Focus::Detail`; `App.detail_field` cursor; a `DetailField`
  table via `detail_fields(cipher_type)` (card/identity only — logins keep
  c/u/o/t); move_*/focus_next gain Detail arms; the cursor resets when the
  item selection changes; `selected_detail_field`/`detail_focused` helpers.
- main.rs: `toggle_reveal`/`c` act on the cursor-selected field when the
  detail pane is focused (masked fields fetch on demand, like the
  password path — now covering the CVV); item-focus behavior unchanged.
  `ensure_detail`/`copy_field` accept detail focus.
- ui.rs: `render_detail` iterates `detail_fields` for card/identity with a
  cursor highlight; the pane border highlights when focused.
- Tests: `detail_fields` per type, cursor nav/clamp, cursor reset on item
  change, 3-way focus cycle.
- docs: README, CHANGELOG.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@UnbreakableMJ
UnbreakableMJ merged commit 28a314d into main Jun 16, 2026
8 checks passed
@UnbreakableMJ
UnbreakableMJ deleted the tui-per-field-copy branch June 16, 2026 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant