feat: rename and delete entries #3

Merged
schaefera merged 2 commits from delete-rename into main 2026-10-05 11:44:37 +00:00
Collaborator

Adds the last missing entry operations from the roadmap.

What changes for the user

  • Rename: the editor's name field stays editable when editing. Saving under a different name renames the entry, together with any edits.
  • Delete: the entry dialog has a red Delete button. It asks for confirmation first. The confirmation dialog stays open and shows why if the delete fails.
  • After a delete: a toast, the list reloads, and a sync is queued, the same as after a save.
  • No swipe-to-delete on the list, because it collides with the Ubuntu Touch shell's edge swipes.

passcore

  • Store::delete_entry(entry, base), like pass rm:
    • Commits Remove <entry> from store.
    • Removes folders left empty.
    • Refused with the new ChangedBeforeDelete error if a sync changed or removed the entry since it was opened.
  • Store::rename_entry(&EntryRename { from, to, base, secret, edited }), like pass mv:
    • If the file is already encrypted for the new name's .gpg-id, the encrypted file moves byte for byte. A sync's merge then sees a rename, so an edit made on another device follows it.
    • If the entry was also edited, or the new folder has other recipients, the content is encrypted anew.
    • Commit messages: Rename <a> to <b>., or … and edit it using TouchPass. when edited.
    • Refused with Changed for a stale version, and with an error for a target that already exists, the same name, or an invalid name.
  • write_entry now shares the password and version checks with these through two small helpers.

Bridge / QML

  • write_entry takes two new params, renamedFrom and edited. An edit with a different name goes to rename_entry.
  • New delete_entry(entry, version) with deleted / delete_failed signals.
  • New qml/DeleteDialog.qml; the Delete button in EntryDialog opens it from EntryListPage.

Tests

  • passcore: 8 new unit tests (delete, folder pruning, stale delete/rename, byte-for-byte move, rename plus edit, re-encryption into another .gpg-id, invalid renames).
  • 2 new sync tests: a laptop edit follows a phone rename; a phone delete reaches the laptop.
  • QML: new tst_DeleteDialog (4 tests), plus rename and "edited" tests in tst_EntryEditor.

Results:

  • cargo make: fmt, clippy -D warnings, 73 passcore tests, coverage 92%, cargo audit all pass.
  • cargo make qml-test: 43/43 pass.
  • cargo make click: builds, and click-review passes.
  • Not yet tried on the phone.

🤖 Generated with Claude Code

Adds the last missing entry operations from the roadmap. ## What changes for the user - **Rename:** the editor's name field stays editable when editing. Saving under a different name renames the entry, together with any edits. - **Delete:** the entry dialog has a red **Delete** button. It asks for confirmation first. The confirmation dialog stays open and shows why if the delete fails. - After a delete: a toast, the list reloads, and a sync is queued, the same as after a save. - No swipe-to-delete on the list, because it collides with the Ubuntu Touch shell's edge swipes. ## passcore - `Store::delete_entry(entry, base)`, like `pass rm`: - Commits `Remove <entry> from store.` - Removes folders left empty. - Refused with the new `ChangedBeforeDelete` error if a sync changed or removed the entry since it was opened. - `Store::rename_entry(&EntryRename { from, to, base, secret, edited })`, like `pass mv`: - If the file is already encrypted for the new name's `.gpg-id`, the encrypted file moves **byte for byte**. A sync's merge then sees a rename, so an edit made on another device follows it. - If the entry was also edited, or the new folder has other recipients, the content is encrypted anew. - Commit messages: `Rename <a> to <b>.`, or `… and edit it using TouchPass.` when edited. - Refused with `Changed` for a stale version, and with an error for a target that already exists, the same name, or an invalid name. - `write_entry` now shares the password and version checks with these through two small helpers. ## Bridge / QML - `write_entry` takes two new params, `renamedFrom` and `edited`. An edit with a different name goes to `rename_entry`. - New `delete_entry(entry, version)` with `deleted` / `delete_failed` signals. - New `qml/DeleteDialog.qml`; the Delete button in `EntryDialog` opens it from `EntryListPage`. ## Tests - passcore: 8 new unit tests (delete, folder pruning, stale delete/rename, byte-for-byte move, rename plus edit, re-encryption into another `.gpg-id`, invalid renames). - 2 new sync tests: a laptop edit follows a phone rename; a phone delete reaches the laptop. - QML: new `tst_DeleteDialog` (4 tests), plus rename and "edited" tests in `tst_EntryEditor`. Results: - `cargo make`: fmt, clippy `-D warnings`, 73 passcore tests, coverage 92%, `cargo audit` all pass. - `cargo make qml-test`: 43/43 pass. - `cargo make click`: builds, and `click-review` passes. - **Not yet tried on the phone.** 🤖 Generated with [Claude Code](https://claude.com/claude-code)
A rename moves the encrypted file unchanged when it is already encrypted
for the new name's .gpg-id, so a sync's merge sees a rename and an edit
made elsewhere follows it. Both refuse a version that changed since it
was opened, and remove folders left empty.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rename entries in the editor, delete them from the entry dialog
All checks were successful
CI / ci (pull_request) Successful in 44m49s
CI / qml (pull_request) Successful in 42s
CI / audit (pull_request) Successful in 14s
f0ed28c0dc
The editor's name field stays editable when editing; a different name
renames the entry (with its edits, if any). The entry dialog gets a
Delete button that asks first and deletes the version that was opened.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
schaefera approved these changes 2026-10-05 10:55:29 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
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
schaefera/TouchPass!3
No description provided.