Skip to content

Commit ab64bca

Browse files
UnbreakableMJclaude
andcommitted
feat(vault-tui): create/edit cards in the add/edit form
The TUI `a`/`e` form now composes card (type 3) ciphers, not just logins and secure notes. No backend change — it builds the `CardWrite` payload that already rides `Request::Add`/`Edit` (CLI write path, PR #25). - app.rs: the Type row cycles login → secure note → card; `blank_fields` / `visible_fields` grow the card rows (Holder/Brand/Number/Expiry/CVV, with Number+CVV masked while unfocused). `submit` splits a single `MM/YYYY` Expiry field via a local `parse_expiry` (mirrors the CLI's `split_expiry`) and packs the card fields into `FormSubmit` (number/code redacted in `Debug`). `new_edit` takes the cached `DetailView` and prefills Brand/Expiry; secrets and the (unfetchable) cardholder start blank = leave-unchanged. - main.rs: `submit_form` builds `card: Option<CardWrite>` when the type is a card and threads it into both Add and Edit. - Tests: card add carries split expiry + redacts secrets, card edit prefill/diff, `parse_expiry`; updated the type-toggle test for the 3-way cycle. - docs: README TUI card note, CHANGELOG entry. Identity TUI editing stays pending — it needs an identity write backend first (no `IdentityWrite`/`from_plain` identity path yet). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 986670e commit ab64bca

4 files changed

Lines changed: 302 additions & 37 deletions

File tree

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@ range may break in any release.
1010

1111
### Added
1212

13+
- **TUI card create/edit.** The `vault-tui` add/edit form (`a`/`e`) now composes
14+
card (type 3) items, not just logins and secure notes. The **Type** row cycles
15+
`login → secure note → card`; the card rows are cardholder/brand/number/expiry
16+
(one `MM/YYYY` field, split on submit)/CVV, with number and CVV masked while
17+
unfocused. On edit, brand/expiry prefill from the detail pane's on-select fetch
18+
and secrets start blank (blank = leave unchanged). Builds the existing
19+
`CardWrite` payload on `Request::Add`/`Edit` — no backend change. Identity TUI
20+
editing stays pending (no identity write path yet). Tests: card add carries
21+
split expiry + redacts secrets, card edit prefill/diff, `parse_expiry`.
22+
1323
- **Create/edit card ciphers.** `vault add … --type card` and `vault edit`
1424
now build/update card (type 3) items: cardholder/brand/expiry via flags, the
1525
**number and CVV prompted on the controlling terminal** (`/dev/tty`, never

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,11 @@ vault edit "My Visa" --expiry 05/2031 --code # --code re-prompts the CVV
113113
(identities are read-only for now). Editing card fields on a non-card item is
114114
rejected.
115115

116+
The TUI can also create and edit cards: press `a` and cycle the **Type** row
117+
with `Space` (`login → secure note → card`), or `e` on a selected card. The
118+
card's number and CVV mask while unfocused; on edit they start blank (blank =
119+
leave unchanged), and the brand/expiry prefill from the detail pane.
120+
116121
### PIN unlock
117122

118123
For quick access without re-typing the master password, enroll a PIN (after an

0 commit comments

Comments
 (0)