Repository navigation
feat(notes): delete a note with Undo, and put it back from Recently deleted - #409
Merged
Merged
Conversation
…eleted
Deleting a note no longer asks first: it goes to note_trash under its own id for 30
days, with its files and history, and the notice's Undo puts it back where it was,
with the notes that were inside it. The Notes page lists recently deleted notes to put
back or delete for good; the notes pass empties ones older than 30 days.
GET /notes/deleted, POST /notes/deleted/{pid}/restore, DELETE /notes/deleted/{pid}.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RrY2byt5BHVeBXJUyfwWpb
…-wm7xc9 # Conflicts: # CHANGELOG.md
…-wm7xc9 # Conflicts: # CHANGELOG.md # nextjs-frontend/components/notes/note-page.tsx
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RrY2byt5BHVeBXJUyfwWpb
This was referenced Oct 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.
Requested by Adeel · project thread
Description
Before: deleting a note asked "Delete this page?" first and then removed it for good, with its files and history. A wrong click could not be undone.
After: Delete deletes at once and the notice has Undo, which puts the note back where it was and opens it. Deleted notes wait in Recently deleted at the bottom of the Notes page for 30 days, with their files and history: Put back returns one with the notes that were inside it, and Delete now (clicked twice) removes it for good. After 30 days they go on their own.
How:
notebook.deletemoves the page to a newnote_trashtable under its own id (notes inside move up a level and remember where they were);restoremoves it back; the notes pass (organise_due) purges pages older thanTRASH_DAYS. New routes:GET /api/v1/notes/deleted?ns=,POST /api/v1/notes/deleted/{pid}/restore,DELETE /api/v1/notes/deleted/{pid}(editors). Web:components/notes/delete.ts(delete with an Undo toast) andrecently-deleted.tsx.Motivation and Context
Second gap from the notes UI audit (Adeel: "notes ui is very bad and is missing tons of things"); AGENTS.md asks for undo instead of confirm dialogs.
Steps to reproduce (if appropriate):
Open a note → Delete → the toast says it was deleted → Undo → the note is back. Delete it again → Notes page → Recently deleted → Put back.
Types of changes
!in the title)Checklist:
make hookschecks it on commit).docs/accordingly.## UnreleasedinCHANGELOG.md.Done questions (AGENTS.md)
note_trashtable (DEFINE … IF NOT EXISTS, safe to run twice); existing notes don't change.docs/notes.md,docs/api.md) and generated files (make openapi) updated. Local: backend 1091 passed, web 890 passed.🤖 Generated with Claude Code
https://claude.ai/code/session_01RrY2byt5BHVeBXJUyfwWpb
Generated by Claude Code