Shortcuts: the #39 table, whole, tested in Chromium and WebKit #97

Closed
kayg wants to merge 0 commits from issue/39-shortcuts-1 into dev
Owner

The shortcut table from #39 (the research comment plus kayg's "standard only" rule), whole, in apps/web.

The table (Mac / Linux and Windows; one source: packages/ui/src/lib/shortcuts.ts, matched by physical key so every keyboard layout works)

Action Mac Linux / Windows Where
Find a note or an action (palette) ⌘K Ctrl+K anywhere, nothing selected
New note ⌃⌥N Ctrl+Alt+N anywhere
Log the time ⌘⇧; Ctrl+Shift+; a daily note
Focus ⌘. Ctrl+. anywhere
Show or hide places ⌘\ Ctrl+\ anywhere
Settings ⌘, Ctrl+, anywhere
Bold / Italic ⌘B / ⌘I Ctrl+B / Ctrl+I selected words
Link ⌘K Ctrl+K selected words
Strikethrough ⇧⌘X Ctrl+Shift+X selected words
Code ⌘E Ctrl+E selected words
Highlight ⇧⌘H Ctrl+Shift+H selected words
Title / Heading / Subheading ⌘⌥1 / 2 / 3 Ctrl+Alt+1 / 2 / 3 a line
Insert or turn into ⌘/ Ctrl+/ writing
Move the block up / down ⌘⌥↑ / ↓ Alt+↑ / ↓ writing
Nest / move back out ⇥ / ⇧⇥ Tab / Shift+Tab a list item
Duplicate the block ⌘D Ctrl+D writing
Delete the block ⇧⌘K Ctrl+Shift+K writing
Copy a link to the block ⌥⇧⌘L Ctrl+Alt+Shift+L writing
Select the block, then leave the note esc Esc writing
Undo your last change ⌘Z Ctrl+Z anywhere
Today / previous day / next day T / P / N T / P / N outside the text

How it behaves

  • In the text, the app keymap now runs before CodeMirror's defaults, which bind Alt+↑ (move line), ⌘I (select syntax) and ⇧⌘K (delete line) to other things.
    • Formatting keys act only on selected words, and ⌘D / ⇧⌘K only on a block. Otherwise the key stays the browser's.
    • ⌘K with words selected is Link; with nothing selected it's the palette.
  • Tab nests a list item two spaces, with what's under it; ⇧Tab moves it back out. Outside a list, Tab moves focus as usual, so it's never a keyboard trap.
  • Esc: the first press selects the block, the second leaves the editor. An open sheet or picker takes Esc first.
  • Highlight is ==words== (Obsidian, Bear, iA Writer; plain text elsewhere). It's drawn as a marker with the == hidden like other marks, and shown in source mode. It's also a Highlight button in the text bar and the text menu.
  • Outside the text, one window handler (lib/keys.svelte.ts) replaces the scattered ones. T/P/N only act when nothing editable has focus and the key isn't held down. P/N go from the day showing, or from today.
  • ⌘K palette (plain; the designed one gets its own mockup): actions with their keys, notes by title, and search.query hits inside notes. Arrows, Enter and Esc work, and focus goes back where it was.
  • Tooltips: every shortcut shows in its warm tooltip pill (bars, the Today row, the Settings tab), in the menus and in Settings → Keyboard, in this platform's form, with a correct aria-keyshortcuts.

Tests: e2e/shortcuts.spec.ts runs every key above in Chromium and WebKit, both as a Mac (⌘; the platform is set before the app and CodeMirror load) and as Linux/Windows (Ctrl).

  • Each key must do its job, and defaultPrevented must be true only when it does.
  • It also checks that ⌘B with nothing selected, T while typing, and Tab on a plain line stay the browser's.
  • The tooltip pill and aria-keyshortcuts are checked too.

Not provable in a headless browser, so needs a real Mac before the table is final

  • Playwright's keys go to the page, never through the browser's own menus. So these tests can't show whether Safari or Chrome on a real Mac hands these to the page:
    • ⌘, (their Settings menu item)
    • ⇧⌘H (Safari "Home")
    • ⌘D (Add Bookmark)
  • Firefox wasn't part of this run (Ctrl+K, Ctrl+B and Ctrl+Shift+K are its own, but cancelable per the research).
  • If any of these turns out to be taken by the browser, it gets dropped from the table and stays reachable from the palette, as kayg's rule says.

Locally: full browser suite 103 passed / 54 skipped; editor unit tests 75/75; svelte-check 0 errors.

🤖 Generated with Claude Code

https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T

The shortcut table from #39 (the research comment plus kayg's "standard only" rule), whole, in apps/web. **The table** (Mac / Linux and Windows; one source: `packages/ui/src/lib/shortcuts.ts`, matched by physical key so every keyboard layout works) | Action | Mac | Linux / Windows | Where | |---|---|---|---| | Find a note or an action (palette) | ⌘K | Ctrl+K | anywhere, nothing selected | | New note | ⌃⌥N | Ctrl+Alt+N | anywhere | | Log the time | ⌘⇧; | Ctrl+Shift+; | a daily note | | Focus | ⌘. | Ctrl+. | anywhere | | Show or hide places | ⌘\\ | Ctrl+\\ | anywhere | | Settings | ⌘, | Ctrl+, | anywhere | | Bold / Italic | ⌘B / ⌘I | Ctrl+B / Ctrl+I | selected words | | Link | ⌘K | Ctrl+K | selected words | | Strikethrough | ⇧⌘X | Ctrl+Shift+X | selected words | | Code | ⌘E | Ctrl+E | selected words | | Highlight | ⇧⌘H | Ctrl+Shift+H | selected words | | Title / Heading / Subheading | ⌘⌥1 / 2 / 3 | Ctrl+Alt+1 / 2 / 3 | a line | | Insert or turn into | ⌘/ | Ctrl+/ | writing | | Move the block up / down | ⌘⌥↑ / ↓ | Alt+↑ / ↓ | writing | | Nest / move back out | ⇥ / ⇧⇥ | Tab / Shift+Tab | a list item | | Duplicate the block | ⌘D | Ctrl+D | writing | | Delete the block | ⇧⌘K | Ctrl+Shift+K | writing | | Copy a link to the block | ⌥⇧⌘L | Ctrl+Alt+Shift+L | writing | | Select the block, then leave the note | esc | Esc | writing | | Undo your last change | ⌘Z | Ctrl+Z | anywhere | | Today / previous day / next day | T / P / N | T / P / N | outside the text | **How it behaves** - **In the text**, the app keymap now runs before CodeMirror's defaults, which bind Alt+↑ (move line), ⌘I (select syntax) and ⇧⌘K (delete line) to other things. - Formatting keys act only on selected words, and ⌘D / ⇧⌘K only on a block. Otherwise the key stays the browser's. - ⌘K with words selected is Link; with nothing selected it's the palette. - **Tab** nests a list item two spaces, with what's under it; ⇧Tab moves it back out. Outside a list, Tab moves focus as usual, so it's never a keyboard trap. - **Esc**: the first press selects the block, the second leaves the editor. An open sheet or picker takes Esc first. - **Highlight** is `==words==` (Obsidian, Bear, iA Writer; plain text elsewhere). It's drawn as a marker with the `==` hidden like other marks, and shown in source mode. It's also a Highlight button in the text bar and the text menu. - **Outside the text**, one window handler (`lib/keys.svelte.ts`) replaces the scattered ones. T/P/N only act when nothing editable has focus and the key isn't held down. P/N go from the day showing, or from today. - **⌘K palette** (plain; the designed one gets its own mockup): actions with their keys, notes by title, and `search.query` hits inside notes. Arrows, Enter and Esc work, and focus goes back where it was. - **Tooltips**: every shortcut shows in its warm tooltip pill (bars, the Today row, the Settings tab), in the menus and in Settings → Keyboard, in this platform's form, with a correct `aria-keyshortcuts`. **Tests**: `e2e/shortcuts.spec.ts` runs every key above in Chromium and WebKit, both as a Mac (⌘; the platform is set before the app and CodeMirror load) and as Linux/Windows (Ctrl). - Each key must do its job, and `defaultPrevented` must be true only when it does. - It also checks that ⌘B with nothing selected, T while typing, and Tab on a plain line stay the browser's. - The tooltip pill and `aria-keyshortcuts` are checked too. **Not provable in a headless browser, so needs a real Mac before the table is final** - Playwright's keys go to the page, never through the browser's own menus. So these tests can't show whether Safari or Chrome on a real Mac hands these to the page: - ⌘, (their Settings menu item) - ⇧⌘H (Safari "Home") - ⌘D (Add Bookmark) - Firefox wasn't part of this run (Ctrl+K, Ctrl+B and Ctrl+Shift+K are its own, but cancelable per the research). - If any of these turns out to be taken by the browser, it gets dropped from the table and stays reachable from the palette, as kayg's rule says. Locally: full browser suite 103 passed / 54 skipped; editor unit tests 75/75; svelte-check 0 errors. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T
Web: the #39 shortcut table, whole and tested in Chromium and WebKit
All checks were successful
CI / rust (pull_request) Successful in 1m6s
CI / web (pull_request) Successful in 3m13s
5f2d2ae954
- The table (packages/ui/lib/shortcuts.ts) is the one source: ⌘K palette,
  ⌃⌥N new note, ⌘⇧; log, ⌘. focus, ⌘\ sidebar, ⌘, settings, ⌘B/I/K,
  ⇧⌘X strike, ⌘E code, ⇧⌘H highlight, ⌘⌥1-3 headings, ⌘⌥↑↓ move (Alt+↑↓
  on Linux and Windows), Tab/⇧Tab nest, Esc, ⌘/ insert, ⌘D duplicate,
  ⇧⌘K delete, ⌥⇧⌘L copy block link, T/P/N outside the text. Linux and
  Windows read Ctrl/Alt; matching is by physical key.
- In the text: the app keymap now outranks CodeMirror's defaults (which
  bind Alt+↑, ⌘I and ⇧⌘K to other things). Formatting needs selected
  words and duplicate/delete a block, else the key stays the browser's.
  Tab nests list items two spaces with what's under them; outside a list
  it moves focus. Esc selects the block, a second Esc leaves the editor.
- Highlight is ==words==, drawn as a marker with the == hidden like
  other marks (shown in source mode); a Highlight button in the text bar
  and the menu.
- Outside the text, one window handler (lib/keys.svelte.ts) replaces the
  scattered ones; Shell registers its sidebar and Focus toggles.
- ⌘K palette (plain for now): actions, notes by title, and search.query
  hits inside notes; arrows, Enter, Esc.
- Every shortcut is in its tooltip pill (and menus and Settings), in the
  platform's form, with a correct aria-keyshortcuts.
- e2e/shortcuts.spec.ts: every key, as a Mac and as Linux/Windows, in
  Chromium and WebKit: it acts, and the default is prevented only when it
  does (⌘B with nothing selected, T while typing and Tab outside a list
  are left alone).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T
Author
Owner

Verified by Claude (palette screenshot: ⌘K finds notes via search). Shortcut table implemented per #39, tested Mac and Linux/Windows modifiers in Chromium+WebKit. To confirm on a real Mac: ⌘, ⇧⌘H ⌘D. Note: highlight is stored as ==words== (not CommonMark; Obsidian-compatible) — flagged for kayg. CI green. Merging and deploying.

Verified by Claude (palette screenshot: ⌘K finds notes via search). Shortcut table implemented per #39, tested Mac and Linux/Windows modifiers in Chromium+WebKit. To confirm on a real Mac: ⌘, ⇧⌘H ⌘D. Note: highlight is stored as ==words== (not CommonMark; Obsidian-compatible) — flagged for kayg. CI green. Merging and deploying.
Author
Owner

Closing: this branch is already fully contained in dev (it landed through a merge train). Branch cleanup, 2026-10-15.

Closing: this branch is already fully contained in `dev` (it landed through a merge train). Branch cleanup, 2026-10-15.
kayg closed this pull request 2026-10-15 08:35:09 +00:00
All checks were successful
CI / rust (pull_request) Successful in 1m6s
CI / web (pull_request) Successful in 3m13s

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal!97
No description provided.