Skip to content

feat: add context menu with delete confirmation for sidebar notes#7

Merged
j4rviscmd merged 2 commits intomainfrom
feat/note-context-delete
Mar 22, 2026
Merged

feat: add context menu with delete confirmation for sidebar notes#7
j4rviscmd merged 2 commits intomainfrom
feat/note-context-delete

Conversation

@j4rviscmd
Copy link
Copy Markdown
Owner

Summary

  • Add right-click context menu on sidebar note items with a "Delete" option
  • Show confirmation dialog (AlertDialog) before deletion to prevent accidental data loss
  • Auto-select the most recent remaining note after deletion to avoid empty state on restart

Changes

  • Install context-menu and alert-dialog shadcn/ui components
  • Add onDeleteNote prop to NoteSidebar with confirmation flow
  • Add handleDeleteNote callback in App.tsx that selects the next recent note
  • Simplify formatDate and groupNotes helper functions

Test plan

  • Right-click a note in the sidebar → context menu appears with "Delete" option
  • Click "Delete" → confirmation dialog shows
  • Confirm deletion → note is removed, most recent note is auto-selected
  • Cancel deletion → nothing happens
  • Delete the currently selected note → next recent note is selected
  • Delete the only remaining note → no note is selected (empty state)

🤖 Generated with Claude Code

j4rviscmd and others added 2 commits March 22, 2026 12:32
Right-clicking a note in the sidebar now shows a context menu with a
"Delete" option. Deletion requires confirmation via an alert dialog
to prevent accidental data loss. After deletion, the most recent
remaining note is automatically selected.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@j4rviscmd j4rviscmd added the enhancement New feature or request label Mar 22, 2026
@j4rviscmd j4rviscmd merged commit 9499b3a into main Mar 22, 2026
@j4rviscmd j4rviscmd deleted the feat/note-context-delete branch March 22, 2026 03:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant