Add /new create flow and two-intent delete - #7
Merged
Merged
Conversation
- /new route: path, optional summary, tag chip editor, CodeMirror content editor; POSTs to /api/notes and navigates to /notes/<new-id> - Delete button on NoteView + NoteEditor: modal gate requires typing the note path before the destructive button enables - Minimal toast store + Toaster for success/error feedback after create/delete - TagEditor extracted so /new and /edit share the same chip input - VaultClient gains createNote + deleteNote; useCreateNote/useDeleteNote invalidate notes/tags/vaultInfo and remove the deleted note's cache entry - Home and /notes empty-state "Create one" now links to /new Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
6 tasks
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
/newroute: path (required), optional one-linemetadata.summary, shared tag chip editor, CodeMirror content editor + live preview. On create → toast + navigate to/notes/<new-id>(read view, not editor).NoteViewandNoteEditoropens a two-intent modal: must type the note's path exactly before the destructive button enables. Success → toast + navigate/notes, with the deleted note removed from cache and lists invalidated.useToastStore+<Toaster />portal for create/delete feedback (no library).TagEditorextracted so/newand/editshare the chip input.VaultClient.createNote/deleteNoteand matching mutation hooks. 401 surfaces asVaultAuthErroron both paths./notesempty-state "Create one" now links to/new.Scope calls
/newshows the server message with a hint "if the path is taken, try a different one." Cleaner duplicate handling is a vault-side change.<output aria-live="polite">and the confirm modal uses native<dialog open>to satisfy a11y lints; keeping the existing backdrop-click-to-close/Escape handlers.Test plan
bun run typecheck— cleanbun run lint— cleanbun run test— 88 pass (14 files)bun run build— cleancreateNote/deleteNoteclient paths incl. 401,/newvalidation + happy POST + duplicate-path error preservation, delete modal gate (single click doesn't delete; Enter without match doesn't delete; happy DELETE + navigate + toast).🤖 Generated with Claude Code