Task #512: Per-recipient Delete in Notes Inbox
Adds a recipient-scoped delete that's distinct from Archive: a recipient
can remove a note from their own inbox without touching the underlying
note or other recipients' rows.
Backend (artifacts/api-server/src/routes/notes.ts):
- DELETE /notes/received/:id — recipient-only; 404 if no row.
- POST /notes/received/bulk-delete — body {ids:number[]}, max 500,
single SQL DELETE, returns {ok, notFound} for partial-success UI.
- Both registered before DELETE /notes/:id so Express matches /received
first.
Frontend (artifacts/tx-os):
- New hooks useDeleteReceivedNote / useBulkDeleteReceivedNotes in
src/lib/notes-api.ts; both invalidate notes + folders queries.
- Inbox bulk bar gets a Delete button (rose) next to Archive plus a
confirm AlertDialog with all/none/partial toasts (src/pages/notes.tsx).
- ThreadDialog gets a per-row Delete next to Archive plus a single
confirm dialog that closes the thread on success.
- AR + EN locale strings added for all new copy.
Tests:
- artifacts/api-server/tests/notes-inbox-delete.test.mjs — recipient
delete, non-recipient/sender 404, bulk mix of valid+missing ids, and
DB-level checks that the note + other recipients survive.
- artifacts/tx-os/tests/notes-inbox-bulk-delete.spec.mjs — Playwright
flow seeds three received notes, bulk-deletes two from the inbox,
then deletes the third via ThreadDialog per-row.
This commit is contained in:
@@ -907,6 +907,15 @@
|
||||
"bulkArchivedAll_one": "Archived 1 note",
|
||||
"bulkArchivePartial": "Archived {{ok}} of {{total}}; {{failed}} failed",
|
||||
"bulkArchiveNone": "Could not archive the selected notes",
|
||||
"bulkDeleteInboxConfirmTitle": "Delete {{n}} inbox notes?",
|
||||
"bulkDeleteInboxConfirmTitle_one": "Delete 1 inbox note?",
|
||||
"bulkDeleteInboxConfirmBody": "This removes the notes from your inbox and archive. The sender keeps their copy.",
|
||||
"bulkDeletedInboxAll": "Deleted {{n}} notes from your inbox",
|
||||
"bulkDeletedInboxAll_one": "Deleted 1 note from your inbox",
|
||||
"bulkDeleteInboxPartial": "Deleted {{ok}} of {{total}}; {{failed}} were already gone",
|
||||
"bulkDeleteInboxNone": "Could not delete the selected notes",
|
||||
"deleteInboxConfirmTitle": "Delete this note from your inbox?",
|
||||
"deletedInboxOne": "Note removed from your inbox",
|
||||
"moreActions": "More actions",
|
||||
"empty": "Your notes will appear here",
|
||||
"emptyArchived": "No archived notes",
|
||||
|
||||
Reference in New Issue
Block a user