feat(vault-tui): create/edit cards in the add/edit form#26
Merged
Conversation
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>
This was referenced Jun 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The TUI's
a/eform now creates and edits card (type 3) ciphers, not just logins and secure notes. Cards were already readable in the TUI (PR #24) and writable via the CLI (PR #25) — this closes the gap so the TUI can write them too.No backend change. It builds the
CardWritepayload that already ridesRequest::Add/Edit.How (
crates/vault-tui/only)app.rs— the Type row now cycleslogin → secure note → card.blank_fields/visible_fieldsgrow the card rows (Holder / Brand / Number / Expiry / CVV; Number + CVV mask while unfocused, like Pass).submitsplits the singleMM/YYYYExpiry field via a localparse_expiry(mirrors the CLI'ssplit_expiry) and packs the card fields intoFormSubmit(number/code redacted inDebug).new_edittakes the cachedDetailViewand prefills Brand/Expiry; secrets — and the cardholder, which has no fetch selector yet — start blank = leave-unchanged.main.rs—submit_formbuildscard: Option<CardWrite>when the type is a card and threads it into bothRequest::AddandRequest::Edit.Tests
Debug-redacts the number/CVVparse_expiry(both year widths + rejects garbage)type_toggle_swaps_visible_fields_preserving_valuesfor the 3-way cyclecargo fmt --check, fresh-isolatedclippy -D warnings,cargo test --workspace --all-targets(69 TUI tests),cargo deny check, and both headless builds all clean.Out of scope (tracked follow-ups)
IdentityWrite+from_plainidentity branch + agent apply + CLI parity); that's its own slice, then identity slots into this same form.Field::CardCardholderselector so the card edit form (and detail pane) can prefill/show the cardholder.🤖 Generated with Claude Code