feat(vault): M5 slice 4 — TUI mutations: add / edit / delete#3
Merged
Conversation
Make PRD §7.2's Mutation row live (`a` add, `e` edit, `d` delete with confirm), completing the daily-driver loop without falling back to the CLI. Pure TUI slice: the agent's M4 write paths (Request::Add / Edit / Remove) are driven as-is — no protocol changes, no agent changes, no new dependencies. Add: a centered form overlay with a Type row (login ⇄ secure note via Space/arrows) over Name/User/Pass/URI/Folder/Notes; notes expose only Name/Folder/Notes. Tab/Down and Shift-Tab/Up cycle with wrap; Enter validates (name required) and submits; Esc discards. Ctrl+G in the Pass field fills it with a fresh default-options password (the PRD's "generate into the active field" story). Values typed under one type survive a toggle, but hidden login fields never leak into a secure-note submit. Edit: same form prefilled from the list metadata (name/user/folder), type fixed, targeting the selected row's exact cipher id. Submit diffs against the prefill: untouched fields ride as None (a password the form never saw is never re-encrypted), a cleared field submits empty, and a no-change edit is rejected in-form. Delete: a `Delete 'name'? y/N` confirm overlay; y/Enter sends Request::Remove by exact id, n/Esc backs out. On success the vault reloads with a saved/deleted toast; on any error the form stays open so nothing typed is lost. Mutation overlays re-mask revealed secrets, the unfocused Pass field renders masked, and FormState/FormSubmit redact secrets in Debug. Known deviation (tracked in CHANGELOG): PRD §7.2's full CUA bindings (Ctrl+C/X/V/Z/S/F) and bracketed paste in text inputs are deferred. Tests: 11 new app units (open/prefill/gating, focus wrap, type-toggle preservation, Ctrl+G targeting, submit diff/validation, note-residue exclusion, confirm gating/take/cancel, overlay re-masking, Debug redaction) plus TestBackend smokes for the form and confirm overlays. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Summary
Makes PRD §7.2's Mutation row live —
aadd,eedit,ddelete (confirm) — completing the TUI's daily-driver loop (browse → search → reveal/copy → mutate) without falling back to the CLI.Pure TUI slice: the agent's M4 write paths (
Request::Add/Edit/Remove) are driven as-is. No protocol changes, no agent changes, no new dependencies.Add (
a)vault-core::generate_password) — the PRD's "generate into the active field" user story.Edit (
e)Noneon the wire (a password the form never saw is never re-encrypted), a cleared field submits empty, and a no-change edit is rejected in-form.Delete (
d)Delete 'name'? y/Nconfirm overlay;y/Enter sendsRequest::Removeby exact id,n/Esc backs out untouched.Behavior
saved '…'/deleted '…'toast; on any error the form stays open so nothing typed is lost.FormState/FormSubmitredact secrets inDebug.Known deviation (tracked in CHANGELOG)
PRD §7.2's full CUA bindings (Ctrl+C/X/V/Z/S/F) and bracketed paste in text inputs are deferred — fields accept typed input only this slice.
Tests
11 new app units (form open/prefill/gating, focus wrap, type-toggle value preservation, Ctrl+G targeting, submit diff/validation, note-residue exclusion, confirm gating/take/cancel, overlay re-masking,
Debugredaction) + 2TestBackendsmokes (form overlay with masked unfocused Pass; confirm overlay). Workspace total: 102 tests, 0 failures;clippy -D warnings(pedantic+nursery) andcargo denyclean.🤖 Generated with Claude Code