Mac: ⇧⌘H highlight doesn't work; Duplicate selects a huge range #166

Closed
opened 2026-10-14 06:54:53 +00:00 by kayg · 1 comment
Owner

kayg on a Mac (calternal.cloud):

  • ⌘, works.
  • ⇧⌘H (highlight) does nothing.
  • ⌘D duplicates, "but why does it automatically select the whole thing when I duplicate even though the block is like one line long?" The screenshot shows the selection covering the one-line bullet plus empty lines below it.

Fix:

  • Highlight: find out why ⇧⌘H never reaches us (the browser or the OS may take it), and pick a working binding by our shortcut conventions (#39). Keep ==highlight== in the file (kayg confirmed).
  • Duplicate: it copies exactly the block (the selected blocks) and puts the caret at the same spot in the copy. Nothing ends up selected.
  • Tests: Chromium and WebKit, Mac and other key sets; one-line, multi-line and nested blocks.
kayg on a Mac (calternal.cloud): - ⌘, works. - ⇧⌘H (highlight) does nothing. - ⌘D duplicates, "but why does it automatically select the whole thing when I duplicate even though the block is like one line long?" The screenshot shows the selection covering the one-line bullet plus empty lines below it. **Fix:** - **Highlight:** find out why ⇧⌘H never reaches us (the browser or the OS may take it), and pick a working binding by our shortcut conventions (#39). Keep `==highlight==` in the file (kayg confirmed). - **Duplicate:** it copies exactly the block (the selected blocks) and puts the caret at the same spot in the copy. Nothing ends up selected. - **Tests:** Chromium and WebKit, Mac and other key sets; one-line, multi-line and nested blocks.
Author
Owner

PR #206. Findings:

Why ⇧⌘H never arrives. On macOS, Safari binds ⇧⌘H to Go Home, and Chrome binds it to Home too. Safari runs menu key equivalents before the page sees keydown, so no handler can catch it; Chrome gives the page the key first. The Mac at 10.69.69.21 timed out over ssh (off or off the network), so I could not run a keydown logger there. This is from the browsers' known menus, not measured on the Mac.

Binding. ⇧⌘Y (Y for yellow), not in Safari's or Chrome's Mac menus as far as I know. If it turns out taken, change packages/ui/src/lib/shortcuts.ts and is.highlight. ⇧⌘H stays as a silent alias.

Duplicate. ⌘D selected the block (blocksOrCaret) and inserted after it, so the selection grew over the copy. Now duplicateBlocks copies exactly the block(s), puts the caret at the same offset in the copy, selects nothing. Also fixed: a nested item lost its indent, and a copied paragraph merged into the original (it needs a blank line).

Tests. shortcuts.spec.ts: all 10 pass in Chromium (Mac and other keys). WebKit: new duplicate tests and the formatting tests pass; the other WebKit shortcut tests time out at 60s on this loaded box (at unrelated steps such as the Undo toast), so CI should judge those.

PR #206. Findings: **Why ⇧⌘H never arrives.** On macOS, Safari binds ⇧⌘H to Go Home, and Chrome binds it to Home too. Safari runs menu key equivalents before the page sees keydown, so no handler can catch it; Chrome gives the page the key first. The Mac at 10.69.69.21 timed out over ssh (off or off the network), so I could not run a keydown logger there. This is from the browsers' known menus, not measured on the Mac. **Binding.** ⇧⌘Y (Y for yellow), not in Safari's or Chrome's Mac menus as far as I know. If it turns out taken, change `packages/ui/src/lib/shortcuts.ts` and `is.highlight`. ⇧⌘H stays as a silent alias. **Duplicate.** ⌘D selected the block (`blocksOrCaret`) and inserted after it, so the selection grew over the copy. Now `duplicateBlocks` copies exactly the block(s), puts the caret at the same offset in the copy, selects nothing. Also fixed: a nested item lost its indent, and a copied paragraph merged into the original (it needs a blank line). **Tests.** shortcuts.spec.ts: all 10 pass in Chromium (Mac and other keys). WebKit: new duplicate tests and the formatting tests pass; the other WebKit shortcut tests time out at 60s on this loaded box (at unrelated steps such as the Undo toast), so CI should judge those.
kayg closed this issue 2026-10-14 08:24:04 +00:00
Sign in to join this conversation.
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#166
No description provided.