fix: keep keyboard shortcuts alive while a note is open#318
Merged
Conversation
Opening a note killed every single-key shortcut two ways: the keydown gate bailed whenever a target was set (not just while typing), and the editor grabbed focus even on session restore, so after any reload every keystroke went into the note body — only ⌘K survived. Gate on actual typing instead, skip the focus grab for restores and j/k navigation (explicit opens still focus, ready to type), and add ⇧⌘P / ⌃⌘A combos that work mid-edit, matching the Mac app's Note menu. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The autosave draft snapshots pinned/archived, but the editor never resynced them when the sidebar menu or a keyboard shortcut changed the open note, so the next flush wrote the stale flags back. Sync each flag from the note as it changes — separately, so an external archive can't revert a not-yet-flushed local pin toggle. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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
targetwas set (not just while typing), and the editor grabbed focus even on session restore, so keystrokes landed in the note body — only ⌘K survived. This is the "most shortcuts don't work" bug.j/kstep through notes in place (without stealing focus, so you can keep navigating),p/a/Del/?/n//all work;Enter/ostill drops you into the text ready to type.autoFocus: false; explicit opens (click, Enter/o, search) still focus the editor — that behavior was deliberate and stays.pinned/archived, so a pin/archive from the sidebar menu (or now a shortcut) during a pending edit got reverted by the next flush. The editor now resyncs each flag from the note as it changes.Test plan
npm test— 125/125npm run build— clean🤖 Generated with Claude Code