feat: add keyboard shortcuts for duplicate, delete, and empty-note navigation#86
feat: add keyboard shortcuts for duplicate, delete, and empty-note navigation#86n00ki wants to merge 2 commits intoerictli:mainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds keyboard shortcuts for duplicating and deleting notes, wires duplicateNote into App keyboard handling, adds an event-driven delete dialog trigger in NoteList, and documents the new shortcuts in ShortcutsSettingsSection and README. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant App as App (keydown handler)
participant NotesHook as Notes hook (duplicateNote)
participant NoteList as NoteList (delete dialog)
participant UI as Delete Confirm Dialog
User->>App: press Cmd+D
App->>NotesHook: duplicateNote(currentNoteRef.current)
NotesHook-->>App: new note created (id)
App->>UI: focus/selection updates
User->>App: press Delete / Cmd+Backspace
App->>NoteList: dispatch custom event "request-delete-note" with noteId
NoteList->>NoteList: openDeleteDialogForNote(noteId)
NoteList->>UI: show delete confirmation
UI->>NoteList: confirm/delete -> perform deletion
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@README.md`:
- Around line 81-82: README's keyboard shortcuts table is missing the `Delete`
key entry that the Settings UI (ShortcutsSettingsSection.tsx) documents; update
the table to add a row for the `Delete` key with the same "Delete note"
description as `Cmd+Backspace` so the README matches the UI (add a line like |
`Delete` | Delete note | adjacent to the existing `Cmd+Backspace` row).
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 4a8b4834-11ba-4f99-ab8d-c2f84024faae
📒 Files selected for processing (4)
README.mdsrc/App.tsxsrc/components/notes/NoteList.tsxsrc/components/settings/ShortcutsSettingsSection.tsx
Cmd+Dto duplicate the current note (when not in editor/input)Delete/Cmd+Backspaceto delete the current note (from note list or empty editor)focus-note-listafter arrow navigation so the note list reflects keyboard focusImplementation
App.tsx, consistent with existing shortcutsrequest-delete-notecustom event, whichNoteList.tsxlistens for to open the confirmation dialog (same cross-component event pattern used byfocus-note-list,toggle-source-mode, etc.)currentNoteRefto read note content without addingcurrentNoteto the effect dependency array, avoiding handler re-registration on every auto-saveSummary by CodeRabbit
New Features
UX