From 21d440c646e4436abc21d4151ab7752ad2ac4f30 Mon Sep 17 00:00:00 2001 From: Kevin Van Cott Date: Wed, 2 Dec 2026 17:49:52 -0600 Subject: [PATCH 1/8] fix(hotkeys): Reject Shift with a symbol in hotkey types and recordings --- .changeset/format-display-mod.md | 5 + .changeset/recorder-shift-symbols.md | 5 + .changeset/shift-symbol-types.md | 12 + .changeset/symbol-key-types.md | 5 + .intent/review-state.json | 1668 +++++++++-------- _artifacts/domain_map.yaml | 8 +- docs/config.json | 68 +- .../alpine/guides/choosing-valid-hotkeys.md | 229 +++ .../alpine/guides/custom-hotkey-recording.md | 2 +- .../framework/alpine/guides/hotkey-manager.md | 2 +- .../alpine/guides/keyboard-layouts.md | 4 +- .../angular/guides/choosing-valid-hotkeys.md | 228 +++ .../angular/guides/custom-hotkey-recording.md | 2 +- .../angular/guides/hotkey-manager.md | 2 +- .../angular/guides/keyboard-layouts.md | 4 +- .../ember/guides/choosing-valid-hotkeys.md | 244 +++ .../ember/guides/custom-hotkey-recording.md | 2 +- docs/framework/ember/guides/hotkey-manager.md | 2 +- .../ember/guides/keyboard-layouts.md | 4 +- .../lit/guides/choosing-valid-hotkeys.md | 235 +++ .../lit/guides/custom-hotkey-recording.md | 2 +- docs/framework/lit/guides/hotkey-manager.md | 2 +- docs/framework/lit/guides/keyboard-layouts.md | 4 +- .../octane/guides/choosing-valid-hotkeys.md | 214 +++ .../octane/guides/custom-hotkey-recording.md | 2 +- .../framework/octane/guides/hotkey-manager.md | 2 +- .../octane/guides/keyboard-layouts.md | 4 +- .../preact/guides/choosing-valid-hotkeys.md | 213 +++ .../preact/guides/custom-hotkey-recording.md | 2 +- .../framework/preact/guides/hotkey-manager.md | 2 +- .../preact/guides/keyboard-layouts.md | 4 +- .../react/guides/choosing-valid-hotkeys.md | 213 +++ .../react/guides/custom-hotkey-recording.md | 2 +- docs/framework/react/guides/hotkey-manager.md | 2 +- .../react/guides/keyboard-layouts.md | 4 +- .../solid/guides/choosing-valid-hotkeys.md | 213 +++ .../solid/guides/custom-hotkey-recording.md | 2 +- docs/framework/solid/guides/hotkey-manager.md | 2 +- .../solid/guides/keyboard-layouts.md | 4 +- .../svelte/guides/choosing-valid-hotkeys.md | 217 +++ .../svelte/guides/custom-hotkey-recording.md | 2 +- .../framework/svelte/guides/hotkey-manager.md | 2 +- .../svelte/guides/keyboard-layouts.md | 4 +- .../vue/guides/choosing-valid-hotkeys.md | 219 +++ .../vue/guides/custom-hotkey-recording.md | 2 +- docs/framework/vue/guides/hotkey-manager.md | 2 +- docs/framework/vue/guides/keyboard-layouts.md | 4 +- docs/guides/sensible-defaults.md | 12 +- docs/reference/classes/HotkeyManager.md | 12 +- docs/reference/classes/HotkeyRecorder.md | 20 +- docs/reference/functions/formatForAria.md | 2 +- docs/reference/functions/formatForDisplay.md | 8 +- docs/reference/functions/getHotkeyManager.md | 2 +- docs/reference/index.md | 5 +- .../reference/interfaces/FormatAriaOptions.md | 6 +- .../interfaces/FormatDisplayOptions.md | 16 +- .../interfaces/HotkeyChordCallbackContext.md | 8 +- .../interfaces/HotkeyChordRecorderOptions.md | 28 +- .../HotkeyChordRecorderValidationContext.md | 10 +- docs/reference/interfaces/HotkeyMeta.md | 8 +- .../interfaces/HotkeyRecorderActions.md | 10 +- .../interfaces/HotkeyRecorderState.md | 8 +- .../reference/interfaces/HotkeyScopesState.md | 2 +- .../HotkeySequenceCallbackContext.md | 8 +- .../HotkeySequenceRecorderOptions.md | 32 +- ...HotkeySequenceRecorderValidationContext.md | 10 +- docs/reference/interfaces/KeyIdentity.md | 6 +- .../interfaces/NormalizedKeyboardEvent.md | 20 +- docs/reference/interfaces/ParsedModifiers.md | 12 +- docs/reference/interfaces/RawModifiers.md | 12 +- docs/reference/interfaces/RecorderOptions.md | 10 +- .../reference/interfaces/RecorderRejection.md | 10 +- .../type-aliases/ConflictBehavior.md | 2 +- docs/reference/type-aliases/DisplayHotkey.md | 2 +- .../type-aliases/DisplayHotkeyChord.md | 7 +- .../type-aliases/FourModifierHotkeyChord.md | 4 +- docs/reference/type-aliases/Hotkey.md | 2 +- docs/reference/type-aliases/HotkeyCallback.md | 2 +- .../type-aliases/HotkeyCallbackContext.md | 2 +- .../type-aliases/HotkeyCallbackContextFor.md | 2 +- docs/reference/type-aliases/HotkeyChord.md | 2 +- .../reference/type-aliases/HotkeyEventType.md | 2 +- .../type-aliases/HotkeyRecorderCommitKeys.md | 2 +- .../type-aliases/HotkeyRecorderOptions.md | 2 +- .../HotkeyRecorderValidationContext.md | 2 +- docs/reference/type-aliases/HotkeySequence.md | 2 +- docs/reference/type-aliases/IndividualKey.md | 2 +- docs/reference/type-aliases/Key.md | 2 +- docs/reference/type-aliases/LayoutKey.md | 2 +- docs/reference/type-aliases/LogicalKey.md | 4 +- docs/reference/type-aliases/MaybeGetter.md | 2 +- docs/reference/type-aliases/NamedKey.md | 2 +- .../type-aliases/NonPunctuationKey.md | 20 - docs/reference/type-aliases/NonSymbolKey.md | 22 + .../type-aliases/ParsedHotkeyChord.md | 2 +- docs/reference/type-aliases/PhysicalKey.md | 2 +- .../reference/type-aliases/PhysicalKeyCode.md | 2 +- docs/reference/type-aliases/PunctuationKey.md | 47 - docs/reference/type-aliases/RawHotkeyChord.md | 2 +- .../reference/type-aliases/RecorderKeyMode.md | 10 +- .../type-aliases/RecorderRejectionReason.md | 2 +- .../type-aliases/RegisterableHotkey.md | 2 +- .../type-aliases/RegisterableHotkeyChord.md | 2 +- .../RegisterableHotkeySequence.md | 2 +- docs/reference/type-aliases/ShiftableKey.md | 26 + .../type-aliases/SingleModifierHotkeyChord.md | 4 +- docs/reference/type-aliases/SymbolKey.md | 48 + docs/reference/type-aliases/Target.md | 2 +- .../type-aliases/ThreeModifierHotkeyChord.md | 10 +- .../type-aliases/TwoModifierHotkeyChord.md | 10 +- docs/reference/type-aliases/UsKeys.md | 2 +- e2e/browser/held-keys-and-recorder.spec.ts | 10 +- e2e/browser/macos-reported-keys.spec.ts | 5 +- e2e/layouts/more-layouts.spec.ts | 4 +- package.json | 2 +- .../app-hotkeys/references/recording.md | 2 +- packages/hotkeys/skills/hotkeys-core/SKILL.md | 2 +- packages/hotkeys/src/_recorder-chord.ts | 64 +- packages/hotkeys/src/format.ts | 7 +- packages/hotkeys/src/hotkey-manager.ts | 7 +- packages/hotkeys/src/hotkey-recorder.ts | 8 +- packages/hotkeys/src/hotkey.types.ts | 27 +- packages/hotkeys/src/key-sets/us.ts | 4 +- packages/hotkeys/src/key.types.ts | 84 +- .../app-hotkeys-type-performance.test.ts | 4 +- packages/hotkeys/tests/app-hotkeys.test.ts | 2 +- packages/hotkeys/tests/format-aria.test.ts | 1 + packages/hotkeys/tests/format.test.ts | 9 + .../hotkeys/tests/hotkey-recorder.test.ts | 51 +- .../tests/invariants/recorder-layouts.test.ts | 10 + packages/hotkeys/tests/key-sets.test.ts | 21 +- packages/hotkeys/tests/match.test.ts | 41 +- packages/hotkeys/tests/public-api.test.ts | 4 +- packages/hotkeys/tests/recorder-auto.test.ts | 178 +- .../register-keys/register-keys.test-d.ts | 11 + .../hotkeys/tests/shift-chord-types.test.ts | 72 + packages/hotkeys/tests/typed-behavior.test.ts | 8 +- packages/hotkeys/tests/typed-keys.ts | 6 +- .../hotkeys/tests/untrusted-input.test.ts | 2 +- 139 files changed, 4087 insertions(+), 1178 deletions(-) create mode 100644 .changeset/format-display-mod.md create mode 100644 .changeset/recorder-shift-symbols.md create mode 100644 .changeset/shift-symbol-types.md create mode 100644 .changeset/symbol-key-types.md create mode 100644 docs/framework/alpine/guides/choosing-valid-hotkeys.md create mode 100644 docs/framework/angular/guides/choosing-valid-hotkeys.md create mode 100644 docs/framework/ember/guides/choosing-valid-hotkeys.md create mode 100644 docs/framework/lit/guides/choosing-valid-hotkeys.md create mode 100644 docs/framework/octane/guides/choosing-valid-hotkeys.md create mode 100644 docs/framework/preact/guides/choosing-valid-hotkeys.md create mode 100644 docs/framework/react/guides/choosing-valid-hotkeys.md create mode 100644 docs/framework/solid/guides/choosing-valid-hotkeys.md create mode 100644 docs/framework/svelte/guides/choosing-valid-hotkeys.md create mode 100644 docs/framework/vue/guides/choosing-valid-hotkeys.md delete mode 100644 docs/reference/type-aliases/NonPunctuationKey.md create mode 100644 docs/reference/type-aliases/NonSymbolKey.md delete mode 100644 docs/reference/type-aliases/PunctuationKey.md create mode 100644 docs/reference/type-aliases/ShiftableKey.md create mode 100644 docs/reference/type-aliases/SymbolKey.md create mode 100644 packages/hotkeys/tests/shift-chord-types.test.ts diff --git a/.changeset/format-display-mod.md b/.changeset/format-display-mod.md new file mode 100644 index 000000000..292ff0fc2 --- /dev/null +++ b/.changeset/format-display-mod.md @@ -0,0 +1,5 @@ +--- +'@tanstack/hotkeys': patch +--- + +`formatForDisplay` and `formatForAria` accept `Mod` on its own again, such as `formatForDisplay('Mod')`. It already formatted as `⌘` on macOS and `Ctrl` elsewhere, but since 0.20 the types rejected it. diff --git a/.changeset/recorder-shift-symbols.md b/.changeset/recorder-shift-symbols.md new file mode 100644 index 000000000..c19cabeb1 --- /dev/null +++ b/.changeset/recorder-shift-symbols.md @@ -0,0 +1,5 @@ +--- +'@tanstack/hotkeys': minor +--- + +The recorder no longer records `Shift` with a symbol, such as `Shift+?` or `Mod+Shift+/`, which the types now reject. `recordBy: 'auto'` and `recordBy: 'key'` record the symbol alone when it fires on the press: Shift+/ records `?`, and Ctrl+Shift+/ records `Mod+?`. When the symbol alone wouldn't fire, or could also fire without Shift, as with macOS Command off the key's US position or a numpad operator, they record the key's physical code instead: Dvorak Cmd+Shift+/ records `Mod+Shift+[BracketLeft]`, and Cmd+Shift+, records `Mod+Shift+[Comma]`. Hotkeys recorded before this change still match as before. diff --git a/.changeset/shift-symbol-types.md b/.changeset/shift-symbol-types.md new file mode 100644 index 000000000..a44cbb95c --- /dev/null +++ b/.changeset/shift-symbol-types.md @@ -0,0 +1,12 @@ +--- +'@tanstack/hotkeys': minor +--- + +Hotkey string types no longer accept `Shift` with a symbol, such as `Shift+/` or `Mod+Shift+/`. Which symbol Shift types depends on the keyboard layout: on a German keyboard, Shift+7 types `/` and fires a `Shift+/` binding meant for `?`. Write the symbol Shift types instead: + +- `Shift+/` becomes `?`, and `Shift+;` becomes `:`. +- `Shift+?` becomes `?`, since Shift is already part of typing it. +- Other modifiers stay: `Control+Shift+/` becomes `Control+?`, and `Mod+Shift+/` becomes `Mod+?`. +- To bind a key by position, use its physical code, such as `Shift+[Slash]`. + +`Shift` still goes with letters, digits, named keys, and physical codes, which the new `ShiftableKey` type lists, so `Shift+K`, `Shift+1`, `Shift+Tab`, and `Mod+Shift+[Slash]` are unchanged. Only the types changed. A saved or untyped string such as `'Shift+/'` still matches at runtime as before. diff --git a/.changeset/symbol-key-types.md b/.changeset/symbol-key-types.md new file mode 100644 index 000000000..82010b693 --- /dev/null +++ b/.changeset/symbol-key-types.md @@ -0,0 +1,5 @@ +--- +'@tanstack/hotkeys': minor +--- + +Rename the `PunctuationKey` type to `SymbolKey`, and `NonPunctuationKey` to `NonSymbolKey`. The set includes symbols such as `+`, `=`, and `$` that aren't punctuation, and the docs call them symbols. Update any imports of the old names. diff --git a/.intent/review-state.json b/.intent/review-state.json index 7f9a98a2b..71f32ad6c 100644 --- a/.intent/review-state.json +++ b/.intent/review-state.json @@ -67,16 +67,16 @@ ] }, "skill:packages/hotkeys/skills/app-hotkeys/SKILL.md": { - "fingerprint": "ded6e906fd3a322ce9e394f110aff8cd8966e085cafe5205a31e1533a87f7549", + "fingerprint": "497481255242283b6a40d1f6e9e376251ccf2674e5376a3bffc5eb17c1b456d3", "snapshot": { "docs/framework/react/guides/app-hotkeys.md": "84085c3644fe0fbeab6fc4850866e26d75404d02fad7039336ac5555bdfb9f7a", "docs/framework/react/guides/cheat-sheet-ui-helpers.md": "a2c4c3add145ef9f04043edc7e2ca8b3fe07acdfea8c17144011da967ddfc318", - "docs/framework/react/guides/custom-hotkey-recording.md": "4fe7986194e14c13976027c15164492bcdcea652e8379e3f0fe84fa5d84f4847", + "docs/framework/react/guides/custom-hotkey-recording.md": "a34ffc847cc182231a6b50754be4f6ee9f06e107a3599a74fd64cacca17b3d31", "packages/hotkeys/skills/app-hotkeys/SKILL.md": "454b7d1321a4f4d1a5aa4dd363466fb3acdd5f85935daa519768dc0a64622bcd", - "packages/hotkeys/skills/app-hotkeys/references/recording.md": "742e56e73e58abfbbe354ab03abca29e3ebe08d79a84b43daf842b594d6e2b4c", + "packages/hotkeys/skills/app-hotkeys/references/recording.md": "b77809c9b99f7b90917b57bc7b0baa999ad346ed82e6ad39d476438e504b40a1", "packages/hotkeys/src/app-hotkeys.ts": "4620760d8409fb78a94319b6e52ca1a00c625121e29006fa1cef057fdeafa937", "packages/hotkeys/src/conflicts.ts": "3c8628500aee3e7ba14ec78411b5f5398fd66cbc00359ffdf227a81729a76fe5", - "packages/hotkeys/src/hotkey-recorder.ts": "1b194de54bbd7d94c7a3ee581103651eed7077334adac55522ff499c951a2d2c", + "packages/hotkeys/src/hotkey-recorder.ts": "55c0e764812a4dd3907c915939904613fc3b7b66d967e09e5bedb754b143056a", "packages/react-hotkeys/tests/skills/shortcut-settings/fixture.tsx": "ecc6155241ebccca4ef4cd76e8925b3abeec73e9d88e6906bdf70e4c604788aa", "packages/react-hotkeys/tests/skills/shortcut-settings/grade.tsx": "c3538737712f00d52a4b6290d078a37f4c4d8881b9ce512f205f9e531b982f5e", "packages/react-hotkeys/tests/skills/shortcut-settings/mistakes/full-list-storage.tsx": "1d40680b6046115e8c7c71f474e3487fc953b82220e0f5809b01f39c0ca12206", @@ -86,24 +86,25 @@ "packages/react-hotkeys/tests/skills/shortcut-settings/solution.tsx": "3441296dea51490188d34991428fe2b8bf11ce6fafbdf6e2f7595ff7082f1400", "packages/react-hotkeys/tests/skills/shortcut-settings/task.md": "7163ed96e6694c745461f0edaf296b353906cfdb868f9c5df7d08ee01a4ba0ea" }, - "head": "33e0b46f70957660418f1c76e9180c5badccd1fc", - "outcome": "no-change", - "reason": "Comment wording fix in app-hotkeys.ts (T[K] instead of TInput) and regenerated line numbers; no guidance change.", + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "updated", + "reason": "Hotkey string types now reject Shift with a symbol, and the recorder never records one. references/recording.md now says the recorder never records Shift with a symbol and records Dvorak Cmd+Shift+/ as `Mod+Shift+[BracketLeft]`.", "evidence": [ - "Changed: packages/hotkeys/src/app-hotkeys.ts at 33e0b46f70957660418f1c76e9180c5badccd1fc" + "packages/hotkeys/skills/app-hotkeys/references/recording.md", + "packages/hotkeys/tests/recorder-auto.test.ts" ] }, "skill:packages/hotkeys/skills/hotkeys-core/SKILL.md": { - "fingerprint": "01cb30d7df90f44b7cc0c6679d37a35d2cb470b84c72faca5e218176831db359", + "fingerprint": "6fc5cf2293ab5473d8efa51c7e73b40771c05ff7c92e2c3b846469846bd5fcff", "snapshot": { "docs/framework/react/guides/hotkeys-provider-and-scopes.md": "57039ef29571e18c058ea77d104140e33c9b7fbda7de561c4d77247a47a566ce", "docs/framework/react/guides/hotkeys.md": "14f8f41603cb30d71ae69a527b6f3d58c9ade5d9e1530818c56e4dd32bfcd7c0", "docs/framework/react/guides/sequences.md": "35a2042e6adb52cca5c10ad36a8cbe65783b38be3383af612f368007a5f4b724", - "docs/guides/sensible-defaults.md": "6a3de24ee472e3d885547a5801330d7c858e70923c0f9380b8c2d4b6ebe89853", - "packages/hotkeys/skills/hotkeys-core/SKILL.md": "6a7f07c7d3d35af8c02dcc8835e97ae5a39ca498596665dd1e8894578d707062", + "docs/guides/sensible-defaults.md": "4d99dd18ced46fe8c0fa19dd627b2758176b0537a25a7f1267629a1f57129ef9", + "packages/hotkeys/skills/hotkeys-core/SKILL.md": "7b3987dbd1ff362ca2c243d7f091cfdfa76718ab004f0ca1940f37ebdde4def8", "packages/hotkeys/skills/hotkeys-core/references/scopes.md": "1139da465c06e76ee1d489cb14fc3ce952011666b67f64855846805c241c2108", "packages/hotkeys/skills/hotkeys-core/references/testing.md": "c2957eaac34ca431832069156504cf7434dcb96d5227bcb7cbb2129dc8e979bd", - "packages/hotkeys/src/hotkey-manager.ts": "787f629388c0fc5ef9b656efbc39efd18c62cbee0f96b7c0ef6673abc4c1f6fe", + "packages/hotkeys/src/hotkey-manager.ts": "11d5c43a649bc98992db7e838171fd1be79d45009f344766626285ea347fecc4", "packages/hotkeys/src/match.ts": "80c3c08023591cb2444aa2adbd5249ad7e2aeffd3dc4f8c529f142aab9141aaa", "packages/react-hotkeys/tests/skills/editor-shortcuts/editor-shortcuts.test.tsx": "73411ec7c25652244ed31ad4120880dfc08d6e10af959bef04d2df5360769fde", "packages/react-hotkeys/tests/skills/editor-shortcuts/fixture.tsx": "613a833bb6412b600925deb4009d16cfbfe7afa9a5dc0b82d1a39b8da8c0230b", @@ -115,12 +116,11 @@ "packages/react-hotkeys/tests/skills/editor-shortcuts/solution.tsx": "ec81379bf0e3a9950222cf8525f82f8abefeb6b46339550fd3a8622e61bf4f0d", "packages/react-hotkeys/tests/skills/editor-shortcuts/task.md": "9610d80e7add59f0433cbf210562ff8c481dc2c14371ce31c00a329d9ff1fedf" }, - "head": "e921fb8292343f4d8f5f264030b0d5b48594a371", + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", "outcome": "no-change", - "reason": "Review feedback round: the guides now limit the keyup release promise to keyup chords, matching the enabled JSDoc. The skill text still matches: the palette pitfall says trigger() checks only enabled and runs suspended hotkeys, and no skill sentence covers keyup getter timing or meta layer merging.", + "reason": "Comment-only edits: the HotkeyScopesState.characterKeysSuspended JSDoc example changes from Shift+/ to ?, and the UncasedLetterKey comment says how the test copy of the list is kept in sync. No API or behavior change.", "evidence": [ - "docs/framework/react/guides/hotkeys.md", - "pnpm -C packages/hotkeys exec vitest run (all passed, including tests/trigger.test.ts); intent validate packages/hotkeys/skills passed. Not run: fresh-consumer sessions." + "packages/hotkeys/src/hotkey-manager.ts characterKeysSuspended JSDoc; packages/hotkeys/src/key.types.ts UncasedLetterKey JSDoc; docs/reference/interfaces/HotkeyScopesState.md is regenerated from that JSDoc. The skill already uses ? in its examples." ] }, "skill:packages/lit-hotkeys/skills/lit-hotkeys/SKILL.md": { @@ -273,9 +273,9 @@ ] }, "planning:_artifacts": { - "fingerprint": "ffc199d6dc762f75128bd5ed0aa40c6c4d42c2cf7d479fc999c1b2245f2118f7", + "fingerprint": "8827a8c8b32448d3d80d21222d095553dfa7810f935fc7958f52fc58f488fcbf", "snapshot": { - "_artifacts/domain_map.yaml": "fd7871cd1e1825435a188393cea39ee713f75265a07f7d2b05694881b01f1efe", + "_artifacts/domain_map.yaml": "81f47610362c2c3891c750e50a75b13b461f6304005af9bd7d51a801386bc098", "_artifacts/skill_spec.md": "d77ed3bb07efdd8a167ae1b5ab08a23e1deba52832ad1bf1ea72625deb25082c", "_artifacts/skill_tree.yaml": "28586eb71e346a16cbaa064559562cb08199a684904db6dd0684251428afd35e", "docs/framework/alpine/guides/app-hotkeys.md": "9422d7d872521cc5fd2246b07408f10666790fa625fb78df519217b541873472", @@ -292,7 +292,7 @@ "docs/framework/preact/quick-start.md": "247a2beda75d6c50bc0345aa8a9ef0a247e588fe8f4cfe7ea7733c6c8c9f15db", "docs/framework/react/guides/app-hotkeys.md": "84085c3644fe0fbeab6fc4850866e26d75404d02fad7039336ac5555bdfb9f7a", "docs/framework/react/guides/cheat-sheet-ui-helpers.md": "a2c4c3add145ef9f04043edc7e2ca8b3fe07acdfea8c17144011da967ddfc318", - "docs/framework/react/guides/custom-hotkey-recording.md": "4fe7986194e14c13976027c15164492bcdcea652e8379e3f0fe84fa5d84f4847", + "docs/framework/react/guides/custom-hotkey-recording.md": "a34ffc847cc182231a6b50754be4f6ee9f06e107a3599a74fd64cacca17b3d31", "docs/framework/react/guides/hotkeys-provider-and-scopes.md": "57039ef29571e18c058ea77d104140e33c9b7fbda7de561c4d77247a47a566ce", "docs/framework/react/guides/hotkeys.md": "14f8f41603cb30d71ae69a527b6f3d58c9ade5d9e1530818c56e4dd32bfcd7c0", "docs/framework/react/guides/sequences.md": "35a2042e6adb52cca5c10ad36a8cbe65783b38be3383af612f368007a5f4b724", @@ -303,7 +303,7 @@ "docs/framework/svelte/quick-start.md": "d1995321a1c5032843ee5a802f3b699fa41cee6d17dd6f3c9349faed3c663b12", "docs/framework/vue/guides/hotkeys-provider-and-scopes.md": "939a50350a1f9bd8d80f4b0ef903293a8441bf783991af28d96c57da0efb2564", "docs/framework/vue/quick-start.md": "00e4e57173a5e03a8299398a1611e0a309738b0563f69e765bc10cda8fa95be1", - "docs/guides/sensible-defaults.md": "6a3de24ee472e3d885547a5801330d7c858e70923c0f9380b8c2d4b6ebe89853", + "docs/guides/sensible-defaults.md": "4d99dd18ced46fe8c0fa19dd627b2758176b0537a25a7f1267629a1f57129ef9", "packages/alpine-hotkeys/skills/alpine-hotkeys/SKILL.md": "9fbcfd1931996b186aed72bd06bae929b68dd83840b170a33cad1065c11db2e9", "packages/alpine-hotkeys/skills/alpine-hotkeys/references/app-hotkeys.md": "0fb12f409b5aec0999df3799f86d116b24d4d4d00131041e63d59264a7af1c98", "packages/alpine-hotkeys/src/createAppHotkeys.ts": "4b3745b96bdbf7971347bd930b9525b740abfffbd72dfed556d36cc0cbfa6757", @@ -330,14 +330,14 @@ "packages/ember-hotkeys/src/useHotkeyRecorder.ts": "67e6ac60574e3d510f8d6199a5eb92303b6315051d1fb8a42decf75dcebc070b", "packages/ember-hotkeys/src/useHotkeys.ts": "963345b3720ddefec8677b9b9d9dfa2b6346e22b32f9f2034d406b43e5c5ccf8", "packages/hotkeys/skills/app-hotkeys/SKILL.md": "454b7d1321a4f4d1a5aa4dd363466fb3acdd5f85935daa519768dc0a64622bcd", - "packages/hotkeys/skills/app-hotkeys/references/recording.md": "742e56e73e58abfbbe354ab03abca29e3ebe08d79a84b43daf842b594d6e2b4c", - "packages/hotkeys/skills/hotkeys-core/SKILL.md": "6a7f07c7d3d35af8c02dcc8835e97ae5a39ca498596665dd1e8894578d707062", + "packages/hotkeys/skills/app-hotkeys/references/recording.md": "b77809c9b99f7b90917b57bc7b0baa999ad346ed82e6ad39d476438e504b40a1", + "packages/hotkeys/skills/hotkeys-core/SKILL.md": "7b3987dbd1ff362ca2c243d7f091cfdfa76718ab004f0ca1940f37ebdde4def8", "packages/hotkeys/skills/hotkeys-core/references/scopes.md": "1139da465c06e76ee1d489cb14fc3ce952011666b67f64855846805c241c2108", "packages/hotkeys/skills/hotkeys-core/references/testing.md": "c2957eaac34ca431832069156504cf7434dcb96d5227bcb7cbb2129dc8e979bd", "packages/hotkeys/src/app-hotkeys.ts": "4620760d8409fb78a94319b6e52ca1a00c625121e29006fa1cef057fdeafa937", "packages/hotkeys/src/conflicts.ts": "3c8628500aee3e7ba14ec78411b5f5398fd66cbc00359ffdf227a81729a76fe5", - "packages/hotkeys/src/hotkey-manager.ts": "787f629388c0fc5ef9b656efbc39efd18c62cbee0f96b7c0ef6673abc4c1f6fe", - "packages/hotkeys/src/hotkey-recorder.ts": "1b194de54bbd7d94c7a3ee581103651eed7077334adac55522ff499c951a2d2c", + "packages/hotkeys/src/hotkey-manager.ts": "11d5c43a649bc98992db7e838171fd1be79d45009f344766626285ea347fecc4", + "packages/hotkeys/src/hotkey-recorder.ts": "55c0e764812a4dd3907c915939904613fc3b7b66d967e09e5bedb754b143056a", "packages/hotkeys/src/match.ts": "80c3c08023591cb2444aa2adbd5249ad7e2aeffd3dc4f8c529f142aab9141aaa", "packages/lit-hotkeys/skills/lit-hotkeys/SKILL.md": "326b0a1ddd9579c65389e755d5a2e0a69512ef7f91aca21bda7db9c0ddb51521", "packages/lit-hotkeys/skills/lit-hotkeys/references/app-hotkeys.md": "3c5b805f628d0b14361e43944283f3b7271362cc5831def6406e677ce21f2678", @@ -404,11 +404,11 @@ "packages/vue-hotkeys/src/useHotkeyRecorder.ts": "f9090de677350d72ae3e1732eab11e5b89b5cf00021f2cc5e88d2fe3f2fb743d", "packages/vue-hotkeys/src/useHotkeys.ts": "219ded7bd27e250567817a9e74cb6c0032a58c1da6a6be81e820f4a67ab6c8c7" }, - "head": "ae620714c86f3a9d9ee96804c3b6ecf8b02693b8", + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", "outcome": "no-change", - "reason": "Review follow-up: the ancestor ref retry comment names both retries, and a test covers a conflict found by the microtask retry when Suspense shows hidden content again. No skill or planning record describes ref registration timing.", + "reason": "Comment-only edits: the HotkeyScopesState.characterKeysSuspended JSDoc example changes from Shift+/ to ?, and the UncasedLetterKey comment says how the test copy of the list is kept in sync. No API or behavior change.", "evidence": [ - "Changed: packages/react-hotkeys/src/useHotkeys.ts at ae620714c86f3a9d9ee96804c3b6ecf8b02693b8" + "packages/hotkeys/src/hotkey-manager.ts characterKeysSuspended JSDoc; packages/hotkeys/src/key.types.ts UncasedLetterKey JSDoc; docs/reference/interfaces/HotkeyScopesState.md is regenerated from that JSDoc. The skill already uses ? in its examples." ] }, "source:.changeset/intent-skills.md": { @@ -664,30 +664,24 @@ ] }, "source:docs/reference/classes/HotkeyManager.md": { - "fingerprint": "7b70e80bd99b17bd2e3a5b9a8e6ddc3975b4b2d5e68a620aaca596dc5a27e501", + "fingerprint": "b736e804ca87593fb73865ff759cec35b0e882ae80173774d368f27d7b0076a5", "snapshot": { - "docs/reference/classes/HotkeyManager.md": "64c4d0793ff84c6d86324355e224c40810229fbc3539b478a56900599b4fb467" + "docs/reference/classes/HotkeyManager.md": "04225c4292b8d315af3aa7384b3024bdd0ac96c60de55615b847c919b273c579" }, - "head": "345b94ef72a6b78b6fa8de153b98fa6f73e8ecfd", - "outcome": "no-change", - "reason": "Generated by pnpm generate-docs from changed JSDoc; line numbers or doc text only. Guidance reviewed under app-hotkeys and hotkeys-core.", - "evidence": [ - "docs/reference/classes/HotkeyManager.md", - "pnpm -C packages/hotkeys exec vitest run (all passed, including tests/trigger.test.ts); intent validate packages/hotkeys/skills passed. Not run: fresh-consumer sessions." - ] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:docs/reference/functions/getHotkeyManager.md": { - "fingerprint": "effcff4496460892c175e1cebaabe8a6a93105a04ce526e6e6dd266f9728372d", + "fingerprint": "068e8543b8a799f27f911aa3457a7cbb2eb19a0533a39be647e0e91a3bf7c3b5", "snapshot": { - "docs/reference/functions/getHotkeyManager.md": "81499c5666ee2e657e87d1d256af049261ee32524942c08c8018955c87c43392" + "docs/reference/functions/getHotkeyManager.md": "071c823e94184cb47fc5f514df5540061ce62b1b7b57f513c7d59d2bad7957eb" }, - "head": "345b94ef72a6b78b6fa8de153b98fa6f73e8ecfd", - "outcome": "no-change", - "reason": "Generated by pnpm generate-docs from changed JSDoc; line numbers or doc text only. Guidance reviewed under app-hotkeys and hotkeys-core.", - "evidence": [ - "docs/reference/functions/getHotkeyManager.md", - "pnpm -C packages/hotkeys exec vitest run (all passed, including tests/trigger.test.ts); intent validate packages/hotkeys/skills passed. Not run: fresh-consumer sessions." - ] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:examples/alpine/kitchen-sink/index.html": { "fingerprint": "e576c33ec891eff09138d3a05b3c29fffc60c984b7f4e88a1dca3848a899cdc5", @@ -1332,16 +1326,15 @@ ] }, "source:docs/reference/interfaces/HotkeyScopesState.md": { - "fingerprint": "75adcbfef5ca1f262c223317b7da5e47d4caad25a6456587f9c3f28eb9b8c0aa", + "fingerprint": "9d3c5b5d319b99161742624f77ac6a471e8c361e67b3dec43dfd13bb46175ea1", "snapshot": { - "docs/reference/interfaces/HotkeyScopesState.md": "79d1ec5b41aa42bafaa7e1d61b757543bfd584e5f6946bf0533e896a8262629e" + "docs/reference/interfaces/HotkeyScopesState.md": "ab3f334792b01a2d8632160491da499757874f5e28b96a0047147d6353392155" }, - "head": "345b94ef72a6b78b6fa8de153b98fa6f73e8ecfd", + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", "outcome": "no-change", - "reason": "Generated by pnpm generate-docs from changed JSDoc; line numbers or doc text only. Guidance reviewed under app-hotkeys and hotkeys-core.", + "reason": "Comment-only edits: the HotkeyScopesState.characterKeysSuspended JSDoc example changes from Shift+/ to ?, and the UncasedLetterKey comment says how the test copy of the list is kept in sync. No API or behavior change.", "evidence": [ - "docs/reference/interfaces/HotkeyScopesState.md", - "pnpm -C packages/hotkeys exec vitest run (all passed, including tests/trigger.test.ts); intent validate packages/hotkeys/skills passed. Not run: fresh-consumer sessions." + "packages/hotkeys/src/hotkey-manager.ts characterKeysSuspended JSDoc; packages/hotkeys/src/key.types.ts UncasedLetterKey JSDoc; docs/reference/interfaces/HotkeyScopesState.md is regenerated from that JSDoc. The skill already uses ? in its examples." ] }, "source:docs/reference/interfaces/HotkeySequenceOptions.md": { @@ -1459,14 +1452,17 @@ ] }, "source:docs/framework/alpine/guides/hotkey-manager.md": { - "fingerprint": "d1d957e4699a88ccef20cf08d01cd14499f47777b71d90aed7bbd335e24973cd", + "fingerprint": "ab468e358817e20cf371b128311c171088af79e38a5e1819113a82f1a1b9b6f1", "snapshot": { - "docs/framework/alpine/guides/hotkey-manager.md": "25d0a35af029debcd3b888bee97edd2f3e6f709893d767ecf2c02ac4d842b052" + "docs/framework/alpine/guides/hotkey-manager.md": "a6a8a2a5fa62e813093424587b07b4fbc7cebac3a8e295f0f50937271a324482" }, - "head": "cd1c66aab538ccac294e72ee36ae4466fa9b2d2b", - "outcome": "no-change", - "reason": "Guide change for formatForAria, suspendCharacterKeys, the Accessibility guide, or list wording. The skill reflects the API changes.", - "evidence": ["packages/alpine-hotkeys/skills/alpine-hotkeys/SKILL.md"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "updated", + "reason": "Hotkey string types now reject Shift with a symbol, and the recorder never records one. The guides were updated to match; hotkeys-core SKILL.md and app-hotkeys references/recording.md carry the same rules.", + "evidence": [ + "packages/hotkeys/skills/hotkeys-core/SKILL.md", + "packages/hotkeys/skills/app-hotkeys/references/recording.md" + ] }, "source:docs/framework/alpine/reference/functions/createHotkeysScope.md": { "fingerprint": "2e94ba7a6b5615da65f758fd6e6ad1f2f43ba272a4e0fa7990d7b25083150f71", @@ -1663,14 +1659,17 @@ ] }, "source:docs/framework/angular/guides/hotkey-manager.md": { - "fingerprint": "dc77b7357f3ae331788daf1dda7bb62503b7744e14aa16ccc9988c3a9aac9a0d", + "fingerprint": "82ebd4e00bbb2d90faa7062415dfe8303d4d24f78180b038c670e5135637b6e5", "snapshot": { - "docs/framework/angular/guides/hotkey-manager.md": "b904691a955489032231bbe6f241220614be58c7673a8718a384c69b6107da85" + "docs/framework/angular/guides/hotkey-manager.md": "a529323a47a6e23e1d24be8373509eaec870cc4c5198cd599debda871b3f3308" }, - "head": "cd1c66aab538ccac294e72ee36ae4466fa9b2d2b", - "outcome": "no-change", - "reason": "Guide change for formatForAria, suspendCharacterKeys, the Accessibility guide, or list wording. The skill reflects the API changes.", - "evidence": ["packages/angular-hotkeys/skills/angular-hotkeys/SKILL.md"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "updated", + "reason": "Hotkey string types now reject Shift with a symbol, and the recorder never records one. The guides were updated to match; hotkeys-core SKILL.md and app-hotkeys references/recording.md carry the same rules.", + "evidence": [ + "packages/hotkeys/skills/hotkeys-core/SKILL.md", + "packages/hotkeys/skills/app-hotkeys/references/recording.md" + ] }, "source:docs/framework/angular/reference/functions/injectHotkeyScopesState.md": { "fingerprint": "3db0175bb8f1589b5792414efeeb48bb04d090d9f0831c1879d4b8916f5882dd", @@ -1706,14 +1705,17 @@ ] }, "source:docs/framework/ember/guides/hotkey-manager.md": { - "fingerprint": "bad0e4080eec8d1811ae029d2dc1c2aded4e0cf304c415c540f3737c078e0594", + "fingerprint": "3bbddfe06343aeb80004b0611ba31be5ad326b4757bf8dd48e5234e654df992b", "snapshot": { - "docs/framework/ember/guides/hotkey-manager.md": "6b4b7fa929ed8d2de346acbd833e9ddd9906216a6e08a7cc8e3166c0d760a248" + "docs/framework/ember/guides/hotkey-manager.md": "9b1ea8c17e33cbd7ff392b2720292f60617a6b451a8a5e20dafa851c0f99b5f0" }, - "head": "cd1c66aab538ccac294e72ee36ae4466fa9b2d2b", - "outcome": "no-change", - "reason": "Guide change for formatForAria, suspendCharacterKeys, the Accessibility guide, or list wording. The skill reflects the API changes.", - "evidence": ["packages/ember-hotkeys/skills/ember-hotkeys/SKILL.md"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "updated", + "reason": "Hotkey string types now reject Shift with a symbol, and the recorder never records one. The guides were updated to match; hotkeys-core SKILL.md and app-hotkeys references/recording.md carry the same rules.", + "evidence": [ + "packages/hotkeys/skills/hotkeys-core/SKILL.md", + "packages/hotkeys/skills/app-hotkeys/references/recording.md" + ] }, "source:docs/framework/ember/reference/functions/useHotkeyScopesState.md": { "fingerprint": "f2212051b3da02959e427889075aa04747035b3d870487ee286aba5dcc26d2c9", @@ -1751,14 +1753,17 @@ ] }, "source:docs/framework/lit/guides/hotkey-manager.md": { - "fingerprint": "fe50936cc5ee47dfd477f10c36958e98717ac5bb4c2619d1f975580ded5ba5af", + "fingerprint": "d5a0cf6ec95c9db84880d3e9f5ff556d681b162605ca0cfe968507ec7ddd4d30", "snapshot": { - "docs/framework/lit/guides/hotkey-manager.md": "3d9c25e4590cae204243e2674916213b3380b7bde29ec952b313d0ba893afd53" + "docs/framework/lit/guides/hotkey-manager.md": "e1f227f127671c8921c8dfc10cd8454f3d560e59daf481b6d5a121306d594e63" }, - "head": "cd1c66aab538ccac294e72ee36ae4466fa9b2d2b", - "outcome": "no-change", - "reason": "Guide change for formatForAria, suspendCharacterKeys, the Accessibility guide, or list wording. The skill reflects the API changes.", - "evidence": ["packages/lit-hotkeys/skills/lit-hotkeys/SKILL.md"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "updated", + "reason": "Hotkey string types now reject Shift with a symbol, and the recorder never records one. The guides were updated to match; hotkeys-core SKILL.md and app-hotkeys references/recording.md carry the same rules.", + "evidence": [ + "packages/hotkeys/skills/hotkeys-core/SKILL.md", + "packages/hotkeys/skills/app-hotkeys/references/recording.md" + ] }, "source:docs/framework/lit/reference/classes/HotkeyScopesStateController.md": { "fingerprint": "4e1f78d08d888959951f3612f851fe07d527659d9bc5f291a075e5428d97a0c1", @@ -1796,14 +1801,17 @@ ] }, "source:docs/framework/octane/guides/hotkey-manager.md": { - "fingerprint": "3dc73fa6b44a38e4cd5d64685370397e32e6a379b0aba4091917aa03359f96aa", + "fingerprint": "31ff170f3c034307e34169e76ca56f29dd81286190927294fe4c34d5a53fa26f", "snapshot": { - "docs/framework/octane/guides/hotkey-manager.md": "ca0eed70bb3c23bd5ff1b6da33b3fa2f753e66e856584c79c1931c0337e4dd3f" + "docs/framework/octane/guides/hotkey-manager.md": "9dd37065339a378bcb113e7aa3c2760e279266849a0ad888b8ddd5d7d68dd3ab" }, - "head": "cd1c66aab538ccac294e72ee36ae4466fa9b2d2b", - "outcome": "no-change", - "reason": "Guide change for formatForAria, suspendCharacterKeys, the Accessibility guide, or list wording. The skill reflects the API changes.", - "evidence": ["packages/octane-hotkeys/skills/octane-hotkeys/SKILL.md"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "updated", + "reason": "Hotkey string types now reject Shift with a symbol, and the recorder never records one. The guides were updated to match; hotkeys-core SKILL.md and app-hotkeys references/recording.md carry the same rules.", + "evidence": [ + "packages/hotkeys/skills/hotkeys-core/SKILL.md", + "packages/hotkeys/skills/app-hotkeys/references/recording.md" + ] }, "source:docs/framework/octane/reference/functions/useHotkeyScopesState.md": { "fingerprint": "8e98b358165160f138590ce2bfab7b43ab80701593cfb54114c2a6f72e49a6f6", @@ -1839,14 +1847,17 @@ ] }, "source:docs/framework/preact/guides/hotkey-manager.md": { - "fingerprint": "b19ca4bc7075f2cf2f1b231f51c9569c34d2cc191befa93d1c9dc072a86bdce5", + "fingerprint": "652f7b92b817b376bab108d365d9a59354ada747726462f6add4910ccfc2c312", "snapshot": { - "docs/framework/preact/guides/hotkey-manager.md": "ca8f4f7df2030a1aeaef48aed0f7f0a90425bdaf6d455ec0cd595250834ec2ef" + "docs/framework/preact/guides/hotkey-manager.md": "354a9f5d2c9c002dfa7bfecc577cbc6303ed5402e55657a47464255d2ad4541e" }, - "head": "cd1c66aab538ccac294e72ee36ae4466fa9b2d2b", - "outcome": "no-change", - "reason": "Guide change for formatForAria, suspendCharacterKeys, the Accessibility guide, or list wording. The skill reflects the API changes.", - "evidence": ["packages/preact-hotkeys/skills/preact-hotkeys/SKILL.md"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "updated", + "reason": "Hotkey string types now reject Shift with a symbol, and the recorder never records one. The guides were updated to match; hotkeys-core SKILL.md and app-hotkeys references/recording.md carry the same rules.", + "evidence": [ + "packages/hotkeys/skills/hotkeys-core/SKILL.md", + "packages/hotkeys/skills/app-hotkeys/references/recording.md" + ] }, "source:docs/framework/preact/reference/functions/useHotkeyScopesState.md": { "fingerprint": "5ad1a070c8823b82ced0484dbf650b619adea59670160f41e4accd58d9950491", @@ -1869,14 +1880,17 @@ "evidence": ["docs/framework/preact/reference/index.md"] }, "source:docs/framework/react/guides/hotkey-manager.md": { - "fingerprint": "cb66e78b031fb982254c5aebaca447783100ed767b9374316f19313fcd4bc92f", + "fingerprint": "a501f019f903a67bbf34c44efa582825c19832f7f70604ba93f812acf4fb0605", "snapshot": { - "docs/framework/react/guides/hotkey-manager.md": "cd6891f725ece10702435a6999edb6c9017b7d235f38722157d391a3f3393811" + "docs/framework/react/guides/hotkey-manager.md": "7f29292e70ce910993d88d1c6db807a2f3343c176b9d6e88c1d9a51071497f00" }, - "head": "cd1c66aab538ccac294e72ee36ae4466fa9b2d2b", - "outcome": "no-change", - "reason": "Guide change for formatForAria, suspendCharacterKeys, the Accessibility guide, or list wording. The skill reflects the API changes.", - "evidence": ["packages/react-hotkeys/skills/react-hotkeys/SKILL.md"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "updated", + "reason": "Hotkey string types now reject Shift with a symbol, and the recorder never records one. The guides were updated to match; hotkeys-core SKILL.md and app-hotkeys references/recording.md carry the same rules.", + "evidence": [ + "packages/hotkeys/skills/hotkeys-core/SKILL.md", + "packages/hotkeys/skills/app-hotkeys/references/recording.md" + ] }, "source:docs/framework/react/reference/functions/useHotkeyScopesState.md": { "fingerprint": "c634febd91fb02692ab3d271a87c0e4bfb90aad0f56d692f565f261725c74e25", @@ -1912,14 +1926,17 @@ ] }, "source:docs/framework/solid/guides/hotkey-manager.md": { - "fingerprint": "76ec9052b7a7798240cbe5db2ac0c0a62661634054875487fd34e941faff0c21", + "fingerprint": "4047dea7ffb8dcac0acd1cb21a3f641412f41d9f21a7fc4e83371614def66104", "snapshot": { - "docs/framework/solid/guides/hotkey-manager.md": "dbf4f4241290d5232ad499b40f0938146f0740f48f98f821b05bfb15d746ee73" + "docs/framework/solid/guides/hotkey-manager.md": "298926c8f5cf7b9782201e3d19fe3bd1707621a4ccb8f18ec10dbe34405860d3" }, - "head": "cd1c66aab538ccac294e72ee36ae4466fa9b2d2b", - "outcome": "no-change", - "reason": "Guide change for formatForAria, suspendCharacterKeys, the Accessibility guide, or list wording. The skill reflects the API changes.", - "evidence": ["packages/solid-hotkeys/skills/solid-hotkeys/SKILL.md"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "updated", + "reason": "Hotkey string types now reject Shift with a symbol, and the recorder never records one. The guides were updated to match; hotkeys-core SKILL.md and app-hotkeys references/recording.md carry the same rules.", + "evidence": [ + "packages/hotkeys/skills/hotkeys-core/SKILL.md", + "packages/hotkeys/skills/app-hotkeys/references/recording.md" + ] }, "source:docs/framework/solid/reference/functions/createHotkeyScopesState.md": { "fingerprint": "864180dcde757cc13476c61d717950941a249a00b9bcb8847fdd7445c165c3a3", @@ -1955,14 +1972,17 @@ ] }, "source:docs/framework/svelte/guides/hotkey-manager.md": { - "fingerprint": "38368c6e70124665d79fe4d8bca888e282b587170b3c6c595c20b06a4c78adfd", + "fingerprint": "04573258410ed0a36f7e8a2c3f54154de670b38992e832d7913fecc21ac7a9a4", "snapshot": { - "docs/framework/svelte/guides/hotkey-manager.md": "6b6194bf478d2e854d0caca93c55953d3c9084c95477bf01887c0cf0bfe8ba3c" + "docs/framework/svelte/guides/hotkey-manager.md": "565d5efd25d3503f2892e976505e32e183e7d1a1932f0249264a928925f797a3" }, - "head": "cd1c66aab538ccac294e72ee36ae4466fa9b2d2b", - "outcome": "no-change", - "reason": "Guide change for formatForAria, suspendCharacterKeys, the Accessibility guide, or list wording. The skill reflects the API changes.", - "evidence": ["packages/svelte-hotkeys/skills/svelte-hotkeys/SKILL.md"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "updated", + "reason": "Hotkey string types now reject Shift with a symbol, and the recorder never records one. The guides were updated to match; hotkeys-core SKILL.md and app-hotkeys references/recording.md carry the same rules.", + "evidence": [ + "packages/hotkeys/skills/hotkeys-core/SKILL.md", + "packages/hotkeys/skills/app-hotkeys/references/recording.md" + ] }, "source:docs/framework/svelte/reference/functions/getHotkeyScopesState.md": { "fingerprint": "1a48b873da720be791f5a4c013d40858b7ed63e9ecffd1d0d4618b631ed66f27", @@ -2012,14 +2032,17 @@ ] }, "source:docs/framework/vue/guides/hotkey-manager.md": { - "fingerprint": "d80983215f68acd7f5b42e71105d9e84cd89cc2bc6445032c859466be12167c7", + "fingerprint": "4b9a83c1351b0183ee2260df0ee77cd55aa1f1db55f2ba5d5257765af14b57c7", "snapshot": { - "docs/framework/vue/guides/hotkey-manager.md": "ee6ba9829f602f912f0fc6ad7a0411b76f4a1364cddf412dcc538896b10ee756" + "docs/framework/vue/guides/hotkey-manager.md": "48ab2673bc5880cbe878774f606e331aeea737497266d1ec85561a7d47191528" }, - "head": "cd1c66aab538ccac294e72ee36ae4466fa9b2d2b", - "outcome": "no-change", - "reason": "Guide change for formatForAria, suspendCharacterKeys, the Accessibility guide, or list wording. The skill reflects the API changes.", - "evidence": ["packages/vue-hotkeys/skills/vue-hotkeys/SKILL.md"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "updated", + "reason": "Hotkey string types now reject Shift with a symbol, and the recorder never records one. The guides were updated to match; hotkeys-core SKILL.md and app-hotkeys references/recording.md carry the same rules.", + "evidence": [ + "packages/hotkeys/skills/hotkeys-core/SKILL.md", + "packages/hotkeys/skills/app-hotkeys/references/recording.md" + ] }, "source:docs/framework/vue/reference/functions/useHotkeyScopesState.md": { "fingerprint": "6aad8d327bb70d6c2c2c544252f15bba80dd521f1d54ba39ca90e6da44b38ab3", @@ -2042,17 +2065,14 @@ "evidence": ["docs/framework/vue/reference/index.md"] }, "source:docs/reference/index.md": { - "fingerprint": "3b1bf23b23fa002260ffefe23d892183c3d8890c8998783d296faa57d1f6340c", + "fingerprint": "3b0a7f104655b4402d03867364eac3249e553706b48f5d7bf7cd047abb6d8f55", "snapshot": { - "docs/reference/index.md": "a75d8cd96aca75cc26c87731d147a49f88cc4203d804e87ca4ebc76b02230d8d" + "docs/reference/index.md": "d5783312e22b002b424c29f836990b96735121d6883e304d3b7bc08f723f94f4" }, - "head": "33e0b46f70957660418f1c76e9180c5badccd1fc", - "outcome": "no-change", - "reason": "Generated by pnpm generate-docs from the changed app-hotkeys.ts: line numbers, the new AppHotkeyDeclaration page, and the defineAppHotkeys and DefinedAppHotkeys docs. Guidance reviewed under app-hotkeys.", - "evidence": [ - "docs/reference/index.md", - "packages/hotkeys: tsc, test:types and vitest (61 files, 2187 tests) pass; intent validate passed. Not run: fresh-consumer sessions." - ] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:docs/reference/type-aliases/HotkeyRegistrationStatus.md": { "fingerprint": "4609753376173d2719336908a0b5d5dbc5d1dbbda35f4c5ce8b26206d294de8e", @@ -2668,16 +2688,14 @@ ] }, "source:docs/reference/type-aliases/Target.md": { - "fingerprint": "a2dd0f2c761b2ffad8bbb14b82903e48c2977e92bcbb189bea349a812639935f", + "fingerprint": "c72891039ad33035c67b7cfb3d75d713bcddb9566681eb03c26ac942c7c1c6df", "snapshot": { - "docs/reference/type-aliases/Target.md": "4f2c82f309c040037439ebec193dbf681ca8236c4a46c288404d67bffe32aa2e" + "docs/reference/type-aliases/Target.md": "7615a196810443a3fccda7b1a1949f0179cb0a39df6586ab2587fb3c81199d3c" }, - "head": "1f0a2c627c4a18f005762600966a81e9b8daef3a", - "outcome": "no-change", - "reason": "Refactor to shared types and helpers, generated reference docs, and an example type fix; no guidance changes.", - "evidence": [ - "Behavior and public names are unchanged; reference docs are regenerated by pnpm generate-docs." - ] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:packages/hotkeys/src/_event-target.ts": { "fingerprint": "6ba19cb0cd0b063bd009d754ad5e1d3671a1a78a36aec38d39bc406afd15c0be", @@ -2690,14 +2708,16 @@ "evidence": ["packages/hotkeys/skills/hotkeys-core/SKILL.md"] }, "source:docs/config.json": { - "fingerprint": "ec197d36e49ea6b1d211fe8f85fdc0807f8222f27031535ef492e22e7965ec7f", + "fingerprint": "f77246a68cc89a8645c6987556897fa3f777011475648b7023046ac79a04ad61", "snapshot": { - "docs/config.json": "dd0f03d134bdc4bc77697d944c09009a5efd9dde6a46ed0e01a3e38c70699455" + "docs/config.json": "b250e8830f9d44a7d2a1bc4670b0221aa36208e4f3d4355ef92fff6fb233a9c1" }, - "head": "f9fc17f0bbb537e70119ec81cec5d3d94294aa8e", + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", "outcome": "no-change", - "reason": "Covered by the key lock state rows added to each adapter skill and the core testing reference; no further guidance change", - "evidence": ["docs/config.json"] + "reason": "Docs navigation only: adds the Choosing Valid Hotkeys guide for every framework and moves the provider guide third. No API or behavior change for skills to cover.", + "evidence": [ + "docs/config.json Core Guides children for each framework; skills do not reference docs navigation." + ] }, "source:docs/devtools.md": { "fingerprint": "e35641de2fcdbe3c460042c80018eb1d53d9ca335b226917c13cc516ccdfe7a8", @@ -4301,14 +4321,14 @@ ] }, "source:docs/reference/classes/HotkeyRecorder.md": { - "fingerprint": "10fd73d6d2b482bac55e2f357780c165429b48e593ad06960db8054c2e1bd317", + "fingerprint": "4782d079980dedb33824be83d8aa62405dd0cd47648dc29a3204e7a41d31d11e", "snapshot": { - "docs/reference/classes/HotkeyRecorder.md": "b4bb81dfd252509e154da098e77b3523d088c6baa4ba116926da94142ab2d71c" + "docs/reference/classes/HotkeyRecorder.md": "2342d67536f1847184382158031c975b050e85f2afa1467581edd8eaa3fc37f8" }, - "head": "c94ffd5ba8b28f537cfd2f128bb9a27bc537c22b", - "outcome": "no-change", - "reason": "Regenerated reference docs for the updated JSDoc; no packaged guidance depends on them.", - "evidence": ["docs/reference/classes/HotkeyRecorder.md"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:packages/hotkeys/tests/hotkey-recorder-ssr.test.ts": { "fingerprint": "394b648ffc52be332ca1ab001ee62311b653f8162c126029f9856e8728ebdbc4", @@ -4400,15 +4420,15 @@ "evidence": ["packages/hotkeys/skills/hotkeys-core/SKILL.md"] }, "source:packages/hotkeys/tests/match.test.ts": { - "fingerprint": "a0d085ec8a67c83509f1527c8728ed6ced07c939b9bd6ab5b326fd4eb281f159", + "fingerprint": "29930787adfc4098826fa994f10f2f118b0f65e77ca0e48a5f2cfaaf8be07946", "snapshot": { - "packages/hotkeys/tests/match.test.ts": "22cd9014131211bdcd97ce506b8d89ca895e823a0ac0dff3b1f0bc1265dfd7c1" + "packages/hotkeys/tests/match.test.ts": "c91b33b7a7b671c282978b59f7d4a6ce3cf58065ac9e2efcaab064cba6455dcd" }, - "head": "538676c009532021d644ff0628234d2d2e3199d2", + "head": "ab62e7bdc2b417476e6b9f7664104c27ae14a178", "outcome": "no-change", - "reason": "Adapter validation, defaults, and kind-specific options moved into HotkeyManager.register. String hotkeys register as written from every entry point, and chord objects register in normalized form, including in createHotkeyChordHandler's context. No skill or planning artifact describes registration spelling, adapter validation, or the handler's reported hotkey: a search of packages/*/skills and _artifacts for normaliz, as written, registration.hotkey, context.hotkey, createHotkeyChordHandler, and Meta+S finds nothing.", + "reason": "Formatting only: oxfmt rewrapped lines. No API, behavior, or doc change.", "evidence": [ - "Changed: packages/hotkeys/tests/match.test.ts at 538676c009532021d644ff0628234d2d2e3199d2" + "pnpm format output; git diff shows whitespace and line-wrap changes only." ] }, "source:packages/hotkeys/tests/sequence-regressions.test.ts": { @@ -5230,54 +5250,54 @@ "evidence": ["docs/reference/functions/getKeyStateTracker.md"] }, "source:docs/reference/interfaces/HotkeyChordRecorderOptions.md": { - "fingerprint": "843c02a1650f2f477feba6bb82a79ba17933332e753bcc3b7430d26684a2e3ed", + "fingerprint": "0b62125460cac46b34d9d048a438203be187b4eb08e2875054873325f8f51040", "snapshot": { - "docs/reference/interfaces/HotkeyChordRecorderOptions.md": "76ff74f2d61266768302c3aebc522523f63da7fb72e8a9eda2b4d349a34deeda" + "docs/reference/interfaces/HotkeyChordRecorderOptions.md": "f31d87e3b1f3721355c467ebaf4dd560426c4863856ff7c7b39b62bcb48ff071" }, - "head": "c94ffd5ba8b28f537cfd2f128bb9a27bc537c22b", - "outcome": "no-change", - "reason": "Regenerated reference docs for the updated JSDoc; no packaged guidance depends on them.", - "evidence": ["docs/reference/interfaces/HotkeyChordRecorderOptions.md"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:docs/reference/interfaces/HotkeyChordRecorderValidationContext.md": { - "fingerprint": "1c949e0f783c83ba59de744b3e294420fa42279b13670e03a0b1b74e9217f363", + "fingerprint": "d0af067f7b697bb199807d06bc98883abc48b7dfc9d06f3ee10eb1cce785e382", "snapshot": { - "docs/reference/interfaces/HotkeyChordRecorderValidationContext.md": "8e4dcc13af619c6eee2059c50f372416eebbd81f73a4505f2f5cc515274cee3d" + "docs/reference/interfaces/HotkeyChordRecorderValidationContext.md": "80a9dbff718c9960c8e20af8fcf052c65d738cc48247570b664557e5f9ff3922" }, - "head": "cd1c66aab538ccac294e72ee36ae4466fa9b2d2b", - "outcome": "no-change", - "reason": "Regenerated reference page. The skills cover the formatForAria, createFormatter, and suspendCharacterKeys API changes.", - "evidence": ["packages/hotkeys/skills/hotkeys-core/SKILL.md"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:docs/reference/interfaces/HotkeyRecorderState.md": { - "fingerprint": "3944352c13861db866949f67ca7e28378b0eec5de4b3527c4910d0aad2afb067", + "fingerprint": "714a0360cfcb9ef17152e8d6a61749488559ab0cb88905a0f01d10f6d98e1a28", "snapshot": { - "docs/reference/interfaces/HotkeyRecorderState.md": "7419d4ce1d94a27f6bae3b8f28199d9695d13bded275da8ffdbf9399465ff3a7" + "docs/reference/interfaces/HotkeyRecorderState.md": "02ac42309e271df80bfba600af5c683f376ed223864a55a2d6e8dae308646998" }, - "head": "cd1c66aab538ccac294e72ee36ae4466fa9b2d2b", - "outcome": "no-change", - "reason": "Regenerated reference page. The skills cover the formatForAria, createFormatter, and suspendCharacterKeys API changes.", - "evidence": ["packages/hotkeys/skills/hotkeys-core/SKILL.md"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:docs/reference/interfaces/HotkeySequenceRecorderOptions.md": { - "fingerprint": "60a6133b2c500c88422f89ee6f1a47164958b2bfcccbb85197c108b1a0960891", + "fingerprint": "54a550e92ec0c85799a21ea4b573368028a87127fab59d7ebabbed56d7bed999", "snapshot": { - "docs/reference/interfaces/HotkeySequenceRecorderOptions.md": "5d4a64fb918ef736bbda45c057e9da09a91d597caa65929e9e677465d000d14d" + "docs/reference/interfaces/HotkeySequenceRecorderOptions.md": "9ddbbef5c8c031066a96d18d6c3351f368ef918a8c526f5972fcfad772730e87" }, - "head": "c94ffd5ba8b28f537cfd2f128bb9a27bc537c22b", - "outcome": "no-change", - "reason": "Regenerated reference docs for the updated JSDoc; no packaged guidance depends on them.", - "evidence": ["docs/reference/interfaces/HotkeySequenceRecorderOptions.md"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:docs/reference/interfaces/HotkeySequenceRecorderValidationContext.md": { - "fingerprint": "e577ab8c58c0c073803b8cdb161870ae2d991cec8f8e7c46a7e9fafc1327c823", + "fingerprint": "dd5357668d2a62fb4ae4c4974d1a45edf0165341abae29ac8f6b13bbc900e746", "snapshot": { - "docs/reference/interfaces/HotkeySequenceRecorderValidationContext.md": "18259c65e7b18d9ea45d2ebd135d62674a967812b255383b19779eb74113316d" + "docs/reference/interfaces/HotkeySequenceRecorderValidationContext.md": "b91d29a9964ea2d8d33e3518e0c9ffbcfbf8539fe9ddb2037e84d2d903797b5c" }, - "head": "cd1c66aab538ccac294e72ee36ae4466fa9b2d2b", - "outcome": "no-change", - "reason": "Regenerated reference page. The skills cover the formatForAria, createFormatter, and suspendCharacterKeys API changes.", - "evidence": ["packages/hotkeys/skills/hotkeys-core/SKILL.md"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:docs/reference/interfaces/KeyStateTrackerState.md": { "fingerprint": "9d3eeb71aa5f03e9d2457a12c3dfef6a95dff234133447c353a847fb6cfd4eab", @@ -5290,24 +5310,24 @@ "evidence": ["docs/reference/interfaces/KeyStateTrackerState.md"] }, "source:docs/reference/interfaces/RecorderOptions.md": { - "fingerprint": "96200fa9425a772c04ac9196ad0404ca77f02ea4464be5f544390558ca1f5465", + "fingerprint": "9ee9e95a0a6a5815d652eaaa42004505d2ae592dd99a29fec8cddfc44a28c846", "snapshot": { - "docs/reference/interfaces/RecorderOptions.md": "2e18fae6224f2c9120ba0229570088d29902d34f538ac1deecd445f2bc096865" + "docs/reference/interfaces/RecorderOptions.md": "1f897cdb7d336983d0c846edb8469eeb8beb34ecaf1f5cc9f1e500a461e7cec5" }, - "head": "cd1c66aab538ccac294e72ee36ae4466fa9b2d2b", - "outcome": "no-change", - "reason": "Regenerated reference page. The skills cover the formatForAria, createFormatter, and suspendCharacterKeys API changes.", - "evidence": ["packages/hotkeys/skills/hotkeys-core/SKILL.md"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:docs/reference/interfaces/RecorderRejection.md": { - "fingerprint": "a92aed819321843ae484bf432085542dd7db76ba55f1021e7e3ed39bed4bbd86", + "fingerprint": "c271512391f532e6387bc5bfa88e54c43da3b89aa3a1036e79e48920332fc6f7", "snapshot": { - "docs/reference/interfaces/RecorderRejection.md": "a805c265d22b77d6acf5ec1567e5c6481676e9a84b39f544e5594073262ca407" + "docs/reference/interfaces/RecorderRejection.md": "e31084cc8de06b495fb92fcb8162a64be3eb2c4c3b2bbb891a7bb65349f262df" }, - "head": "cd1c66aab538ccac294e72ee36ae4466fa9b2d2b", - "outcome": "no-change", - "reason": "Regenerated reference page. The skills cover the formatForAria, createFormatter, and suspendCharacterKeys API changes.", - "evidence": ["packages/hotkeys/skills/hotkeys-core/SKILL.md"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:docs/reference/interfaces/ValidationResult.md": { "fingerprint": "a919461626358d33b940da6eb307b4fdfd24ced9c6a829bb4e449939c64c2504", @@ -5320,44 +5340,44 @@ "evidence": ["docs/reference/interfaces/ValidationResult.md"] }, "source:docs/reference/type-aliases/HotkeyRecorderCommitKeys.md": { - "fingerprint": "55c574f649dacb9c4dfcdf3028496f428ac5edb48fb090d1d888d3b038f169ab", + "fingerprint": "fed3670f2afa6e56d7532193e00767526f4b46dd4e6a181b8f240169ac8a0c20", "snapshot": { - "docs/reference/type-aliases/HotkeyRecorderCommitKeys.md": "54652ed491dc20b846845f9466f48afa5c5c0d74bd1453d2813860f471b67500" + "docs/reference/type-aliases/HotkeyRecorderCommitKeys.md": "61d44340e87cb1f7bf7f958d4dbbc17df35014599b1ffe78a6e253d359973479" }, - "head": "cd1c66aab538ccac294e72ee36ae4466fa9b2d2b", - "outcome": "no-change", - "reason": "Regenerated reference page. The skills cover the formatForAria, createFormatter, and suspendCharacterKeys API changes.", - "evidence": ["packages/hotkeys/skills/hotkeys-core/SKILL.md"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:docs/reference/type-aliases/HotkeyRecorderOptions.md": { - "fingerprint": "040ab8ac3e28e53b30ced01880ab6b297101a53d344580c53a80dc605e85bf0a", + "fingerprint": "eed66ea2bc11dc08746c18d9aa0d06666a5c47cdbd78f6268e3efeb1e6e28c26", "snapshot": { - "docs/reference/type-aliases/HotkeyRecorderOptions.md": "aca848ee09f810c5dac6c9564ff0f61d3c976826ecee8f028625be8a7fffb015" + "docs/reference/type-aliases/HotkeyRecorderOptions.md": "509c6b16a3da1f08fa1c09b9847339fb1217322b17e775af3ce14b52a30e3245" }, - "head": "c94ffd5ba8b28f537cfd2f128bb9a27bc537c22b", - "outcome": "no-change", - "reason": "Regenerated reference docs for the updated JSDoc; no packaged guidance depends on them.", - "evidence": ["docs/reference/type-aliases/HotkeyRecorderOptions.md"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:docs/reference/type-aliases/HotkeyRecorderValidationContext.md": { - "fingerprint": "50277a157515f6d9a5091030abc038486cbc00aa8154f5aea9edf643fcd70cea", + "fingerprint": "a9d2529352e5b052d039a0f42fb9a7448cc29206a714306de7cbd6ef3cb58e0d", "snapshot": { - "docs/reference/type-aliases/HotkeyRecorderValidationContext.md": "846e01d93875f9112e2230d7be528199931c25b80f7c89f77c20c80102390861" + "docs/reference/type-aliases/HotkeyRecorderValidationContext.md": "0ee6dec0fce0849cec2d215596df59f5d0fbd84fd30dbdb1315dae602b2dd70a" }, - "head": "cd1c66aab538ccac294e72ee36ae4466fa9b2d2b", - "outcome": "no-change", - "reason": "Regenerated reference page. The skills cover the formatForAria, createFormatter, and suspendCharacterKeys API changes.", - "evidence": ["packages/hotkeys/skills/hotkeys-core/SKILL.md"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:docs/reference/type-aliases/RecorderKeyMode.md": { - "fingerprint": "b7fed9779623c38e58e6e1e07fce6e6eeaacd76f692cbdadf82b68094bc9a7cc", + "fingerprint": "d1ba7157ae75789a89bdd4c28ab94be5a8fe3eb04b41fd0bce78759f9cd57069", "snapshot": { - "docs/reference/type-aliases/RecorderKeyMode.md": "8c1ad041753db7f8ad185d6bf057ad7b6acc01ba327c7ca2561dbb0f71a25ebf" + "docs/reference/type-aliases/RecorderKeyMode.md": "56eaaa142056915afca0dea0da59e4d2ce0a9034d114b0e66d7e37a7854e5c17" }, - "head": "cd1c66aab538ccac294e72ee36ae4466fa9b2d2b", - "outcome": "no-change", - "reason": "Regenerated reference page. The skills cover the formatForAria, createFormatter, and suspendCharacterKeys API changes.", - "evidence": ["packages/hotkeys/skills/hotkeys-core/SKILL.md"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:packages/alpine-hotkeys/tsconfig.docs.json": { "fingerprint": "2ae425b102b1ea8fdb67e00ada8c04eb02af8ce1b351a1efa37d6b54c1b580ac", @@ -6347,14 +6367,14 @@ "evidence": ["docs/framework/vue/guides/held-key-state-helpers.md"] }, "source:docs/reference/functions/formatForDisplay.md": { - "fingerprint": "c1ce5fac8aabf9b11e0324b21397327091e8bb955bb5b0909b0534a9772ead2f", + "fingerprint": "e96868a2bd99841b3c30ca8b62f63c23b65e07d735fecf9a9b6c962270394a8a", "snapshot": { - "docs/reference/functions/formatForDisplay.md": "118756518ac1f8c0d6226f14f2eab4073b50addfd5cd1a13937f7789c943ee30" + "docs/reference/functions/formatForDisplay.md": "6a47e8de0b4ab7bc2f59c4b4f3c5c0433ac71326f885bbeb3a9a1f7c7e8d1ac4" }, - "head": "cd1c66aab538ccac294e72ee36ae4466fa9b2d2b", - "outcome": "no-change", - "reason": "Regenerated reference page. The skills cover the formatForAria, createFormatter, and suspendCharacterKeys API changes.", - "evidence": ["packages/hotkeys/skills/hotkeys-core/SKILL.md"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:docs/reference/functions/formatKeyForDisplay.md": { "fingerprint": "22f378a7170ecee1ae241e883a41bd6dc41fde438827d1d40be8a4d140488a45", @@ -6369,34 +6389,34 @@ ] }, "source:docs/reference/interfaces/FormatDisplayOptions.md": { - "fingerprint": "77d78ae87ed8e8a182d498740aad223fc274c2bb96436be9357b11556503a9ee", + "fingerprint": "8329b828c0df9c634c13a8215534206a25216772b6a08a262977342c738a8271", "snapshot": { - "docs/reference/interfaces/FormatDisplayOptions.md": "f37927f9f0fcc1b6f85e5bd6f917ec27cc5a60936b18eed4f06529f62ac7f59a" + "docs/reference/interfaces/FormatDisplayOptions.md": "b16e01be3cfbe318faa793757b0d48366dbddc993be842b83f120551814dbc5d" }, - "head": "cd1c66aab538ccac294e72ee36ae4466fa9b2d2b", - "outcome": "no-change", - "reason": "Regenerated reference page. The skills cover the formatForAria, createFormatter, and suspendCharacterKeys API changes.", - "evidence": ["packages/hotkeys/skills/hotkeys-core/SKILL.md"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:docs/reference/type-aliases/DisplayHotkey.md": { - "fingerprint": "0cba586d38810fb777ed7a09ae6eff5a1fa5b7fc6834e2fa202c8566b7f4bfd6", + "fingerprint": "0ce1e8d67878dabf3873688a82992659d6bc04e22aae6fec560efade1f0706c5", "snapshot": { - "docs/reference/type-aliases/DisplayHotkey.md": "135eff76351c91175a482d469abc22b259f839e5dd42dee9e947c31365c0df47" + "docs/reference/type-aliases/DisplayHotkey.md": "c433fe1668dcc8e69d1dd1e5c7d7d43e50b9286febd93b5667d450cacef41352" }, - "head": "cd1c66aab538ccac294e72ee36ae4466fa9b2d2b", - "outcome": "no-change", - "reason": "Regenerated reference page. The skills cover the formatForAria, createFormatter, and suspendCharacterKeys API changes.", - "evidence": ["packages/hotkeys/skills/hotkeys-core/SKILL.md"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:docs/reference/type-aliases/DisplayHotkeyChord.md": { - "fingerprint": "f1e1a5612646d4bd22a02c4c9cb46cd11934fbe5c898ed4dea34d9bf742f2029", + "fingerprint": "f2b572d3c61701fc06cc3c8a0ed4621d876cdf249b295c09484e2e4d6ccb8265", "snapshot": { - "docs/reference/type-aliases/DisplayHotkeyChord.md": "be19dafe2a67024dbc9090cd7ce61237729849f5c5b34379701594c26c81336d" + "docs/reference/type-aliases/DisplayHotkeyChord.md": "d626d808cd6f75c1490758dc5dcea0aa26f9ed87b023be3a7e3acff4f022770c" }, - "head": "cd1c66aab538ccac294e72ee36ae4466fa9b2d2b", - "outcome": "no-change", - "reason": "Regenerated reference page. The skills cover the formatForAria, createFormatter, and suspendCharacterKeys API changes.", - "evidence": ["packages/hotkeys/skills/hotkeys-core/SKILL.md"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:examples/alpine/createHeldKeys/index.html": { "fingerprint": "4a65deb60dfbc956d3eb7e6b565966dc57429a110551577e775d06f7160ead3b", @@ -6632,24 +6652,26 @@ "evidence": ["packages/hotkeys/skills/hotkeys-core/SKILL.md"] }, "source:packages/hotkeys/src/format.ts": { - "fingerprint": "22853875a48ceb97c1afe49f8b6a3bd97bcaed4dd18db160c5143c46257bdc0d", + "fingerprint": "f610cea4a7419eb1ac4b5ce33072d5d3cd3f3917e6d1ce4c1fe114d660c5f07f", "snapshot": { - "packages/hotkeys/src/format.ts": "52e23fe7617bf7d36f5cc36461f400940ca428912c988e4bd6566aeb28a309b7" + "packages/hotkeys/src/format.ts": "2bffe27ba45b61412cb93587ba676007354ea49757cd8df113e1fe08857ef9fe" }, - "head": "cd1c66aab538ccac294e72ee36ae4466fa9b2d2b", + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", "outcome": "no-change", - "reason": "Source for formatForAria, createFormatter, or suspendCharacterKeys. The skill's updated rows cover the change.", - "evidence": ["packages/hotkeys/skills/hotkeys-core/SKILL.md"] + "reason": "formatForDisplay and formatForAria accept Mod on its own again; the skills never told agents to avoid it, so no guidance changes.", + "evidence": [ + "git grep \"formatForDisplay('Mod')\" packages/*/skills finds nothing" + ] }, "source:packages/hotkeys/tests/format.test.ts": { - "fingerprint": "8baf2eeb2a45aee3187a0e72cc1113af6c5aefb61102d419849ec71cdd4e3382", + "fingerprint": "018a35db721d3f9670153868a131d04fa74e9cf39b0af8eb6c93cb4e0431b616", "snapshot": { - "packages/hotkeys/tests/format.test.ts": "07fd982ebc8731e6ae81b4b4a259c5f942ae00ed75704af3c683a6b571c10d18" + "packages/hotkeys/tests/format.test.ts": "8a2f2dfd09b804b8ce36a73f700d7becd07db75a6127da5aea29a7c6e54c7463" }, - "head": "00bc7643c72d5de35b8f214f9be9cb20e5de421a", - "outcome": "no-change", - "reason": "Crash and silent-failure fixes covered by tests; no skill guidance changes.", - "evidence": ["Core, adapter and e2e suites pass"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:packages/hotkeys/tests/key-coverage.test.ts": { "fingerprint": "d7d20f11eab2618f750ce752f7a1cdce5e9d655d0802111d5563abf8566f1079", @@ -6672,14 +6694,14 @@ "evidence": ["packages/hotkeys/tests/parse.test.ts"] }, "source:packages/hotkeys/tests/typed-behavior.test.ts": { - "fingerprint": "a8690820286afbdb79fc7467068c1ff0c28e0e64b08cd087d60d86cd67050a16", + "fingerprint": "57213f4b24f2c77e252520ceed786890eccb3fa60ac04869f371defc39703a8a", "snapshot": { - "packages/hotkeys/tests/typed-behavior.test.ts": "375db70c5058811a59a403f213547237a4467a3add4a617313f5d7d936668a32" + "packages/hotkeys/tests/typed-behavior.test.ts": "52d64e68db21e9684e82aa00fbf27c4aa039fd5f4fa58db72533ee0b61606ced" }, - "head": "c94ffd5ba8b28f537cfd2f128bb9a27bc537c22b", - "outcome": "no-change", - "reason": "Source, test, or doc change covered by the skill reviews above; no packaged guidance depends on it.", - "evidence": ["packages/hotkeys/tests/typed-behavior.test.ts"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:packages/hotkeys/tests/unified-hotkeys.test.ts": { "fingerprint": "5376b7825f3808e4a1c5dffa2e97f5ca8ab40da61d416fbc198f4f4253e2f93f", @@ -6694,16 +6716,14 @@ ] }, "source:packages/hotkeys/tests/untrusted-input.test.ts": { - "fingerprint": "d9adedcfb52eae0619583e920d9c3addbb41e41d424d8587ffbe0fedb32741a9", + "fingerprint": "b9bca5e5db45786b80398f1621baa5e0d30eefa388f7837e51f01190f4241447", "snapshot": { - "packages/hotkeys/tests/untrusted-input.test.ts": "f52330bc8c9bc7813c97e1c6353081a98cd4e9ba3287383adf67b64dddc8ad46" + "packages/hotkeys/tests/untrusted-input.test.ts": "2cd641379ceb117ffc34fb21ad0649d772922991115f7cc87d5d61246520a7ad" }, - "head": "54a14ddc4520bff0edd7a3c55b4c0db068d1bf1b", - "outcome": "no-change", - "reason": "Adapter validation, defaults, and kind-specific options moved into HotkeyManager.register, which now warns about each invalid hotkey once per manager. String hotkeys register as written from every entry point, and chord objects register in normalized form, including in createHotkeyChordHandler's context. No skill or planning artifact describes registration spelling, adapter validation, invalid-hotkey warnings, or the handler's reported hotkey: a search of packages/*/skills and _artifacts for normaliz, as written, registration.hotkey, context.hotkey, createHotkeyChordHandler, and Meta+S finds nothing, and the only Invalid hotkey match, in _artifacts/skill_spec.md, is a decision about TypeScript rejecting invalid hotkey strings, which this change leaves true.", - "evidence": [ - "Changed: packages/hotkeys/tests/untrusted-input.test.ts at 54a14ddc4520bff0edd7a3c55b4c0db068d1bf1b" - ] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:packages/hotkeys/tests/validate.test.ts": { "fingerprint": "8f1e62baf8f8b9392d90871f7e6b8fe407535d451f7dd9cbe648fe8ea4cb69e4", @@ -7225,17 +7245,14 @@ ] }, "source:packages/hotkeys/tests/app-hotkeys.test.ts": { - "fingerprint": "e6af6607e15154f930f87398ab4f8b6376304886c64c7d660ba8941e4604fa4a", + "fingerprint": "803df4d5f1a699a03f4be9cc9c71e53eaa4c176696b208ff317f0b677ee10b67", "snapshot": { - "packages/hotkeys/tests/app-hotkeys.test.ts": "73d47bec544b7f01af2eca56abd37b6d2dbe47080870fcb7802080ce486ead8d" + "packages/hotkeys/tests/app-hotkeys.test.ts": "93e65121939f4c4fb26fab4d2588247e9f686a55fc1758ffef5187f08c3c3745" }, - "head": "33e0b46f70957660418f1c76e9180c5badccd1fc", - "outcome": "no-change", - "reason": "Tests for editor latency, conditional and nullable hotkeys, and the generic id lookup; no skill covers test files.", - "evidence": [ - "packages/hotkeys/tests/app-hotkeys.test.ts", - "packages/hotkeys: tsc and vitest (62 files, 2190 tests) pass; Supabase Studio typecheck and 1196 tests pass with the build; intent validate passed. Not run: fresh-consumer sessions." - ] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:packages/hotkeys/tests/unset-values.test.ts": { "fingerprint": "f928c9450c2f2f916cf639f3cc0a81e3a49effda3b8e90c51002bda9422539ca", @@ -7409,14 +7426,17 @@ "evidence": ["packages/hotkeys/tests/key-state-tracker.test.ts"] }, "source:docs/framework/alpine/guides/custom-hotkey-recording.md": { - "fingerprint": "90c604865b81c116078f5306dd47da3d3520f80812b473e446e9bb32af28c4a0", + "fingerprint": "f2df10d99313a86c7c4259b0bbafdb7604e920f8b2f650736ea5fc0b61678916", "snapshot": { - "docs/framework/alpine/guides/custom-hotkey-recording.md": "1405866a1a553bfe5775a040d031aa06ff6d06114ab836d9ae7700a7b26e03f9" + "docs/framework/alpine/guides/custom-hotkey-recording.md": "81ba52f5359d725dcc3931188b9645598ff04b74cbeb80ad0e5cd7f704014b1e" }, - "head": "413fd896ea3d262a23a8fe50dc3a14b02348cafe", - "outcome": "no-change", - "reason": "Doc wording for the same recorder behavior; covered by the app-hotkeys skill update.", - "evidence": ["docs/framework/alpine/guides/custom-hotkey-recording.md"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "updated", + "reason": "Hotkey string types now reject Shift with a symbol, and the recorder never records one. The guides were updated to match; hotkeys-core SKILL.md and app-hotkeys references/recording.md carry the same rules.", + "evidence": [ + "packages/hotkeys/skills/hotkeys-core/SKILL.md", + "packages/hotkeys/skills/app-hotkeys/references/recording.md" + ] }, "source:docs/framework/alpine/guides/sequences.md": { "fingerprint": "bd52ad132e2053a8ff821daf06fa40dbe0f8468aaec9472cfef0a0ce5805bd62", @@ -7601,14 +7621,17 @@ ] }, "source:docs/framework/ember/guides/custom-hotkey-recording.md": { - "fingerprint": "032935af0c7bff030a89ae763030549b949c7d61f1ad95e3c738579d066271ba", + "fingerprint": "911779cd9f17d6d4ddc7642d57d80ef7223942284783bddbfb9e2e1f046e371c", "snapshot": { - "docs/framework/ember/guides/custom-hotkey-recording.md": "576342d3667a2edaa0af9396e664bb39f75062fa47a1a2020d11d3aef11b1003" + "docs/framework/ember/guides/custom-hotkey-recording.md": "dd2ec02a01799ff07d7fb0cee093115edad32b81299780cdfc900bfecab0cfe0" }, - "head": "413fd896ea3d262a23a8fe50dc3a14b02348cafe", - "outcome": "no-change", - "reason": "Doc wording for the same recorder behavior; covered by the app-hotkeys skill update.", - "evidence": ["docs/framework/ember/guides/custom-hotkey-recording.md"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "updated", + "reason": "Hotkey string types now reject Shift with a symbol, and the recorder never records one. The guides were updated to match; hotkeys-core SKILL.md and app-hotkeys references/recording.md carry the same rules.", + "evidence": [ + "packages/hotkeys/skills/hotkeys-core/SKILL.md", + "packages/hotkeys/skills/app-hotkeys/references/recording.md" + ] }, "source:docs/framework/ember/reference/functions/useHotkeyRecorder.md": { "fingerprint": "4c01d74c0ffbb8c81803d1501956d23831ad4973c11675c7bea85328e09a11d3", @@ -7635,14 +7658,17 @@ ] }, "source:docs/framework/lit/guides/custom-hotkey-recording.md": { - "fingerprint": "13d14ed9ed33a97bc8c55b597097f3676747b309c888b7ecc7f85cb71ee4e249", + "fingerprint": "9e6a7cf203e075f961c611fd089a211b9d32d642fc4f123eee4cf8e5b0a5e131", "snapshot": { - "docs/framework/lit/guides/custom-hotkey-recording.md": "2b924599eabcb9e7fd0c498b528d10fa2027ad68a7d82bed8cffdac555b1a3a8" + "docs/framework/lit/guides/custom-hotkey-recording.md": "65ebd4301849bc169e7c77e838cf47a2c1652a85f9dcf2bdd6c76cfe450af6de" }, - "head": "413fd896ea3d262a23a8fe50dc3a14b02348cafe", - "outcome": "no-change", - "reason": "Doc wording for the same recorder behavior; covered by the app-hotkeys skill update.", - "evidence": ["docs/framework/lit/guides/custom-hotkey-recording.md"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "updated", + "reason": "Hotkey string types now reject Shift with a symbol, and the recorder never records one. The guides were updated to match; hotkeys-core SKILL.md and app-hotkeys references/recording.md carry the same rules.", + "evidence": [ + "packages/hotkeys/skills/hotkeys-core/SKILL.md", + "packages/hotkeys/skills/app-hotkeys/references/recording.md" + ] }, "source:docs/framework/lit/reference/functions/hotkey.md": { "fingerprint": "bc2085b4fe87bd750b8ec98dc1d35361a784ba12a40c3352dfaea3f27519af10", @@ -11773,24 +11799,26 @@ ] }, "source:docs/reference/type-aliases/PhysicalKeyCode.md": { - "fingerprint": "e233fcfcade1fadec85d422ef37597d115f7c48d58fbafbd32e4c097a1aa914a", + "fingerprint": "54b24e95e0bd8e270778ad686cba9b856c04dea6c983cd37ba625cc4defe2767", "snapshot": { - "docs/reference/type-aliases/PhysicalKeyCode.md": "1e045a8143d7c96c2b4516b90a4ef4e34fa534a09e5e7633034fd5cd37012687" + "docs/reference/type-aliases/PhysicalKeyCode.md": "53265429f435530379e619ea3084eaa4651a3bbc9cee88625dfdebf44b21e4dd" }, - "head": "a7c7ddcf89fac99790eb60372fc440fcc34f1b07", + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", "outcome": "out-of-scope", - "reason": "Generated reference docs, examples, tests, sidebar config, lockfile, or package/tsconfig wiring for the layout key types; no skill guidance depends on them.", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", "evidence": ["No skill references this file"] }, "source:packages/hotkeys/src/key.types.ts": { - "fingerprint": "ad6f1ff7cab316e9c7388736746326f295b66a04e6a57b21970dd184c8ad5829", + "fingerprint": "7ba237b4f20786701c228d3ee9c42f6e484e8ec56524f0cbdff8d606dcfb1c6e", "snapshot": { - "packages/hotkeys/src/key.types.ts": "e531cd9f41fbd1704047f35041459ab5cb14a9ea3ad345cf03993fd0f53f9206" + "packages/hotkeys/src/key.types.ts": "34fcea24e41d12c5bb0a8bc8e6cab691747455ee9b0e8b6c4c5c4669803f6776" }, - "head": "cd1c66aab538ccac294e72ee36ae4466fa9b2d2b", + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", "outcome": "no-change", - "reason": "Source for formatForAria, createFormatter, or suspendCharacterKeys. The skill's updated rows cover the change.", - "evidence": ["packages/hotkeys/skills/hotkeys-core/SKILL.md"] + "reason": "Comment-only edits: the HotkeyScopesState.characterKeysSuspended JSDoc example changes from Shift+/ to ?, and the UncasedLetterKey comment says how the test copy of the list is kept in sync. No API or behavior change.", + "evidence": [ + "packages/hotkeys/src/hotkey-manager.ts characterKeysSuspended JSDoc; packages/hotkeys/src/key.types.ts UncasedLetterKey JSDoc; docs/reference/interfaces/HotkeyScopesState.md is regenerated from that JSDoc. The skill already uses ? in its examples." + ] }, "source:packages/hotkeys/src/parse.ts": { "fingerprint": "25686bc50f40d98b252588f79cc5000a533211ee68a14fbb7db144bca3a5b8b6", @@ -11815,14 +11843,17 @@ "evidence": ["packages/hotkeys/tests/physical-key.test.ts"] }, "source:docs/framework/angular/guides/custom-hotkey-recording.md": { - "fingerprint": "22b81b250f1e8262b12561a9fda56c9dd7a3fcd3d69ab476eeca20ddd07d62b8", + "fingerprint": "95f3ea1538f1d0037c930c3336658fea3b215a3a77e8d51c0f88984c2dc000d3", "snapshot": { - "docs/framework/angular/guides/custom-hotkey-recording.md": "34c90748bd7d850c783cb0b1516146ec3e562676e26a1c36b439b23e327be048" + "docs/framework/angular/guides/custom-hotkey-recording.md": "5f2d20c9e26c2a94fab3b718e0d3ed4653885fb9f65df034b73472e1a14a5952" }, - "head": "413fd896ea3d262a23a8fe50dc3a14b02348cafe", - "outcome": "no-change", - "reason": "Doc wording for the same recorder behavior; covered by the app-hotkeys skill update.", - "evidence": ["docs/framework/angular/guides/custom-hotkey-recording.md"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "updated", + "reason": "Hotkey string types now reject Shift with a symbol, and the recorder never records one. The guides were updated to match; hotkeys-core SKILL.md and app-hotkeys references/recording.md carry the same rules.", + "evidence": [ + "packages/hotkeys/skills/hotkeys-core/SKILL.md", + "packages/hotkeys/skills/app-hotkeys/references/recording.md" + ] }, "source:docs/framework/ember/reference/functions/useAppHotkeyList.md": { "fingerprint": "5f75049947abd0007e83d78ffc33f4dcbf4b6b8a374f8243e24946d4e3d1d98d", @@ -11859,14 +11890,17 @@ ] }, "source:docs/framework/octane/guides/custom-hotkey-recording.md": { - "fingerprint": "8491e81e9a78c5b2b786d8c17a30f95a069068cc06ec4ce0fc93655aab5c558d", + "fingerprint": "8a6b770789500c87bc638c2a1dee3a51242ecad8e38d6b7376df37cf24a2316b", "snapshot": { - "docs/framework/octane/guides/custom-hotkey-recording.md": "2107523e997bf059c3d9d0be935bb886bf83789965b9daa2b5ad0299c354c223" + "docs/framework/octane/guides/custom-hotkey-recording.md": "28d3f3fed682e021f927b42e1d8ae660fa91c5a3e18e4ff2beb3f2b904847cea" }, - "head": "413fd896ea3d262a23a8fe50dc3a14b02348cafe", - "outcome": "no-change", - "reason": "Doc wording for the same recorder behavior; covered by the app-hotkeys skill update.", - "evidence": ["docs/framework/octane/guides/custom-hotkey-recording.md"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "updated", + "reason": "Hotkey string types now reject Shift with a symbol, and the recorder never records one. The guides were updated to match; hotkeys-core SKILL.md and app-hotkeys references/recording.md carry the same rules.", + "evidence": [ + "packages/hotkeys/skills/hotkeys-core/SKILL.md", + "packages/hotkeys/skills/app-hotkeys/references/recording.md" + ] }, "source:docs/framework/octane/reference/functions/useAppHotkeyList.md": { "fingerprint": "ff7e221e6129f28058dff7f07a65181459e9c3d92f896c46fe95a1f60911008a", @@ -11905,34 +11939,43 @@ ] }, "source:docs/framework/preact/guides/custom-hotkey-recording.md": { - "fingerprint": "c930f56e06f9380072b657099b6620b470dfd49ffec6e38d116839dfd2721212", + "fingerprint": "c7a56ed5ef8ae5ae309383bc333b8d25b952eb323ea824c3bcfec246a88b8d4e", "snapshot": { - "docs/framework/preact/guides/custom-hotkey-recording.md": "4e02e0f2ec893287def11c08bca972dfe99b3e5797b0d87cf368b6a9d0866af5" + "docs/framework/preact/guides/custom-hotkey-recording.md": "4fa969071476c5fcec016103beb69f3b46933bfe27d86e81af7bc4a9e3d7efad" }, - "head": "413fd896ea3d262a23a8fe50dc3a14b02348cafe", - "outcome": "no-change", - "reason": "Doc wording for the same recorder behavior; covered by the app-hotkeys skill update.", - "evidence": ["docs/framework/preact/guides/custom-hotkey-recording.md"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "updated", + "reason": "Hotkey string types now reject Shift with a symbol, and the recorder never records one. The guides were updated to match; hotkeys-core SKILL.md and app-hotkeys references/recording.md carry the same rules.", + "evidence": [ + "packages/hotkeys/skills/hotkeys-core/SKILL.md", + "packages/hotkeys/skills/app-hotkeys/references/recording.md" + ] }, "source:docs/framework/solid/guides/custom-hotkey-recording.md": { - "fingerprint": "188b41bac0f13ee8c586f4db8b62312dfb762e8a2c36e7d9ac1b2f39b5e637dd", + "fingerprint": "60842b34dea6a63bf6ac454598a25087c126eccd5b06688714606993b0e86b51", "snapshot": { - "docs/framework/solid/guides/custom-hotkey-recording.md": "90e73601b00eda8522a8bb41d358f72a2e2a5a941cc894319052b5e944199cc4" + "docs/framework/solid/guides/custom-hotkey-recording.md": "1fda460b4bcd5e5b84f7213a07df166d9706862aefa6fc176bfb1f899fab8071" }, - "head": "413fd896ea3d262a23a8fe50dc3a14b02348cafe", - "outcome": "no-change", - "reason": "Doc wording for the same recorder behavior; covered by the app-hotkeys skill update.", - "evidence": ["docs/framework/solid/guides/custom-hotkey-recording.md"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "updated", + "reason": "Hotkey string types now reject Shift with a symbol, and the recorder never records one. The guides were updated to match; hotkeys-core SKILL.md and app-hotkeys references/recording.md carry the same rules.", + "evidence": [ + "packages/hotkeys/skills/hotkeys-core/SKILL.md", + "packages/hotkeys/skills/app-hotkeys/references/recording.md" + ] }, "source:docs/framework/svelte/guides/custom-hotkey-recording.md": { - "fingerprint": "0ec10ca20855a463c1ce25c1c1f881fc556dc10a3ac99c18f0e7176a12e96c98", + "fingerprint": "dd6edf4846d68d89bb366f75426378d700d7d6cd809667eb2c60ec4f94c4ad86", "snapshot": { - "docs/framework/svelte/guides/custom-hotkey-recording.md": "85dd670281f7bc4b009961bb8b583c6290d1f34dd8a99c95efd8e70a88ae5444" + "docs/framework/svelte/guides/custom-hotkey-recording.md": "abd52e9056966094923f2d2c1747fcfee1ff378208939cbc101b86237a363955" }, - "head": "413fd896ea3d262a23a8fe50dc3a14b02348cafe", - "outcome": "no-change", - "reason": "Doc wording for the same recorder behavior; covered by the app-hotkeys skill update.", - "evidence": ["docs/framework/svelte/guides/custom-hotkey-recording.md"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "updated", + "reason": "Hotkey string types now reject Shift with a symbol, and the recorder never records one. The guides were updated to match; hotkeys-core SKILL.md and app-hotkeys references/recording.md carry the same rules.", + "evidence": [ + "packages/hotkeys/skills/hotkeys-core/SKILL.md", + "packages/hotkeys/skills/app-hotkeys/references/recording.md" + ] }, "source:docs/framework/svelte/reference/functions/getAppHotkeyList.md": { "fingerprint": "8fe5e73db20916113f27570e3ddd2015cf4df4fd61e9285f8b2baeb5ad09831c", @@ -12005,14 +12048,17 @@ ] }, "source:docs/framework/vue/guides/custom-hotkey-recording.md": { - "fingerprint": "b88285226b5a05d371fb773924a37b9523622016b957aaf7b6d6af3722a525f6", + "fingerprint": "2636d237d1e2b472d92e60fdc93da48b7e1fdac0a212c7eea3d8c65812dbfb0f", "snapshot": { - "docs/framework/vue/guides/custom-hotkey-recording.md": "2f36b230bc85f418842b654178b29457636200bcde8d807387d70e591cfe6a14" + "docs/framework/vue/guides/custom-hotkey-recording.md": "ad48eae20eafa23b7b8afa3162ace1fee875f2450edb6ee6b2f632acf13bbdcb" }, - "head": "413fd896ea3d262a23a8fe50dc3a14b02348cafe", - "outcome": "no-change", - "reason": "Doc wording for the same recorder behavior; covered by the app-hotkeys skill update.", - "evidence": ["docs/framework/vue/guides/custom-hotkey-recording.md"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "updated", + "reason": "Hotkey string types now reject Shift with a symbol, and the recorder never records one. The guides were updated to match; hotkeys-core SKILL.md and app-hotkeys references/recording.md carry the same rules.", + "evidence": [ + "packages/hotkeys/skills/hotkeys-core/SKILL.md", + "packages/hotkeys/skills/app-hotkeys/references/recording.md" + ] }, "source:docs/framework/vue/reference/functions/useAppHotkeyList.md": { "fingerprint": "0df2af88647ddeaac6454bc7f5d408739b4214832ed3b4e59581d64475d1073d", @@ -12083,14 +12129,14 @@ "evidence": ["docs/reference/type-aliases/HotkeyIssueReason.md"] }, "source:docs/reference/type-aliases/RecorderRejectionReason.md": { - "fingerprint": "59a0c79f4fa32f67be117b4f68ebc10d8d3312989f11d8fea7edc7fae1d06a12", + "fingerprint": "a9ebd1c01e48962663c94e5ead0ebc6c18b9999200b5958dbd660cad35d31be5", "snapshot": { - "docs/reference/type-aliases/RecorderRejectionReason.md": "d778e0aa505ad6c037127f7a63ceaffdd8a4e4ca531ae4edb069caf20100d398" + "docs/reference/type-aliases/RecorderRejectionReason.md": "756b342dd3b019a4588fc3e97f74ab7e5f21aab5b8b27bd497fa5219f594d8c3" }, - "head": "cd1c66aab538ccac294e72ee36ae4466fa9b2d2b", - "outcome": "no-change", - "reason": "Regenerated reference page. The skills cover the formatForAria, createFormatter, and suspendCharacterKeys API changes.", - "evidence": ["packages/hotkeys/skills/hotkeys-core/SKILL.md"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:examples/ember/useHotkeys/app/templates/application.gts": { "fingerprint": "16779627970d0c79bb13ec3a1895540a6ca8d2f5624e1521f9e523b8447fa5ad", @@ -12192,14 +12238,16 @@ "evidence": ["packages/solid-hotkeys/skills/solid-hotkeys/SKILL.md"] }, "source:packages/hotkeys/src/_recorder-chord.ts": { - "fingerprint": "f417ba679826ef475a7d66c586c75c39585b812bf2e51fe59f026183f827c42b", + "fingerprint": "34b4129313ee3e2c172a9c2d6af37f19a19aa7ed55b7c86d8b2956cb7732dc19", "snapshot": { - "packages/hotkeys/src/_recorder-chord.ts": "7d009e493ea0f2a83a5d608c809fdc2585528073063c6ac066222332da2eccf8" + "packages/hotkeys/src/_recorder-chord.ts": "33c1ad2b2b07ae87ba365a64b9417a67cc47a19094d2fe8d1bea68c72d44eff4" }, - "head": "cd1c66aab538ccac294e72ee36ae4466fa9b2d2b", - "outcome": "no-change", - "reason": "Internal change: the private constants move or the character-key classification behind suspendCharacterKeys. The core skill covers the public behavior.", - "evidence": ["packages/hotkeys/skills/hotkeys-core/SKILL.md"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "updated", + "reason": "Hotkey string types now reject Shift with a symbol, and the recorder never records one. app-hotkeys references/recording.md describes the new recordings.", + "evidence": [ + "packages/hotkeys/skills/app-hotkeys/references/recording.md" + ] }, "source:packages/hotkeys/tests/recording-and-display.test.ts": { "fingerprint": "38b5b292f0b5970d80856bdac43e365f06b9a371b85094ee392a944d61b72d22", @@ -13094,16 +13142,14 @@ ] }, "source:docs/reference/interfaces/HotkeyChordCallbackContext.md": { - "fingerprint": "05f7aff468048319e30dd05c2762999a995f427ff6a526fcad700f94a6044f26", + "fingerprint": "e420885d48f739923904bc8750916f075975f001a1338ee88845912bf8492eaf", "snapshot": { - "docs/reference/interfaces/HotkeyChordCallbackContext.md": "68258531905c5af3023d4faf856c18209d36063c5c87ceed444ac5c98cc81843" + "docs/reference/interfaces/HotkeyChordCallbackContext.md": "41770b957ca77587e9a5f99b7774db4edfc433dfc167ead90592543ca3bb8b83" }, - "head": "1f0a2c627c4a18f005762600966a81e9b8daef3a", - "outcome": "no-change", - "reason": "Refactor to shared types and helpers, generated reference docs, and an example type fix; no guidance changes.", - "evidence": [ - "Behavior and public names are unchanged; reference docs are regenerated by pnpm generate-docs." - ] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:docs/reference/interfaces/HotkeyConflict.md": { "fingerprint": "becbb1bd155ae0761631e9f933e5510470824ba749646a9ca0d83bb424971fa4", @@ -13118,63 +13164,54 @@ ] }, "source:docs/reference/interfaces/HotkeyMeta.md": { - "fingerprint": "45a3eed15c7d949addb9052dc1d45b0528715b9dd6c4363a96820e38e46a5d30", + "fingerprint": "6d6bc76b446bdbbef4a805957650978f6b8700cb448757c515bed51dc67eecaf", "snapshot": { - "docs/reference/interfaces/HotkeyMeta.md": "9afe9cf2d7026128dbe87ca590ea21c9b3125958eb864817d74257f6c4cbeb6f" + "docs/reference/interfaces/HotkeyMeta.md": "589dbbf7fdffca859d725d9c421e8ba04fa954d1273ec16032795d8f28d09783" }, - "head": "7cf53a0cf4759de322e2bdf45b5b834960d68778", - "outcome": "no-change", - "reason": "Generated by pnpm generate-docs from the changed JSDoc and types; the guidance it reflects is reviewed under the app-hotkeys and hotkeys-core skills.", - "evidence": [ - "docs/reference/interfaces/HotkeyMeta.md", - "pnpm -C packages/hotkeys exec vitest run (2182 passed, including tests/trigger.test.ts); nx test:lib/test:types/test:eslint/test:build for 20 projects passed; intent validate packages/hotkeys/skills passed. Not run: fresh-consumer sessions." - ] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:docs/reference/interfaces/HotkeySequenceCallbackContext.md": { - "fingerprint": "13c08cc2c649b8913bbbe2e967bb56d29a7c668b62524c1b70df0651ea6dd51a", + "fingerprint": "828ca7e73ceab8cabd389527df4e546cd2e55550f9ab65ec116878535bd45458", "snapshot": { - "docs/reference/interfaces/HotkeySequenceCallbackContext.md": "c0238857d81c7fc6e367e2c94a9d0af51cca534a9f0ff48b6e6c3dd448c1ebe8" + "docs/reference/interfaces/HotkeySequenceCallbackContext.md": "af52793e1c5569d1c0eadbb32814a02a3782634ebe5ae35102ef4e42a6afb72d" }, - "head": "1f0a2c627c4a18f005762600966a81e9b8daef3a", - "outcome": "no-change", - "reason": "Refactor to shared types and helpers, generated reference docs, and an example type fix; no guidance changes.", - "evidence": [ - "Behavior and public names are unchanged; reference docs are regenerated by pnpm generate-docs." - ] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:docs/reference/interfaces/NormalizedKeyboardEvent.md": { - "fingerprint": "e2125779f6b79bde2da0d0d5507ac48147ef4bddc46a54588dca5b8b1a9262b0", + "fingerprint": "97d862806fcd8ae4d02351249a0cc7e744a74ab6b02b8b3ac0aa4ecdab280e59", "snapshot": { - "docs/reference/interfaces/NormalizedKeyboardEvent.md": "a3512dabce2ff56002106d86290dd0b66d51292ff4cb1bddc92f566bfb984aae" + "docs/reference/interfaces/NormalizedKeyboardEvent.md": "54a476cac5b9db161de01c10d29eeddd044273fe35b3b6c9e9963a63e0b6a972" }, - "head": "a7c7ddcf89fac99790eb60372fc440fcc34f1b07", + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", "outcome": "out-of-scope", - "reason": "Generated reference docs, examples, tests, sidebar config, lockfile, or package/tsconfig wiring for the layout key types; no skill guidance depends on them.", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", "evidence": ["No skill references this file"] }, "source:docs/reference/interfaces/ParsedModifiers.md": { - "fingerprint": "0de62d05b29c5c31a1000cc83b51b9db9ae21c0587f6e1ebda3f95c61aab0471", + "fingerprint": "b0a6f74416b3bb3c7952cf8f9424d992f1bb17f091527cb8ef22dc2d35f37a3f", "snapshot": { - "docs/reference/interfaces/ParsedModifiers.md": "e1f16c04ae79f6b7f016d6d0dd8318caf043f43e49ae31bc32d32faf44f2a2c0" + "docs/reference/interfaces/ParsedModifiers.md": "8d39a9d5361c3029a8025705f2eb577a1900a9b67911ce723077c2fc652da147" }, - "head": "1f0a2c627c4a18f005762600966a81e9b8daef3a", - "outcome": "no-change", - "reason": "Refactor to shared types and helpers, generated reference docs, and an example type fix; no guidance changes.", - "evidence": [ - "Behavior and public names are unchanged; reference docs are regenerated by pnpm generate-docs." - ] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:docs/reference/interfaces/RawModifiers.md": { - "fingerprint": "6629dcc385e2bf8dc1d1229737854a929c8c6144c47a1798a48435187c4f3ce4", + "fingerprint": "602d8cae7a9893e5f86204fa5d931cc4733db96b2ab2468c308b568d48f0992b", "snapshot": { - "docs/reference/interfaces/RawModifiers.md": "b50ad696193ea4493e10e3c8b96e38c643be592ffcae6bcae6a8853412ad92ae" + "docs/reference/interfaces/RawModifiers.md": "c87cb3fbef69979fac3598f15918e67465f0c52d4acd897f8d887fa2ac9280f5" }, - "head": "1f0a2c627c4a18f005762600966a81e9b8daef3a", - "outcome": "no-change", - "reason": "Refactor to shared types and helpers, generated reference docs, and an example type fix; no guidance changes.", - "evidence": [ - "Behavior and public names are unchanged; reference docs are regenerated by pnpm generate-docs." - ] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:docs/reference/type-aliases/CanonicalModifier.md": { "fingerprint": "bba4572e1f9798676b922901e004146d5fd89194676d2a60583017a730949a43", @@ -13187,17 +13224,14 @@ "evidence": ["No skill references this file"] }, "source:docs/reference/type-aliases/ConflictBehavior.md": { - "fingerprint": "a97eb4f43b710b752d1ba31730f0c1b14077723ea1004bfb491fcc26af0fe86d", + "fingerprint": "d9b0213f0132c664be41c3fbe42688b3efecb106a3ae7f7bcc8216c2400876aa", "snapshot": { - "docs/reference/type-aliases/ConflictBehavior.md": "08dd718292b994bc9e9db2fbbf6cccae07acd7a3df597e528f3b179f7102baca" + "docs/reference/type-aliases/ConflictBehavior.md": "1d1ea2b7688741b1b3a7bc9fc6c05c72b979444932bd3e7f4995577fdd79e642" }, - "head": "7cf53a0cf4759de322e2bdf45b5b834960d68778", - "outcome": "no-change", - "reason": "Generated by pnpm generate-docs from the changed JSDoc and types; the guidance it reflects is reviewed under the app-hotkeys and hotkeys-core skills.", - "evidence": [ - "docs/reference/type-aliases/ConflictBehavior.md", - "pnpm -C packages/hotkeys exec vitest run (2182 passed, including tests/trigger.test.ts); nx test:lib/test:types/test:eslint/test:build for 20 projects passed; intent validate packages/hotkeys/skills passed. Not run: fresh-consumer sessions." - ] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:docs/reference/type-aliases/EditingKey.md": { "fingerprint": "344778a50d81b54ddbc8f15201b0bb3cfc39fd818ba465eed3333a815f69c046", @@ -13210,16 +13244,14 @@ "evidence": ["No skill references this file"] }, "source:docs/reference/type-aliases/FourModifierHotkeyChord.md": { - "fingerprint": "7615bf825ce5c8c10618b9777610290bb8ceaa8aedbb931016a2fe708e442b38", + "fingerprint": "2a79c4dde1ee444dc1165dff7d3e594836290ddfbad5922f7560970d247ea56c", "snapshot": { - "docs/reference/type-aliases/FourModifierHotkeyChord.md": "9b9de6d4529571d66b14ac9c56bfbf26a9cb6a4e05a01c91fa2e61c537609c7a" + "docs/reference/type-aliases/FourModifierHotkeyChord.md": "74681667e9d048e633adf96a4abeac7c843533e726df10a66dd5130f125f679d" }, - "head": "1f0a2c627c4a18f005762600966a81e9b8daef3a", - "outcome": "no-change", - "reason": "Refactor to shared types and helpers, generated reference docs, and an example type fix; no guidance changes.", - "evidence": [ - "Behavior and public names are unchanged; reference docs are regenerated by pnpm generate-docs." - ] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:docs/reference/type-aliases/FunctionKey.md": { "fingerprint": "593b649ec4a657b8242bbf471d6fcea4da65b43c919bde3f277a66e31ef581fd", @@ -13232,95 +13264,83 @@ "evidence": ["No skill references this file"] }, "source:docs/reference/type-aliases/Hotkey.md": { - "fingerprint": "7b3975984890c0f7dd0c3bf896b5f6679aafb11b34a3b2755719c007442191bd", + "fingerprint": "7b0b153abbe6b5da4ada3d7f6e8afb743a75b53d4284bec8902ff30e27d6523b", "snapshot": { - "docs/reference/type-aliases/Hotkey.md": "faaac7984cbf2d294d9242da08ce9a673fb6d29a28df6b3e372eac48465b33f0" + "docs/reference/type-aliases/Hotkey.md": "cc8beaef0a1ee83ddba2dea6db529f0038d2d586d18f87d68d3e693b95fbe096" }, - "head": "1f0a2c627c4a18f005762600966a81e9b8daef3a", - "outcome": "no-change", - "reason": "Refactor to shared types and helpers, generated reference docs, and an example type fix; no guidance changes.", - "evidence": [ - "Behavior and public names are unchanged; reference docs are regenerated by pnpm generate-docs." - ] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:docs/reference/type-aliases/HotkeyCallback.md": { - "fingerprint": "aaaf716aa927c930df00c482448837aa2859ce45231c82037525db8108ce99c8", + "fingerprint": "cc480be2cfc7178329178fc674a13ada3bb9f5fe44c3e26a8183bfdc6c419c67", "snapshot": { - "docs/reference/type-aliases/HotkeyCallback.md": "997374e1413690e3300ae95981ba35124165f2cee3dbdfab0ea87a9ae5380694" + "docs/reference/type-aliases/HotkeyCallback.md": "ee30d15d89a74fa848399947fbce3b76b02030384559f5a161018e0bf1a29084" }, - "head": "1f0a2c627c4a18f005762600966a81e9b8daef3a", - "outcome": "no-change", - "reason": "Refactor to shared types and helpers, generated reference docs, and an example type fix; no guidance changes.", - "evidence": [ - "Behavior and public names are unchanged; reference docs are regenerated by pnpm generate-docs." - ] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:docs/reference/type-aliases/HotkeyCallbackContext.md": { - "fingerprint": "48e443b8fde299cae26f440dfa7ee38fec37e7d941d68827087da41a65b4ccbe", + "fingerprint": "0e9d60ca8a326b960829d4e79d72b42b0a2b6d25929f80caa6e9ecf69178f07a", "snapshot": { - "docs/reference/type-aliases/HotkeyCallbackContext.md": "07ee52c745b2b3a7cede45222e5e82fb38e79694de1771eb9635ee836059a693" + "docs/reference/type-aliases/HotkeyCallbackContext.md": "e4b2849c83f11d1a2650db7693513b48944597e7d0da26e96f8ec12bcc80d547" }, - "head": "1f0a2c627c4a18f005762600966a81e9b8daef3a", - "outcome": "no-change", - "reason": "Refactor to shared types and helpers, generated reference docs, and an example type fix; no guidance changes.", - "evidence": [ - "Behavior and public names are unchanged; reference docs are regenerated by pnpm generate-docs." - ] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:docs/reference/type-aliases/HotkeyCallbackContextFor.md": { - "fingerprint": "a9d4025d7b61eb8542849e7c949742ba348a3efa2350e8bf54b8e2402a7810e6", + "fingerprint": "2460866d5685a188aaef77af23bcd4959b0b8a3383d6b173208cde893e5560ab", "snapshot": { - "docs/reference/type-aliases/HotkeyCallbackContextFor.md": "c43a6180231ca3400972f3224f45f3e905cd2ef31b861e87906907e492047d67" + "docs/reference/type-aliases/HotkeyCallbackContextFor.md": "7c052258aa3101405ccaaa45fa1bc50c51b5f375a8f156391a347e772ce71b71" }, - "head": "1f0a2c627c4a18f005762600966a81e9b8daef3a", - "outcome": "no-change", - "reason": "Refactor to shared types and helpers, generated reference docs, and an example type fix; no guidance changes.", - "evidence": [ - "Behavior and public names are unchanged; reference docs are regenerated by pnpm generate-docs." - ] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:docs/reference/type-aliases/HotkeyChord.md": { - "fingerprint": "0b5c78a9bc6fd36778961658cb5d24cfd97954ad5cd9865cb2474e0bf0d48a92", + "fingerprint": "143de2c768ed57671a3469f757f7d9871958426f62037817919036f231a1d133", "snapshot": { - "docs/reference/type-aliases/HotkeyChord.md": "edc560e3c88e6138d8bf04d29596c7cfe30facb595bcd45f7ccaf51e2e78dddf" + "docs/reference/type-aliases/HotkeyChord.md": "e69fbef9834e70694dc02fee0d0e509f6fa1278dbb6519f8dbc80e02cbde61cc" }, - "head": "1f0a2c627c4a18f005762600966a81e9b8daef3a", - "outcome": "no-change", - "reason": "Refactor to shared types and helpers, generated reference docs, and an example type fix; no guidance changes.", - "evidence": [ - "Behavior and public names are unchanged; reference docs are regenerated by pnpm generate-docs." - ] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:docs/reference/type-aliases/HotkeySequence.md": { - "fingerprint": "fdc28606e2c7c95cbe4f33c78ddefc21c93c5ac0950d9fa432cc96ec575daf04", + "fingerprint": "09005f673f8258f00b625fcaaa33f728f49ebfd9c26a7391bd55395147d01d7c", "snapshot": { - "docs/reference/type-aliases/HotkeySequence.md": "c9423470dd68f02a188239404da45516d0fc6a4e66a361754af9b3282f915de7" + "docs/reference/type-aliases/HotkeySequence.md": "b559bbc3f3ccfb804449238b3c0d360afae4c47e1776113fcd299ae72f268dde" }, - "head": "1f0a2c627c4a18f005762600966a81e9b8daef3a", - "outcome": "no-change", - "reason": "Refactor to shared types and helpers, generated reference docs, and an example type fix; no guidance changes.", - "evidence": [ - "Behavior and public names are unchanged; reference docs are regenerated by pnpm generate-docs." - ] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:docs/reference/type-aliases/IndividualKey.md": { - "fingerprint": "55fb2787baae837901605fcaf0fcb0ef61090afb0320b2acad16255f5af8f541", + "fingerprint": "c83116e2f0f2adfbea2dee53d986808e513699be2b96ff121f388fa555025e8b", "snapshot": { - "docs/reference/type-aliases/IndividualKey.md": "0d826071205ecc3d0adf7312486d8ce4605667b68c016b187ea1ddc2a7bb08e0" + "docs/reference/type-aliases/IndividualKey.md": "af5a33fc1f61aed3ccb925d37afef4f18c1bcd8f88c709e191e802ef1f1cd2bb" }, - "head": "a7c7ddcf89fac99790eb60372fc440fcc34f1b07", + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", "outcome": "out-of-scope", - "reason": "Generated reference docs, examples, tests, sidebar config, lockfile, or package/tsconfig wiring for the layout key types; no skill guidance depends on them.", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", "evidence": ["No skill references this file"] }, "source:docs/reference/type-aliases/Key.md": { - "fingerprint": "28a57f322bebd160c34c9e0363cab0fee89e40f439861c29c6109a4ff1f52413", + "fingerprint": "fb885bdfc746397260d4ced247eb79c699dc00364af35d3043580236cfdba166", "snapshot": { - "docs/reference/type-aliases/Key.md": "3a4515ae6ede72316d6fbe59a5f6c4912187d1f2abe1b03a953416b96e5f3b18" + "docs/reference/type-aliases/Key.md": "2f3343b60b788033630ca7e21d79f34b1e4cd36d609ad3ac23f309cfd3987907" }, - "head": "a7c7ddcf89fac99790eb60372fc440fcc34f1b07", + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", "outcome": "out-of-scope", - "reason": "Generated reference docs, examples, tests, sidebar config, lockfile, or package/tsconfig wiring for the layout key types; no skill guidance depends on them.", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", "evidence": ["No skill references this file"] }, "source:docs/reference/type-aliases/LetterKey.md": { @@ -13334,13 +13354,13 @@ "evidence": ["No skill references this file"] }, "source:docs/reference/type-aliases/LogicalKey.md": { - "fingerprint": "c27e4be00a6acaf6b420a789aeabedf80f19d53d139551765ef05fbacea4590a", + "fingerprint": "00dffb1fd4c616f26cd1318d33e163dae6bac2eed102d7c38ee356fa367c671e", "snapshot": { - "docs/reference/type-aliases/LogicalKey.md": "559411484149a1b68aa889cf95caa9572d39e05bc1cf30faa79dae63dff8805f" + "docs/reference/type-aliases/LogicalKey.md": "2dc85aca73df1eb580dcfbb9e0b1aa26de4d65bf4f4807378bd76537be031748" }, - "head": "a7c7ddcf89fac99790eb60372fc440fcc34f1b07", + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", "outcome": "out-of-scope", - "reason": "Generated reference docs, examples, tests, sidebar config, lockfile, or package/tsconfig wiring for the layout key types; no skill guidance depends on them.", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", "evidence": ["No skill references this file"] }, "source:docs/reference/type-aliases/Modifier.md": { @@ -13354,13 +13374,13 @@ "evidence": ["No skill references this file"] }, "source:docs/reference/type-aliases/NamedKey.md": { - "fingerprint": "01d2af31ee75e96db2514fd2db6f095a25f9018a05bfcda5c5af28b55244506d", + "fingerprint": "c84dfff56d2ca9ede95e266ddcb941bdc72dbd8c914ed195bfa43aa7ac975daa", "snapshot": { - "docs/reference/type-aliases/NamedKey.md": "f7c327df8d3258400bd5f84f76e59f39df620619a7a0665da4b027085526fc81" + "docs/reference/type-aliases/NamedKey.md": "bbc9913a6cc607d106fe68aea52522f5f8a8f2115915dd3541b0d4edd4b4c97a" }, - "head": "a7c7ddcf89fac99790eb60372fc440fcc34f1b07", + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", "outcome": "out-of-scope", - "reason": "Generated reference docs, examples, tests, sidebar config, lockfile, or package/tsconfig wiring for the layout key types; no skill guidance depends on them.", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", "evidence": ["No skill references this file"] }, "source:docs/reference/type-aliases/NavigationKey.md": { @@ -13374,13 +13394,13 @@ "evidence": ["No skill references this file"] }, "source:docs/reference/type-aliases/NonPunctuationKey.md": { - "fingerprint": "e3b541870b52cf9cb2c15763cd6b426272d689a50de63c68cb8d10f92b8809a1", + "fingerprint": "e4f12f676b8a83947603b8ef19cf9701884abb73101a4ada5fcb1771ac5253dd", "snapshot": { - "docs/reference/type-aliases/NonPunctuationKey.md": "cbe2ff60dc0c1c0935753c9e371d28f102f0e90a37dcebfc261bb89eabd2678b" + "docs/reference/type-aliases/NonPunctuationKey.md": null }, - "head": "a7c7ddcf89fac99790eb60372fc440fcc34f1b07", + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", "outcome": "out-of-scope", - "reason": "Generated reference docs, examples, tests, sidebar config, lockfile, or package/tsconfig wiring for the layout key types; no skill guidance depends on them.", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", "evidence": ["No skill references this file"] }, "source:docs/reference/type-aliases/NumberKey.md": { @@ -13394,120 +13414,104 @@ "evidence": ["No skill references this file"] }, "source:docs/reference/type-aliases/ParsedHotkeyChord.md": { - "fingerprint": "e5e10c5b3105ecaa5d25ab06e7b39f6b9deb3717106fd9432152907d43e43ccf", + "fingerprint": "e8218081330fff924ada23e00c5898cfb811f2de17510dbe4fb9e2fea6be6394", "snapshot": { - "docs/reference/type-aliases/ParsedHotkeyChord.md": "4f206cd861033c87bea19f8fcd081318a4365d9babd8468804bc685a1efdb5ee" + "docs/reference/type-aliases/ParsedHotkeyChord.md": "fea2d3694ed079100ad01661c5410f9379b9f77ad6a6a471a531ae3e2a1fcea2" }, - "head": "1f0a2c627c4a18f005762600966a81e9b8daef3a", - "outcome": "no-change", - "reason": "Refactor to shared types and helpers, generated reference docs, and an example type fix; no guidance changes.", - "evidence": [ - "Behavior and public names are unchanged; reference docs are regenerated by pnpm generate-docs." - ] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:docs/reference/type-aliases/PhysicalKey.md": { - "fingerprint": "10cf011e1029104d5cca7506fd7a651b44bfa8cf95ae3fb8a33364f6971c6c4a", + "fingerprint": "2b6b7882dc5ef20cf8e79af78d1546973fbd1faed312d2eb3e32c9c1ae5674a1", "snapshot": { - "docs/reference/type-aliases/PhysicalKey.md": "f7345f8ec5603a614f4fe41e45a1640463e70f2de095e53bc8341f3014c9473f" + "docs/reference/type-aliases/PhysicalKey.md": "3102cb116dc0170a8cf58a9a57b4395acb8e7f1dd94cfc6a68bc68979a337c64" }, - "head": "a7c7ddcf89fac99790eb60372fc440fcc34f1b07", + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", "outcome": "out-of-scope", - "reason": "Generated reference docs, examples, tests, sidebar config, lockfile, or package/tsconfig wiring for the layout key types; no skill guidance depends on them.", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", "evidence": ["No skill references this file"] }, "source:docs/reference/type-aliases/PunctuationKey.md": { - "fingerprint": "6d8b0d1e57f01063dff40928b4858d872451d3c56b45ec6d89bcf34ee1f597dd", + "fingerprint": "7eb7a5b3b8fe3ee29e71f86d5a7949eee472b953dbc1c11f047a9122ee9404e6", "snapshot": { - "docs/reference/type-aliases/PunctuationKey.md": "5f0fd0d9bf635d3f436041dc8ef107087900cd99b97af497772689b6af852d0d" + "docs/reference/type-aliases/PunctuationKey.md": null }, - "head": "a7c7ddcf89fac99790eb60372fc440fcc34f1b07", + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", "outcome": "out-of-scope", - "reason": "Generated reference docs, examples, tests, sidebar config, lockfile, or package/tsconfig wiring for the layout key types; no skill guidance depends on them.", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", "evidence": ["No skill references this file"] }, "source:docs/reference/type-aliases/RawHotkeyChord.md": { - "fingerprint": "35bd9918fe5788d0ddf4679bc4e07ca18c9b51dfe230de28c10312264fac6106", + "fingerprint": "b96ec5ca275a10333c7079bfe2930738d5183ee115b1e31fa70d932e6832f0cd", "snapshot": { - "docs/reference/type-aliases/RawHotkeyChord.md": "6ec3b04e1b2d74d14effc71fd6e608115d7ce937e1ded598bf20042ccfc4641f" + "docs/reference/type-aliases/RawHotkeyChord.md": "e063aeca91207e60ea5abbbbc587fe025893aeaaea9bfc8659ad2f35d51b359c" }, - "head": "1f0a2c627c4a18f005762600966a81e9b8daef3a", - "outcome": "no-change", - "reason": "Refactor to shared types and helpers, generated reference docs, and an example type fix; no guidance changes.", - "evidence": [ - "Behavior and public names are unchanged; reference docs are regenerated by pnpm generate-docs." - ] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:docs/reference/type-aliases/RegisterableHotkey.md": { - "fingerprint": "65b7e587ee69db58dd260bc94e151a49ac882469557f910708ac604ad866ebf9", + "fingerprint": "c1d9aae86852950fd72e8fed012a1aa4abac71704fcb0cd846bc555d23c82ce9", "snapshot": { - "docs/reference/type-aliases/RegisterableHotkey.md": "b8bbc9e8af0b1ea3ec13905a728a24eaa094922a62ddf60041980e86ee1232ea" + "docs/reference/type-aliases/RegisterableHotkey.md": "e4b8faef3f1e32056ee7d15593e202ec7842b3dea9288d4dd4ac5546c6917312" }, - "head": "1f0a2c627c4a18f005762600966a81e9b8daef3a", - "outcome": "no-change", - "reason": "Refactor to shared types and helpers, generated reference docs, and an example type fix; no guidance changes.", - "evidence": [ - "Behavior and public names are unchanged; reference docs are regenerated by pnpm generate-docs." - ] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:docs/reference/type-aliases/RegisterableHotkeyChord.md": { - "fingerprint": "c2992852386a2ee151b1dabd572e1583851d4c0e018936e44c6ac6ffca7efa07", + "fingerprint": "d98a5d8f4e63e3b914c8e4f304d2ba6fe28cda1a879a593b702f1bfc44af9037", "snapshot": { - "docs/reference/type-aliases/RegisterableHotkeyChord.md": "df092b10059e52a483f5964c1c5a70ca648d9b837969413f8eea034ebb2c836a" + "docs/reference/type-aliases/RegisterableHotkeyChord.md": "f566d1311a31f645f40f9af2b9166dd36deae678b72341c17f0c845f663cff5e" }, - "head": "1f0a2c627c4a18f005762600966a81e9b8daef3a", - "outcome": "no-change", - "reason": "Refactor to shared types and helpers, generated reference docs, and an example type fix; no guidance changes.", - "evidence": [ - "Behavior and public names are unchanged; reference docs are regenerated by pnpm generate-docs." - ] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:docs/reference/type-aliases/RegisterableHotkeySequence.md": { - "fingerprint": "98990d004ea548b3527efed954699cf435addb0ac7bcf925de095e6de3ccd548", + "fingerprint": "36f802f6c6377480286b91c57aa955be9d9ee1fb856b07ec12ae419a05651435", "snapshot": { - "docs/reference/type-aliases/RegisterableHotkeySequence.md": "4ce5de2a1fbe0d783bf58b0b541e210fde36f82656d7d95a1bf85c19b747f120" + "docs/reference/type-aliases/RegisterableHotkeySequence.md": "0d185e5a68f414329bd18efe280ac36c64d5b07278668764bc26f1abc94e5119" }, - "head": "1f0a2c627c4a18f005762600966a81e9b8daef3a", - "outcome": "no-change", - "reason": "Refactor to shared types and helpers, generated reference docs, and an example type fix; no guidance changes.", - "evidence": [ - "Behavior and public names are unchanged; reference docs are regenerated by pnpm generate-docs." - ] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:docs/reference/type-aliases/SingleModifierHotkeyChord.md": { - "fingerprint": "e1a5421aa120cf615f0ed6a48f4f7461bc58c522a8d7cbe4c2fedbce7a2097c9", + "fingerprint": "3d6d9b32f2009048136dd9aec0f334038d2dce0850a8c6731077ccadf251df4d", "snapshot": { - "docs/reference/type-aliases/SingleModifierHotkeyChord.md": "4480539bd31b6b73870306245eb9217aa9d88b5cb0e3abb5d20a384865809ce7" + "docs/reference/type-aliases/SingleModifierHotkeyChord.md": "aa243d12630707ca7f2bf8ed285aee443f667a62c2d9a0c399f9f66626ce1a2a" }, - "head": "1f0a2c627c4a18f005762600966a81e9b8daef3a", - "outcome": "no-change", - "reason": "Refactor to shared types and helpers, generated reference docs, and an example type fix; no guidance changes.", - "evidence": [ - "Behavior and public names are unchanged; reference docs are regenerated by pnpm generate-docs." - ] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:docs/reference/type-aliases/ThreeModifierHotkeyChord.md": { - "fingerprint": "fdf7655195a92083aeec45cbebc3629db3392ffc7a8d1e45fa5ed5f9e3db3a43", + "fingerprint": "a48cf0f1b7ae5d85179afd272f071ea78a0331ed29807372b0a373fb26c4acf0", "snapshot": { - "docs/reference/type-aliases/ThreeModifierHotkeyChord.md": "6d6745e2e5a47c96850ced8d1fa523bd00f609c7b15d72bb0912c672753184bb" + "docs/reference/type-aliases/ThreeModifierHotkeyChord.md": "ade17821e2bca0b50b6059c968fbdc603fa8e9af1cf93a9da51cdc911118f70f" }, - "head": "1f0a2c627c4a18f005762600966a81e9b8daef3a", - "outcome": "no-change", - "reason": "Refactor to shared types and helpers, generated reference docs, and an example type fix; no guidance changes.", - "evidence": [ - "Behavior and public names are unchanged; reference docs are regenerated by pnpm generate-docs." - ] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:docs/reference/type-aliases/TwoModifierHotkeyChord.md": { - "fingerprint": "67da8fecb2e07331c72e51f1cf1f38fa4d6b8bbc296f4730c19a4c2567b2b5f4", + "fingerprint": "c36a3fc91a187a9dbde493363e0e6631b322a25cbb9ff1ff81aac4ab97de2f6f", "snapshot": { - "docs/reference/type-aliases/TwoModifierHotkeyChord.md": "0bc8caf927e5a721189e18f61b96028cd593ecb79706d85c4e30492ff0ce3dda" + "docs/reference/type-aliases/TwoModifierHotkeyChord.md": "0e2cbb1c73d34c399132170e03b8ea5aa59cccf84b11d459621d784e61606e5c" }, - "head": "1f0a2c627c4a18f005762600966a81e9b8daef3a", - "outcome": "no-change", - "reason": "Refactor to shared types and helpers, generated reference docs, and an example type fix; no guidance changes.", - "evidence": [ - "Behavior and public names are unchanged; reference docs are regenerated by pnpm generate-docs." - ] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:docs/reference/variables/KEY_DISPLAY_SYMBOLS.md": { "fingerprint": "6b520bb5e41aef0fdb80269481f1e182519cb1450e6ed433d2865494c7217e32", @@ -17097,16 +17101,15 @@ ] }, "source:packages/hotkeys/src/hotkey.types.ts": { - "fingerprint": "82eb5f5048b60046e2223745d347e8b8f9fa098b70847459ab4d84182d995a1f", + "fingerprint": "317ae07fec185768c1c95eebda2f6dc20178e3a43b3cf2bde1c78d3fe8c9cc2c", "snapshot": { - "packages/hotkeys/src/hotkey.types.ts": "6d4e1d2fe99521d53c39d2a1ee443d0bb9520e53a9ae221a0c998536baa85d1a" + "packages/hotkeys/src/hotkey.types.ts": "8c96d5fd4b55bba32c3dbc22315c8c99293d76a26fcb7d9b0690dc33d9579dcf" }, - "head": "7cf53a0cf4759de322e2bdf45b5b834960d68778", - "outcome": "updated", - "reason": "Source or guide change for trigger(), call-site meta, or enabled getters; the affected guidance was updated in the app-hotkeys and hotkeys-core skills and their references.", + "head": "ab62e7bdc2b417476e6b9f7664104c27ae14a178", + "outcome": "no-change", + "reason": "Formatting only: oxfmt rewrapped lines. No API, behavior, or doc change.", "evidence": [ - "packages/hotkeys/src/hotkey.types.ts", - "pnpm -C packages/hotkeys exec vitest run (2182 passed, including tests/trigger.test.ts); nx test:lib/test:types/test:eslint/test:build for 20 projects passed; intent validate packages/hotkeys/skills passed. Not run: fresh-consumer sessions." + "pnpm format output; git diff shows whitespace and line-wrap changes only." ] }, "source:packages/lit-hotkeys/eslint.config.js": { @@ -17801,14 +17804,14 @@ "evidence": ["e2e/support/fixtures.ts"] }, "source:e2e/browser/held-keys-and-recorder.spec.ts": { - "fingerprint": "d00927f6723aed8e582ecec0631cfcfa91dd4c83c642914eab468b22e7953eaa", + "fingerprint": "d7c7df69d21c53d6c6ca4dde2e0641ecfeb28542927bbb703370456c4e1d80f5", "snapshot": { - "e2e/browser/held-keys-and-recorder.spec.ts": "f70769b902405af89db87383c0aa1477c41a71747a55c4d39fe94fbde4b063ae" + "e2e/browser/held-keys-and-recorder.spec.ts": "8f31cda8a3194609bb9b2688e74eb77c11f218344199267e58f64a1178f14702" }, - "head": "05be1291a103f39c2570697d44e8df5e039f4497", - "outcome": "no-change", - "reason": "Covered by the app-hotkeys and hotkeys-core skill updates; generated reference, tests, e2e and guide edits need no other skill change.", - "evidence": ["e2e/browser/held-keys-and-recorder.spec.ts"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:packages/hotkeys/tests/recorder-tab.test.ts": { "fingerprint": "c00d323dde5a54c220a53d205f31ce6c0ce87018dd49bca5f6e0eb5a8b605ccc", @@ -18705,14 +18708,14 @@ ] }, "source:e2e/layouts/more-layouts.spec.ts": { - "fingerprint": "8daecb2ff6810d31940c2b91f9b0328b79931cf6e226a866e0e66783da4e1845", + "fingerprint": "b7f0eb05ee60388bfc31f25d8b84a177de95fa0a371b0350023d4de1df6eb390", "snapshot": { - "e2e/layouts/more-layouts.spec.ts": "e8990f4d7ff5531239e4db9dde78f930f7d1753d3bce5052dea20da01d0eefe3" + "e2e/layouts/more-layouts.spec.ts": "690a9d9bc8152672d2b1692d79ff6d2d2fbc516efda3dcb842dda96390e3b75d" }, - "head": "05be1291a103f39c2570697d44e8df5e039f4497", - "outcome": "no-change", - "reason": "Covered by the app-hotkeys and hotkeys-core skill updates; generated reference, tests, e2e and guide edits need no other skill change.", - "evidence": ["e2e/layouts/more-layouts.spec.ts"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:e2e/playwright.adapters.config.ts": { "fingerprint": "78b6d7f3510be3aec5691c58dfc68dd800ca71d5b34254301eea3293adbeefad", @@ -18885,14 +18888,16 @@ "evidence": ["packages/hotkeys/tests/hotkey-recorder-steps.test.ts"] }, "source:packages/hotkeys/tests/hotkey-recorder.test.ts": { - "fingerprint": "c8ef3490c6039d80f0adf3e5db0279423a2307b37487ebc6ec82f049fad5107d", + "fingerprint": "c1494b55a6e031bb52585a42f13e365e4e3342f236cd1ddd78b7e3fb77db1731", "snapshot": { - "packages/hotkeys/tests/hotkey-recorder.test.ts": "5edb400d6f343b2ce8b651d3b74ba025e510d63731435a7d0fa9999abcfeb451" + "packages/hotkeys/tests/hotkey-recorder.test.ts": "a13d6e1ba6cdb24a6b701e92ca43038865f33337c97e2135795edfbb9fa8e7f0" }, - "head": "c94ffd5ba8b28f537cfd2f128bb9a27bc537c22b", + "head": "ab62e7bdc2b417476e6b9f7664104c27ae14a178", "outcome": "no-change", - "reason": "Source, test, or doc change covered by the skill reviews above; no packaged guidance depends on it.", - "evidence": ["packages/hotkeys/tests/hotkey-recorder.test.ts"] + "reason": "Formatting only: oxfmt rewrapped lines. No API, behavior, or doc change.", + "evidence": [ + "pnpm format output; git diff shows whitespace and line-wrap changes only." + ] }, "source:packages/hotkeys/tests/invariants/event-fuzz.test.ts": { "fingerprint": "9bdf03502ed83aba3696306bb568db6b510e1ab2b8f3a569c520d4c3ddf48354", @@ -19749,14 +19754,14 @@ "evidence": ["packages/hotkeys/src/_dev.ts"] }, "source:e2e/browser/macos-reported-keys.spec.ts": { - "fingerprint": "ef1a4b6ad4e82adf42683872114e03a4d158c772b5576cae6f0813811e46cb58", + "fingerprint": "0974a1f4912c533969ed63977b3a5d5910942f7943f8f93598d8ed469edd54a0", "snapshot": { - "e2e/browser/macos-reported-keys.spec.ts": "4674f4dfd6e6bd4fa2e8773b7e8b17ca8ccae688f75fb6b9625a3de9759d67c3" + "e2e/browser/macos-reported-keys.spec.ts": "4166aac971197e02251c2d6e0a44ad0bc061e5bb9e7e593f36f78ea41caa3ab1" }, - "head": "05be1291a103f39c2570697d44e8df5e039f4497", - "outcome": "no-change", - "reason": "Covered by the app-hotkeys and hotkeys-core skill updates; generated reference, tests, e2e and guide edits need no other skill change.", - "evidence": ["e2e/browser/macos-reported-keys.spec.ts"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:packages/hotkeys/src/_chord.ts": { "fingerprint": "990b00361c2c23e5a846cc4573ab52ae1796cc14b726eb440b9290271bb2a7b2", @@ -19779,39 +19784,34 @@ "evidence": ["Docker real-layout suite 238/238, core 1,954 tests"] }, "source:packages/hotkeys/tests/public-api.test.ts": { - "fingerprint": "e7ccbe3f2531d275da27bf8205e5861690f486c028f9fa1bb0ee33d3d99aa874", + "fingerprint": "4b9860bc12aa9525172b4158052504af7d5c704fa7725caa80fc2a783f2a6056", "snapshot": { - "packages/hotkeys/tests/public-api.test.ts": "50efc4a48d80e81ccb3973ccccea98bd16b7ffe621f4fac9c19121f359e7c4d5" + "packages/hotkeys/tests/public-api.test.ts": "6a7412f463c944c24190bef59312de2e33876924bd672900233298c827226013" }, - "head": "1f0a2c627c4a18f005762600966a81e9b8daef3a", - "outcome": "no-change", - "reason": "Refactor to shared types and helpers, generated reference docs, and an example type fix; no guidance changes.", - "evidence": [ - "Behavior and public names are unchanged; reference docs are regenerated by pnpm generate-docs." - ] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:packages/hotkeys/tests/typed-keys.ts": { - "fingerprint": "52a33dccd9d3df6858f123ba8954fba917030919e7c23733936d8c85c16290ca", + "fingerprint": "59f61e65628c5bec09da06a6f2b3371e7dce9d278b7deff017f8ea02b85b2c95", "snapshot": { - "packages/hotkeys/tests/typed-keys.ts": "71aaae0a0750ff78d9c12e238742ec1104a6744da823ebd22b48e72a7d1d909b" + "packages/hotkeys/tests/typed-keys.ts": "05beb9a58b3348d11df4f8653372b15ba48506e46a4ac1225a71178a48c2270a" }, - "head": "cd1c66aab538ccac294e72ee36ae4466fa9b2d2b", + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", "outcome": "out-of-scope", - "reason": "Test change; it describes no library behavior the guidance covers.", - "evidence": ["packages/hotkeys/tests/typed-keys.ts"] + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:packages/hotkeys/tests/app-hotkeys-type-performance.test.ts": { - "fingerprint": "c69476942997a0a4977fb37b7372406ca073ff7d466650e60ce9c4a05456c774", + "fingerprint": "9c38573cbeab2346e2cef5395905c1974dfc32ea5bf2ad8d3eaaf9f7b7a32e72", "snapshot": { - "packages/hotkeys/tests/app-hotkeys-type-performance.test.ts": "091c31810246de92d1cde1c53262fd558569df081a3018a524aa77ad3b219f06" + "packages/hotkeys/tests/app-hotkeys-type-performance.test.ts": "68cfb73a4eb31e5d1418ed731fbc1bc0695897ef848152213d0434107e3d0937" }, - "head": "33e0b46f70957660418f1c76e9180c5badccd1fc", - "outcome": "no-change", - "reason": "Tests for editor latency, the generic id lookup, and the factory test argument type; no skill covers test files.", - "evidence": [ - "packages/hotkeys/tests/app-hotkeys-type-performance.test.ts", - "packages/hotkeys: tsc, test:types and vitest (61 files, 2187 tests) pass; intent validate passed. Not run: fresh-consumer sessions." - ] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:packages/vue-hotkeys/tests/composable-types.test.ts": { "fingerprint": "ee70231fdbd36e17a936d257f951922345b0cf2f44ba155a649a82284f103c52", @@ -19891,14 +19891,14 @@ ] }, "source:packages/hotkeys/tests/recorder-auto.test.ts": { - "fingerprint": "97bf79f1a470c3ff3ad0de1f16bfd389eb43487d4e5f8c8b8ff0c6b5d5af33cf", + "fingerprint": "fdf5987cfa7ba6c4285ede995c036e006f47fbbb07eaa33678a7b22d6cb79afa", "snapshot": { - "packages/hotkeys/tests/recorder-auto.test.ts": "395728509c145773e7b8f32c5d85f6152aa888de17ac03a091a8ba5e1e189f51" + "packages/hotkeys/tests/recorder-auto.test.ts": "60cf983cb569ab90909c2273a683c9677d8560d9b5a7aefaa47a13b478dc9b64" }, - "head": "5bcd4898b0e990c8d96442fd585623ceed6e9009", - "outcome": "no-change", - "reason": "Guide wording and an AltGr recorder fix; no other skill states these details.", - "evidence": ["packages/hotkeys/tests/recorder-auto.test.ts"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:packages/octane-hotkeys/src/types.ts": { "fingerprint": "7ba9abda31b96b8389f91beec55a07210b5ee0bf21d3c522c9f0628c3ab2b59b", @@ -21268,14 +21268,14 @@ ] }, "source:docs/reference/interfaces/HotkeyRecorderActions.md": { - "fingerprint": "2aeefdedab9d46b9cdc15bfc543502e5aa8ea404b114b1cf306cab75617dfd22", + "fingerprint": "955f42613a83bea5ae8d0b8f748806037e5098601b312048fb93579461e1defc", "snapshot": { - "docs/reference/interfaces/HotkeyRecorderActions.md": "d87be1bca835982cc00ff2a82890d31e49a5d12c1051400bb2177080adc6e36f" + "docs/reference/interfaces/HotkeyRecorderActions.md": "c079146b5d64e3e2def426e27eb07115bd542d7cd64fb041cb919d8715c91dfa" }, - "head": "cd1c66aab538ccac294e72ee36ae4466fa9b2d2b", - "outcome": "no-change", - "reason": "Regenerated reference page. The skills cover the formatForAria, createFormatter, and suspendCharacterKeys API changes.", - "evidence": ["packages/hotkeys/skills/hotkeys-core/SKILL.md"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:docs/reference/interfaces/HotkeyRegistrationsResult.md": { "fingerprint": "7ced15b022bd68bf602f6418857ccfcc6f62f43c6fb06fd7c9dbade138e97b39", @@ -21291,13 +21291,13 @@ ] }, "source:docs/reference/interfaces/KeyIdentity.md": { - "fingerprint": "46885e2ce6f4b0697372e058a902f4df9526f7a9c0141ea4a5c48ce2996ae2d2", + "fingerprint": "01778acf4d3e4d29b593ff66d8ae9db906c0bf8f1dc4418b3cc32fc1a609e79e", "snapshot": { - "docs/reference/interfaces/KeyIdentity.md": "f66ae20937313bdc3530aa0366c7207ab25873afaba47229994194f8ecaeafff" + "docs/reference/interfaces/KeyIdentity.md": "dc4d24f27258495c177783599605366ada8671f76427c8fdcfb7e7a636d11974" }, - "head": "a7c7ddcf89fac99790eb60372fc440fcc34f1b07", + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", "outcome": "out-of-scope", - "reason": "Generated reference docs, examples, tests, sidebar config, lockfile, or package/tsconfig wiring for the layout key types; no skill guidance depends on them.", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", "evidence": ["No skill references this file"] }, "source:docs/reference/type-aliases/HotkeyCommonOptions.md": { @@ -21314,29 +21314,24 @@ ] }, "source:docs/reference/type-aliases/HotkeyEventType.md": { - "fingerprint": "77566ac36b19334c8808de76cdad5afd1e02377a468ea87daf2c01d2e4aac4fe", + "fingerprint": "50f4adaa896120aed6be1e538fbc782ec63b6714970913c812d5b4d43316c013", "snapshot": { - "docs/reference/type-aliases/HotkeyEventType.md": "cac7be03f5f710078549a9a62f231d3c95fac4ea5eb61ecb808d87eca1b1e857" + "docs/reference/type-aliases/HotkeyEventType.md": "d80696f92c60cec6ce7f5c689e9ff3b40ec3830d1f9b1620ec5b41f2a58c11bb" }, - "head": "1f0a2c627c4a18f005762600966a81e9b8daef3a", - "outcome": "no-change", - "reason": "Refactor to shared types and helpers, generated reference docs, and an example type fix; no guidance changes.", - "evidence": [ - "Behavior and public names are unchanged; reference docs are regenerated by pnpm generate-docs." - ] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:docs/reference/type-aliases/MaybeGetter.md": { - "fingerprint": "3b4f76094152fa2846dca941eed0e4166ac8297b1572dbc0faa4be2b03b0850e", + "fingerprint": "e548228dfa1c6e3e515ba66712fcad88880555f1a0a4b64030aee2e300b3de74", "snapshot": { - "docs/reference/type-aliases/MaybeGetter.md": "d284c4883e4f1d2449629015976054434739b42337f197e5bda28db17e024a3e" + "docs/reference/type-aliases/MaybeGetter.md": "844fffbcaceccdc3b8fd777c8385ff579e391717c23d13bc841b82d79959b8cf" }, - "head": "7cf53a0cf4759de322e2bdf45b5b834960d68778", - "outcome": "no-change", - "reason": "Generated by pnpm generate-docs from the changed JSDoc and types; the guidance it reflects is reviewed under the app-hotkeys and hotkeys-core skills.", - "evidence": [ - "docs/reference/type-aliases/MaybeGetter.md", - "pnpm -C packages/hotkeys exec vitest run (2182 passed, including tests/trigger.test.ts); nx test:lib/test:types/test:eslint/test:build for 20 projects passed; intent validate packages/hotkeys/skills passed. Not run: fresh-consumer sessions." - ] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:docs/reference/type-aliases/RegisteredAppHotkeyListItem.md": { "fingerprint": "14a3bd60f535f528ce4aff34862dd8e7cb4b2ea214f3b52d4e292996defc8327", @@ -21659,104 +21654,134 @@ ] }, "source:docs/framework/alpine/guides/keyboard-layouts.md": { - "fingerprint": "c020741d838804d38460febf4899b2e33e3e9e2a71955106c9330afaf9462553", + "fingerprint": "a460d916cc3384452e3e14420fa268b67b2fab0c0f594fb78083a57d721f7b67", "snapshot": { - "docs/framework/alpine/guides/keyboard-layouts.md": "b56eb2037a30686bea36e4232f546c794b1ce04d2717f4472a055b1c3f42fbd7" + "docs/framework/alpine/guides/keyboard-layouts.md": "b1e23a026b8ffd0b2b843ce9c3d90df63522ddf7155cc595afd8d63c302f61d5" }, - "head": "cd1c66aab538ccac294e72ee36ae4466fa9b2d2b", - "outcome": "no-change", - "reason": "Guide change for formatForAria, suspendCharacterKeys, the Accessibility guide, or list wording. The skill reflects the API changes.", - "evidence": ["packages/alpine-hotkeys/skills/alpine-hotkeys/SKILL.md"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "updated", + "reason": "Hotkey string types now reject Shift with a symbol, and the recorder never records one. The guides were updated to match; hotkeys-core SKILL.md and app-hotkeys references/recording.md carry the same rules.", + "evidence": [ + "packages/hotkeys/skills/hotkeys-core/SKILL.md", + "packages/hotkeys/skills/app-hotkeys/references/recording.md" + ] }, "source:docs/framework/angular/guides/keyboard-layouts.md": { - "fingerprint": "c0b8d094d6b62161103bc875f77756f5c7ee8c12356e9a424df9a63b6ed50287", + "fingerprint": "edea6cc5e600264ccfa01b9520482bd5cbac97879ca6b497b7c46dfc0de4f8be", "snapshot": { - "docs/framework/angular/guides/keyboard-layouts.md": "f7103ecb6af00db12783872678911525a7c165200af4b15511ce8ee599922f6d" + "docs/framework/angular/guides/keyboard-layouts.md": "87ce79d12ff7717078951a33c77d96f445b4871e7bd8193557e28208dabcd09f" }, - "head": "cd1c66aab538ccac294e72ee36ae4466fa9b2d2b", - "outcome": "no-change", - "reason": "Guide change for formatForAria, suspendCharacterKeys, the Accessibility guide, or list wording. The skill reflects the API changes.", - "evidence": ["packages/angular-hotkeys/skills/angular-hotkeys/SKILL.md"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "updated", + "reason": "Hotkey string types now reject Shift with a symbol, and the recorder never records one. The guides were updated to match; hotkeys-core SKILL.md and app-hotkeys references/recording.md carry the same rules.", + "evidence": [ + "packages/hotkeys/skills/hotkeys-core/SKILL.md", + "packages/hotkeys/skills/app-hotkeys/references/recording.md" + ] }, "source:docs/framework/ember/guides/keyboard-layouts.md": { - "fingerprint": "b84a93bfc7d5d6e78070e440d59b7e252ae326bd6f8c98943895a6f895e4d9f0", + "fingerprint": "bf0ab4fcaacac47bd013b18750eeff4dacc1d8807082ee44e55c85bb2734d341", "snapshot": { - "docs/framework/ember/guides/keyboard-layouts.md": "9cacfddd9e3938bff55a5cc70c4ea4c08b995b4a374058627b9c84c294a91b43" + "docs/framework/ember/guides/keyboard-layouts.md": "3c8470430890128d1e57785ad1084a082bd92fac90994f377a8016407dd665d2" }, - "head": "cd1c66aab538ccac294e72ee36ae4466fa9b2d2b", - "outcome": "no-change", - "reason": "Guide change for formatForAria, suspendCharacterKeys, the Accessibility guide, or list wording. The skill reflects the API changes.", - "evidence": ["packages/ember-hotkeys/skills/ember-hotkeys/SKILL.md"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "updated", + "reason": "Hotkey string types now reject Shift with a symbol, and the recorder never records one. The guides were updated to match; hotkeys-core SKILL.md and app-hotkeys references/recording.md carry the same rules.", + "evidence": [ + "packages/hotkeys/skills/hotkeys-core/SKILL.md", + "packages/hotkeys/skills/app-hotkeys/references/recording.md" + ] }, "source:docs/framework/lit/guides/keyboard-layouts.md": { - "fingerprint": "8ee304370e7a83605bd8980df37f4eed15ae8eefc552289fb9f9f5fa9047eb3b", + "fingerprint": "a808fc916401601ef0fdff0024c14237638c57ca2c021e23c6937ed0a011d8ec", "snapshot": { - "docs/framework/lit/guides/keyboard-layouts.md": "17b93123e833510d321e8c0da511734059d56aa26d9c1f339a5b0055750b9de9" + "docs/framework/lit/guides/keyboard-layouts.md": "c72959333951dbddab92c0e99a48ffd444bcae2128fa247cf8045e39c0ef5027" }, - "head": "cd1c66aab538ccac294e72ee36ae4466fa9b2d2b", - "outcome": "no-change", - "reason": "Guide change for formatForAria, suspendCharacterKeys, the Accessibility guide, or list wording. The skill reflects the API changes.", - "evidence": ["packages/lit-hotkeys/skills/lit-hotkeys/SKILL.md"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "updated", + "reason": "Hotkey string types now reject Shift with a symbol, and the recorder never records one. The guides were updated to match; hotkeys-core SKILL.md and app-hotkeys references/recording.md carry the same rules.", + "evidence": [ + "packages/hotkeys/skills/hotkeys-core/SKILL.md", + "packages/hotkeys/skills/app-hotkeys/references/recording.md" + ] }, "source:docs/framework/octane/guides/keyboard-layouts.md": { - "fingerprint": "1239aedbe4f9da8735ffa938a1012081207b4f476dfa32770b2c9b2281cc50e8", + "fingerprint": "d0602adf91b42fe35ece2a3164199ad76ccb501dccd1db3cd36924fe9dda967c", "snapshot": { - "docs/framework/octane/guides/keyboard-layouts.md": "962fa8962851bba4680274ef9eb5fe51ea442cce86b55455a7a4f53c6c5fe334" + "docs/framework/octane/guides/keyboard-layouts.md": "2334117afdc0e17a00f4384836a67779e3996fcdd659c5b80cf508271a457af1" }, - "head": "cd1c66aab538ccac294e72ee36ae4466fa9b2d2b", - "outcome": "no-change", - "reason": "Guide change for formatForAria, suspendCharacterKeys, the Accessibility guide, or list wording. The skill reflects the API changes.", - "evidence": ["packages/octane-hotkeys/skills/octane-hotkeys/SKILL.md"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "updated", + "reason": "Hotkey string types now reject Shift with a symbol, and the recorder never records one. The guides were updated to match; hotkeys-core SKILL.md and app-hotkeys references/recording.md carry the same rules.", + "evidence": [ + "packages/hotkeys/skills/hotkeys-core/SKILL.md", + "packages/hotkeys/skills/app-hotkeys/references/recording.md" + ] }, "source:docs/framework/preact/guides/keyboard-layouts.md": { - "fingerprint": "bb44bb22283d8cc4f515a56294be2aaa88e8f4d3d087058e8b8f9ae770f49227", + "fingerprint": "1ca436b98af0a1e5808872b96a393cb8f4f890dc83b6de7101e2f5439cf9d8ce", "snapshot": { - "docs/framework/preact/guides/keyboard-layouts.md": "5cc804ffe00bb55f1a2c98728900214b3900217f305e2412f427ac15839a3c76" + "docs/framework/preact/guides/keyboard-layouts.md": "138f28c79ae53362fb64380104e7bb02e10c97588ac62efdac786df178b31ff9" }, - "head": "cd1c66aab538ccac294e72ee36ae4466fa9b2d2b", - "outcome": "no-change", - "reason": "Guide change for formatForAria, suspendCharacterKeys, the Accessibility guide, or list wording. The skill reflects the API changes.", - "evidence": ["packages/preact-hotkeys/skills/preact-hotkeys/SKILL.md"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "updated", + "reason": "Hotkey string types now reject Shift with a symbol, and the recorder never records one. The guides were updated to match; hotkeys-core SKILL.md and app-hotkeys references/recording.md carry the same rules.", + "evidence": [ + "packages/hotkeys/skills/hotkeys-core/SKILL.md", + "packages/hotkeys/skills/app-hotkeys/references/recording.md" + ] }, "source:docs/framework/react/guides/keyboard-layouts.md": { - "fingerprint": "38bd1fc827d955f3b409bf13ba30807af91b615d0c962e191913e7cf976efb91", + "fingerprint": "2dd4a42f13a0f3d918fc9bbf1d351a774db442a03d96adc94ea2c9fbdf9efe7d", "snapshot": { - "docs/framework/react/guides/keyboard-layouts.md": "6811311ff3662da0f72dc487aff26b2e085172f66a32c19e18deb52cee0ff76e" + "docs/framework/react/guides/keyboard-layouts.md": "f2898b131205fb9a67c6db55a76a62f0903097957d842433b225e2d210e414ff" }, - "head": "cd1c66aab538ccac294e72ee36ae4466fa9b2d2b", - "outcome": "no-change", - "reason": "Guide change for formatForAria, suspendCharacterKeys, the Accessibility guide, or list wording. The skill reflects the API changes.", - "evidence": ["packages/react-hotkeys/skills/react-hotkeys/SKILL.md"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "updated", + "reason": "Hotkey string types now reject Shift with a symbol, and the recorder never records one. The guides were updated to match; hotkeys-core SKILL.md and app-hotkeys references/recording.md carry the same rules.", + "evidence": [ + "packages/hotkeys/skills/hotkeys-core/SKILL.md", + "packages/hotkeys/skills/app-hotkeys/references/recording.md" + ] }, "source:docs/framework/solid/guides/keyboard-layouts.md": { - "fingerprint": "4f41d201f19bcdcd083dbe681b47e91895f99c965e8608723aea88789b9122d6", + "fingerprint": "8ead5158a39b03f7225a60226fdff74f4f29437ac12ce46c9ec6d2cc040440d8", "snapshot": { - "docs/framework/solid/guides/keyboard-layouts.md": "bf909bc1b5e8cb387fe67427096ffbd3041d8812ed352568f4f7f36c3eafafda" + "docs/framework/solid/guides/keyboard-layouts.md": "275013fa4e33a257720897d003f16611f0d6f77dc3657efbfff71885e7c1cc22" }, - "head": "cd1c66aab538ccac294e72ee36ae4466fa9b2d2b", - "outcome": "no-change", - "reason": "Guide change for formatForAria, suspendCharacterKeys, the Accessibility guide, or list wording. The skill reflects the API changes.", - "evidence": ["packages/solid-hotkeys/skills/solid-hotkeys/SKILL.md"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "updated", + "reason": "Hotkey string types now reject Shift with a symbol, and the recorder never records one. The guides were updated to match; hotkeys-core SKILL.md and app-hotkeys references/recording.md carry the same rules.", + "evidence": [ + "packages/hotkeys/skills/hotkeys-core/SKILL.md", + "packages/hotkeys/skills/app-hotkeys/references/recording.md" + ] }, "source:docs/framework/svelte/guides/keyboard-layouts.md": { - "fingerprint": "48a08a69cfdea5e06487545141b5bf2a03144741702c50e59bc7c40b777962f8", + "fingerprint": "162af4b04e8b8fabf65351202f75193c0077b7c94441e6a117e6e1d563a768d8", "snapshot": { - "docs/framework/svelte/guides/keyboard-layouts.md": "0cf8a94700b04b4c6b3369519963f46f347e191ca24dac728ee5fc1cc0537c04" + "docs/framework/svelte/guides/keyboard-layouts.md": "1836c385a7d17c8fedd324da2be2cae7fa058d6d1b445f4d90308aa526cf0160" }, - "head": "cd1c66aab538ccac294e72ee36ae4466fa9b2d2b", - "outcome": "no-change", - "reason": "Guide change for formatForAria, suspendCharacterKeys, the Accessibility guide, or list wording. The skill reflects the API changes.", - "evidence": ["packages/svelte-hotkeys/skills/svelte-hotkeys/SKILL.md"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "updated", + "reason": "Hotkey string types now reject Shift with a symbol, and the recorder never records one. The guides were updated to match; hotkeys-core SKILL.md and app-hotkeys references/recording.md carry the same rules.", + "evidence": [ + "packages/hotkeys/skills/hotkeys-core/SKILL.md", + "packages/hotkeys/skills/app-hotkeys/references/recording.md" + ] }, "source:docs/framework/vue/guides/keyboard-layouts.md": { - "fingerprint": "e917922a37d5fc81c564771524c46982449136cea7150e78e06eb487b8c677fd", + "fingerprint": "35d471fd2ce19abb0441c44d2c9dc425815d23d277d59c74d33e1944eadf80d7", "snapshot": { - "docs/framework/vue/guides/keyboard-layouts.md": "7fec196c6ed029509dfbd1916b5b42948180a4c7214511a8907e7de66dacfa3e" + "docs/framework/vue/guides/keyboard-layouts.md": "e9550d74eaee42b743e906ce89d95d590d56b8cafc6cbcdbf52b14c595c9eb43" }, - "head": "cd1c66aab538ccac294e72ee36ae4466fa9b2d2b", - "outcome": "no-change", - "reason": "Guide change for formatForAria, suspendCharacterKeys, the Accessibility guide, or list wording. The skill reflects the API changes.", - "evidence": ["packages/vue-hotkeys/skills/vue-hotkeys/SKILL.md"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "updated", + "reason": "Hotkey string types now reject Shift with a symbol, and the recorder never records one. The guides were updated to match; hotkeys-core SKILL.md and app-hotkeys references/recording.md carry the same rules.", + "evidence": [ + "packages/hotkeys/skills/hotkeys-core/SKILL.md", + "packages/hotkeys/skills/app-hotkeys/references/recording.md" + ] }, "source:docs/reference/type-aliases/AustrianKeys.md": { "fingerprint": "27b4af312d84c395f3b407576e87b723e52185b5e0d52ea54174b9059271a0fd", @@ -21939,13 +21964,13 @@ "evidence": ["No skill references this file"] }, "source:docs/reference/type-aliases/LayoutKey.md": { - "fingerprint": "f254479a69652444b30fa289da7f15ab66e56515e53b20840e0ae2783ff00ab7", + "fingerprint": "073799adefb1cf475cb36c01a0a3a1a667ccc7d7779a56c8bd768d00bc485853", "snapshot": { - "docs/reference/type-aliases/LayoutKey.md": "fe50078d0f33ac84ac2aa159526268a2ae3a7038e5b4c5a82b6068603b28fa06" + "docs/reference/type-aliases/LayoutKey.md": "7dc2b60a0c72aed54d36e992728d8ceb4ab4378d939ff88ab2a7343033571da9" }, - "head": "a7c7ddcf89fac99790eb60372fc440fcc34f1b07", + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", "outcome": "out-of-scope", - "reason": "Generated reference docs, examples, tests, sidebar config, lockfile, or package/tsconfig wiring for the layout key types; no skill guidance depends on them.", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", "evidence": ["No skill references this file"] }, "source:docs/reference/type-aliases/LithuanianKeys.md": { @@ -22099,13 +22124,13 @@ "evidence": ["No skill references this file"] }, "source:docs/reference/type-aliases/UsKeys.md": { - "fingerprint": "283b05a661d34f9871f9ed798b9d563204481d3d26b6bca72830b0bb36cbc8f1", + "fingerprint": "f664559f95ee17ce837bdc772f24169d885c19e8bb36de063f0cb7c13a5b93e3", "snapshot": { - "docs/reference/type-aliases/UsKeys.md": "44fd6a29e51534f96bcde99094fcaefe37fc1c538c327c222a81a90b906d0466" + "docs/reference/type-aliases/UsKeys.md": "fa20b11c0f02d7a3ad04acb725af9afd1b0860b4b5e0b929159b557bc09b1316" }, - "head": "a7c7ddcf89fac99790eb60372fc440fcc34f1b07", + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", "outcome": "out-of-scope", - "reason": "Generated reference docs, examples, tests, sidebar config, lockfile, or package/tsconfig wiring for the layout key types; no skill guidance depends on them.", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", "evidence": ["No skill references this file"] }, "source:examples/alpine/keyboard-layouts/index.html": { @@ -23033,15 +23058,16 @@ ] }, "source:packages/hotkeys/src/key-sets/us.ts": { - "fingerprint": "677e35bc30aee1963348074ad2248cfe3beb844d4d7bbf0a95acdeab7da177ce", + "fingerprint": "26ad8fda5659a4d5d4d00a28a4654f7c1e9e3bbb111fac89d7871b69a464e42f", "snapshot": { - "packages/hotkeys/src/key-sets/us.ts": "3eab0f8acef0961d62fccaea30c47243986eb725b31530d8bb861792b2b3ab82" + "packages/hotkeys/src/key-sets/us.ts": "2df79f8bd3bede594a7bc0563a846a982b3dcdd5708030bb85d5c636582644b3" }, - "head": "a7c7ddcf89fac99790eb60372fc440fcc34f1b07", + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", "outcome": "updated", - "reason": "Layout key types through Register.keys; the core skill now covers registering layouts and when to prefer US bindings.", + "reason": "Hotkey string types now reject Shift with a symbol, and the recorder never records one. PunctuationKey and NonPunctuationKey are renamed SymbolKey and NonSymbolKey; no skill names them. hotkeys-core SKILL.md covers the Shift rule.", "evidence": [ - "packages/hotkeys/skills/hotkeys-core/SKILL.md: pitfall \"Keys of other layouts need a registration\"" + "packages/hotkeys/skills/hotkeys-core/SKILL.md", + "git grep PunctuationKey packages/*/skills finds nothing" ] }, "source:packages/hotkeys/src/register.ts": { @@ -23057,23 +23083,23 @@ ] }, "source:packages/hotkeys/tests/key-sets.test.ts": { - "fingerprint": "a4ae661ea42dec68969db198ef5b16255926f239bcadd0faa0c797f92905dc76", + "fingerprint": "c1e15ea120ab6a6460c16b85d0052ad1bf0243aae93ff08f100e99ebd36817e4", "snapshot": { - "packages/hotkeys/tests/key-sets.test.ts": "870e4a027ca015d1e13246b048a49362a1e58016333e0264c519706cbb188919" + "packages/hotkeys/tests/key-sets.test.ts": "ba57fd141874a4fb40ec662629ea46a450f7cc1795b7e58984e149398a5b647d" }, - "head": "a7c7ddcf89fac99790eb60372fc440fcc34f1b07", + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", "outcome": "out-of-scope", - "reason": "Generated reference docs, examples, tests, sidebar config, lockfile, or package/tsconfig wiring for the layout key types; no skill guidance depends on them.", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", "evidence": ["No skill references this file"] }, "source:packages/hotkeys/tests/register-keys/register-keys.test-d.ts": { - "fingerprint": "7f1e7dd8b7e74642003106e38b8da1146fa177272451778318098dd8419f4a76", + "fingerprint": "99d420bf4d229d1a461c076f9351f79cb4d87611559cfdeec734d078097c11b2", "snapshot": { - "packages/hotkeys/tests/register-keys/register-keys.test-d.ts": "dd8f162306afdd3f6de30a1b5fd430bdfc90eb16fdec50d85a1f10d6878d870b" + "packages/hotkeys/tests/register-keys/register-keys.test-d.ts": "6ac3ec655f9cfcf499f5bf87890beb025e4434355682c129dbbb074c1093f33b" }, - "head": "a7c7ddcf89fac99790eb60372fc440fcc34f1b07", + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", "outcome": "out-of-scope", - "reason": "Generated reference docs, examples, tests, sidebar config, lockfile, or package/tsconfig wiring for the layout key types; no skill guidance depends on them.", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", "evidence": ["No skill references this file"] }, "source:packages/hotkeys/tests/register-keys/tsconfig.json": { @@ -23856,14 +23882,14 @@ ] }, "source:packages/hotkeys/tests/invariants/recorder-layouts.test.ts": { - "fingerprint": "2c0722586f2b3d99f639c25d1c513d30dddb3bc71bcd8e4c3eb32898285fbb04", + "fingerprint": "5bf3a52a89c398371f688aafe8f5e62fdf466ee2c7ccc416e4b2c77dfb465349", "snapshot": { - "packages/hotkeys/tests/invariants/recorder-layouts.test.ts": "153c95723680c741ea1013132c38ae1dc36cd1c123ffd38474d6c574621e8958" + "packages/hotkeys/tests/invariants/recorder-layouts.test.ts": "993e07471d7e5e7e51a6fc55ddbc86f92a95d313700be13e3ba7c0ec0cf50fc9" }, - "head": "f9fc17f0bbb537e70119ec81cec5d3d94294aa8e", - "outcome": "no-change", - "reason": "Covered by the key lock state rows added to each adapter skill and the core testing reference; no further guidance change", - "evidence": ["packages/hotkeys/tests/invariants/recorder-layouts.test.ts"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:.github/workflows/ember-compat.yml": { "fingerprint": "7040151f08770516a0f3c8197afb249d719c90ca0e45bcb8b0dcb736be8e73cf", @@ -24317,24 +24343,24 @@ ] }, "source:docs/reference/functions/formatForAria.md": { - "fingerprint": "ff7be307254f159234fdd8bb1a4f73bf122697e3d09d5e766c5eb339b1c12fa5", + "fingerprint": "fd345f7c4e2b76a69fc106426275316d599971e9993ac387521a8ec9aadab942", "snapshot": { - "docs/reference/functions/formatForAria.md": "f35ba0801e7ed2f69e418385ae9a774c65936796d2d08539d64ff23d46ff8c55" + "docs/reference/functions/formatForAria.md": "a6b4b436b672dbf8750ff3f9081053ee5a1eff8e30a545229761f9f656d1fbe4" }, - "head": "cd1c66aab538ccac294e72ee36ae4466fa9b2d2b", - "outcome": "no-change", - "reason": "Regenerated reference page. The skills cover the formatForAria, createFormatter, and suspendCharacterKeys API changes.", - "evidence": ["packages/hotkeys/skills/hotkeys-core/SKILL.md"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:docs/reference/interfaces/FormatAriaOptions.md": { - "fingerprint": "61fb1fa90e0f9ccd6d7f0d162268fe50097cda11e3d4a49a986ae0a6fca948b6", + "fingerprint": "c3b3c65c28688bf1a83e3c4667879fd277336d3f8d8f2236a31dd09bacc84f83", "snapshot": { - "docs/reference/interfaces/FormatAriaOptions.md": "764a2dce82318ea09f14f97db9be125ca1ffc2f821c74731c85d817afeb997f2" + "docs/reference/interfaces/FormatAriaOptions.md": "4fc0b69370716c0583e5a573727c9ae240edccc584ab6a6696ff469f62e3be49" }, - "head": "cd1c66aab538ccac294e72ee36ae4466fa9b2d2b", - "outcome": "no-change", - "reason": "Regenerated reference page. The skills cover the formatForAria, createFormatter, and suspendCharacterKeys API changes.", - "evidence": ["packages/hotkeys/skills/hotkeys-core/SKILL.md"] + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:packages/alpine-hotkeys/src/createFormatForAria.ts": { "fingerprint": "02504c990852362497132cd38a14f89dc5609131308d67e3115193bcb99741c1", @@ -24437,14 +24463,14 @@ "evidence": ["packages/hotkeys/tests/character-keys.test.ts"] }, "source:packages/hotkeys/tests/format-aria.test.ts": { - "fingerprint": "936683399d967688a30fe507bc842c3b904dc06263c0ee2d04ac11efa80961af", + "fingerprint": "2b3415781178ddd8003ac74465df3e8c32ec68af3df6432052f4c7cd3f6a6330", "snapshot": { - "packages/hotkeys/tests/format-aria.test.ts": "28764fdd66d041f8d423bba3f8b43e0d1bb238c38b9fe5e1fb8b288a605aef67" + "packages/hotkeys/tests/format-aria.test.ts": "54b433ba142bebbc4310248eeec82db1a618622d3362318e49bb7e101333448b" }, - "head": "cd1c66aab538ccac294e72ee36ae4466fa9b2d2b", + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", "outcome": "out-of-scope", - "reason": "Test change; it describes no library behavior the guidance covers.", - "evidence": ["packages/hotkeys/tests/format-aria.test.ts"] + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] }, "source:packages/lit-hotkeys/src/controllers/_formatter-layout.ts": { "fingerprint": "4616ce6fbdf571f407f289cbcaae2a7f559c5c86242b1e7a7df23492ccc97ff7", @@ -26018,6 +26044,180 @@ "evidence": [ "Changed: packages/hotkeys/tests/app-hotkeys-editor-latency.test.ts at 797b66878a61cc10483f987bc94e207d13fa5667" ] + }, + "source:docs/framework/react/guides/choosing-hotkeys.md": { + "fingerprint": "90bc2b2f4961f0904ec0c7ae3ef6b6777dc07a2f0af789f0555d3c752de2bd1f", + "snapshot": { + "docs/framework/react/guides/choosing-hotkeys.md": "73913a3293be61f786963d14d0248d2cdebf21f20f029421588aedbe10cd05bd" + }, + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "updated", + "reason": "Hotkey string types now reject Shift with a symbol, and the recorder never records one. The guides were updated to match; hotkeys-core SKILL.md and app-hotkeys references/recording.md carry the same rules.", + "evidence": [ + "packages/hotkeys/skills/hotkeys-core/SKILL.md", + "packages/hotkeys/skills/app-hotkeys/references/recording.md" + ] + }, + "source:docs/reference/type-aliases/NonSymbolKey.md": { + "fingerprint": "5960c5b15f03b52ae2dc5056ef40af08b6725917399075c110005d4811213ccd", + "snapshot": { + "docs/reference/type-aliases/NonSymbolKey.md": "aff0193e4504491b37f520b96cb2d3dbdf1052b61173eea4d31cf5abad875cf0" + }, + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] + }, + "source:docs/reference/type-aliases/ShiftableKey.md": { + "fingerprint": "473b09b57a6cc066a48143306268d7d0f41b9b889bbab736129bf363219e1ba4", + "snapshot": { + "docs/reference/type-aliases/ShiftableKey.md": "729287e0a71c176af6bd2cb0ec45e2552d3b280dbe790bac7cae372f7d009d29" + }, + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] + }, + "source:docs/reference/type-aliases/SymbolKey.md": { + "fingerprint": "bb5220bdab3b9715cc6d7ffcf48e5d458fda7e5f45872e444603ce46e68d1d3a", + "snapshot": { + "docs/reference/type-aliases/SymbolKey.md": "965e989f1f97aa03cafa6fcf1b9a11f23ffe1fad9213c76f22cec4a858c69c71" + }, + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] + }, + "source:packages/hotkeys/tests/shift-chord-types.test.ts": { + "fingerprint": "be25ec8d4d5b9ee83a0a7117c0ee686849c3ca7b54e30d9d5212a74549a6f0cc", + "snapshot": { + "packages/hotkeys/tests/shift-chord-types.test.ts": "11b1c27913375aa51efa79d975484d9218d8d271da916690b3ea0a9c89f98d47" + }, + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "out-of-scope", + "reason": "Generated reference docs, sidebar config, unit tests, or e2e specs for the Shift-with-symbol type rule, the SymbolKey rename, the recorder change, and formatForDisplay(\"Mod\"); no skill guidance depends on them.", + "evidence": ["No skill references this file"] + }, + "source:docs/framework/react/guides/choosing-valid-hotkeys.md": { + "fingerprint": "7170a98a183e696eff5e691a02b9049e9715201a4e704cdb98fb3c20e455f6f3", + "snapshot": { + "docs/framework/react/guides/choosing-valid-hotkeys.md": "071a0d22da58946aa04061d1b9b4451ac90d11119f1f1d4b3d6e2f65b234c209" + }, + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "updated", + "reason": "The React guide on choosing valid hotkeys, renamed from choosing-hotkeys and rewritten to explain the Shift-with-symbol type rule. hotkeys-core SKILL.md and app-hotkeys references/recording.md carry the same rules.", + "evidence": [ + "packages/hotkeys/skills/hotkeys-core/SKILL.md", + "packages/hotkeys/skills/app-hotkeys/references/recording.md" + ] + }, + "source:docs/framework/alpine/guides/choosing-valid-hotkeys.md": { + "fingerprint": "ce83afe2868cbfe7655616e4bbdb87c0dc7839520cbe6d531e3fff8833ad7c9c", + "snapshot": { + "docs/framework/alpine/guides/choosing-valid-hotkeys.md": "b71fc5ec091e9573fae3850b513b0fc4331860469de05bc31d4542da1e172c04" + }, + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "no-change", + "reason": "Framework port of the React Choosing Valid Hotkeys guide. It documents the Shift-with-a-symbol type rule and recorder behavior that the skills already cover.", + "evidence": [ + "packages/hotkeys/skills/hotkeys-core/SKILL.md and packages/hotkeys/skills/app-hotkeys/references/recording.md already state the rule; the guide adds framework-specific code samples only." + ] + }, + "source:docs/framework/angular/guides/choosing-valid-hotkeys.md": { + "fingerprint": "a8e5d987d6d93d8a92034fe0f5a53fd7697d95cf42dfbf47035fef32b6aa4987", + "snapshot": { + "docs/framework/angular/guides/choosing-valid-hotkeys.md": "dc89310b1090fd220eb39bf0995e38850530214d3d0ddecdb12ae9c45a0eabee" + }, + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "no-change", + "reason": "Framework port of the React Choosing Valid Hotkeys guide. It documents the Shift-with-a-symbol type rule and recorder behavior that the skills already cover.", + "evidence": [ + "packages/hotkeys/skills/hotkeys-core/SKILL.md and packages/hotkeys/skills/app-hotkeys/references/recording.md already state the rule; the guide adds framework-specific code samples only." + ] + }, + "source:docs/framework/ember/guides/choosing-valid-hotkeys.md": { + "fingerprint": "1bf4210d61079392e70b385f9eb62628d58b8cc16b70a67b6a7dcac53f717c92", + "snapshot": { + "docs/framework/ember/guides/choosing-valid-hotkeys.md": "837ecb74c730ba8907e97fade0b4345593f19d91cf3e4255c7c3681d490be2ff" + }, + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "no-change", + "reason": "Framework port of the React Choosing Valid Hotkeys guide. It documents the Shift-with-a-symbol type rule and recorder behavior that the skills already cover.", + "evidence": [ + "packages/hotkeys/skills/hotkeys-core/SKILL.md and packages/hotkeys/skills/app-hotkeys/references/recording.md already state the rule; the guide adds framework-specific code samples only." + ] + }, + "source:docs/framework/lit/guides/choosing-valid-hotkeys.md": { + "fingerprint": "48937eba602048cc1813c15a84694ff2356a2676287796a534bf791a33bd52c3", + "snapshot": { + "docs/framework/lit/guides/choosing-valid-hotkeys.md": "315c370b0dc8df45e0be718ac1be9c2fe2f1a9caa351d972ec0fa7aaba91551b" + }, + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "no-change", + "reason": "Framework port of the React Choosing Valid Hotkeys guide. It documents the Shift-with-a-symbol type rule and recorder behavior that the skills already cover.", + "evidence": [ + "packages/hotkeys/skills/hotkeys-core/SKILL.md and packages/hotkeys/skills/app-hotkeys/references/recording.md already state the rule; the guide adds framework-specific code samples only." + ] + }, + "source:docs/framework/octane/guides/choosing-valid-hotkeys.md": { + "fingerprint": "99ac5eca8f982bf1149457a33013feb4a953921e4cfae0f08c56e01bb583ab0d", + "snapshot": { + "docs/framework/octane/guides/choosing-valid-hotkeys.md": "db51a7e49f4eb5dd183cc074456df1e7da4ca99dbc1dc008708b26ff7fd0a229" + }, + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "no-change", + "reason": "Framework port of the React Choosing Valid Hotkeys guide. It documents the Shift-with-a-symbol type rule and recorder behavior that the skills already cover.", + "evidence": [ + "packages/hotkeys/skills/hotkeys-core/SKILL.md and packages/hotkeys/skills/app-hotkeys/references/recording.md already state the rule; the guide adds framework-specific code samples only." + ] + }, + "source:docs/framework/preact/guides/choosing-valid-hotkeys.md": { + "fingerprint": "9b52e974a116daded447fa7fc2e4efce18ddeaf045148d4f2df7ed5281a9b96f", + "snapshot": { + "docs/framework/preact/guides/choosing-valid-hotkeys.md": "1a4728c9d4d52cbb12e4c03e3ad40264cc845c8aa27496c352f7741c0e60b212" + }, + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "no-change", + "reason": "Framework port of the React Choosing Valid Hotkeys guide. It documents the Shift-with-a-symbol type rule and recorder behavior that the skills already cover.", + "evidence": [ + "packages/hotkeys/skills/hotkeys-core/SKILL.md and packages/hotkeys/skills/app-hotkeys/references/recording.md already state the rule; the guide adds framework-specific code samples only." + ] + }, + "source:docs/framework/solid/guides/choosing-valid-hotkeys.md": { + "fingerprint": "1884f8f407a1f87d534c9a04955319013b7ddf9896394b963e48a1cecc3466d6", + "snapshot": { + "docs/framework/solid/guides/choosing-valid-hotkeys.md": "c6fce55d128a16543a22fa01bd43de10784e098d8e01bb8443c3169ba421af2b" + }, + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "no-change", + "reason": "Framework port of the React Choosing Valid Hotkeys guide. It documents the Shift-with-a-symbol type rule and recorder behavior that the skills already cover.", + "evidence": [ + "packages/hotkeys/skills/hotkeys-core/SKILL.md and packages/hotkeys/skills/app-hotkeys/references/recording.md already state the rule; the guide adds framework-specific code samples only." + ] + }, + "source:docs/framework/svelte/guides/choosing-valid-hotkeys.md": { + "fingerprint": "4891df45b7a15d36982702dc8a29f22566a895d3c588f369c1dae96bdc1097d7", + "snapshot": { + "docs/framework/svelte/guides/choosing-valid-hotkeys.md": "533b601f1cc56c7e7b6c5cc9a970c2babfdebcfc7981424b253f96468badb9d4" + }, + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "no-change", + "reason": "Framework port of the React Choosing Valid Hotkeys guide. It documents the Shift-with-a-symbol type rule and recorder behavior that the skills already cover.", + "evidence": [ + "packages/hotkeys/skills/hotkeys-core/SKILL.md and packages/hotkeys/skills/app-hotkeys/references/recording.md already state the rule; the guide adds framework-specific code samples only." + ] + }, + "source:docs/framework/vue/guides/choosing-valid-hotkeys.md": { + "fingerprint": "703076c058ab2070c4fea82b5edc632302aa005afeee72b22a2ee76670b36a93", + "snapshot": { + "docs/framework/vue/guides/choosing-valid-hotkeys.md": "ac7237fb9f8298d267dbd29ef34bd0307e85f582f2c08fb1eb00ad0314003a2c" + }, + "head": "f026c8ab12658715ab51ace277262ea6e38eddc2", + "outcome": "no-change", + "reason": "Framework port of the React Choosing Valid Hotkeys guide. It documents the Shift-with-a-symbol type rule and recorder behavior that the skills already cover.", + "evidence": [ + "packages/hotkeys/skills/hotkeys-core/SKILL.md and packages/hotkeys/skills/app-hotkeys/references/recording.md already state the rule; the guide adds framework-specific code samples only." + ] } } } diff --git a/_artifacts/domain_map.yaml b/_artifacts/domain_map.yaml index 6f4c1d4ce..144105560 100644 --- a/_artifacts/domain_map.yaml +++ b/_artifacts/domain_map.yaml @@ -156,10 +156,10 @@ skills: source: docs/guides/sensible-defaults.md#modifiers-must-match-exactly; probe on 2026-10-18 priority: MEDIUM status: active - - mistake: Binding a shifted symbol with Mod - mechanism: With Command held, macOS browsers report the unshifted character, so Cmd+Shift+/ arrives as `/` with Shift. Mod+? never matches it, and Mod+/ does not fire for it either. - wrong_pattern: register('Mod+?', showHelp); register('Mod+=', zoomIn) - correct_pattern: register('Mod+Shift+/', showHelp); register('Mod+=', zoomIn); register('Mod+Shift+=', zoomIn) + - mistake: Writing Shift with a symbol + mechanism: Shift and a symbol name different keys on different layouts, so the types reject them. German Shift+7 types `/` and fires `Shift+/`. Write the symbol Shift types. With Command held, macOS reports another character for some keys, so a Mod chord on a shifted symbol fires on keys in their US position but not on every Mac layout; use a letter, a digit, or a physical code for shortcuts that must work everywhere. + wrong_pattern: register('Shift+/', showHelp); register('Mod+Shift+/', showHelp); register('Mod+Shift+=', zoomIn) + correct_pattern: register('?', showHelp); register('Mod+?', showHelp); register('Mod+=', zoomIn); register('Mod++', zoomIn) source: docs/guides/sensible-defaults.md#keys-match-the-character-the-user-types; src/_match.ts priority: MEDIUM status: active diff --git a/docs/config.json b/docs/config.json index 21c3b7793..5762b31e0 100644 --- a/docs/config.json +++ b/docs/config.json @@ -142,13 +142,17 @@ "label": "Sequences", "to": "framework/react/guides/sequences" }, + { + "label": "HotkeysProvider & Scopes", + "to": "framework/react/guides/hotkeys-provider-and-scopes" + }, { "label": "Sensible Defaults", "to": "guides/sensible-defaults" }, { - "label": "HotkeysProvider & Scopes", - "to": "framework/react/guides/hotkeys-provider-and-scopes" + "label": "Choosing Valid Hotkeys", + "to": "framework/react/guides/choosing-valid-hotkeys" } ] }, @@ -163,13 +167,17 @@ "label": "Sequences", "to": "framework/preact/guides/sequences" }, + { + "label": "HotkeysProvider & Scopes", + "to": "framework/preact/guides/hotkeys-provider-and-scopes" + }, { "label": "Sensible Defaults", "to": "guides/sensible-defaults" }, { - "label": "HotkeysProvider & Scopes", - "to": "framework/preact/guides/hotkeys-provider-and-scopes" + "label": "Choosing Valid Hotkeys", + "to": "framework/preact/guides/choosing-valid-hotkeys" } ] }, @@ -184,13 +192,17 @@ "label": "Sequences", "to": "framework/solid/guides/sequences" }, + { + "label": "HotkeysProvider & Scopes", + "to": "framework/solid/guides/hotkeys-provider-and-scopes" + }, { "label": "Sensible Defaults", "to": "guides/sensible-defaults" }, { - "label": "HotkeysProvider & Scopes", - "to": "framework/solid/guides/hotkeys-provider-and-scopes" + "label": "Choosing Valid Hotkeys", + "to": "framework/solid/guides/choosing-valid-hotkeys" } ] }, @@ -205,13 +217,17 @@ "label": "Sequences", "to": "framework/angular/guides/sequences" }, + { + "label": "provideHotkeys & Scopes", + "to": "framework/angular/guides/provide-hotkeys-and-scopes" + }, { "label": "Sensible Defaults", "to": "guides/sensible-defaults" }, { - "label": "provideHotkeys & Scopes", - "to": "framework/angular/guides/provide-hotkeys-and-scopes" + "label": "Choosing Valid Hotkeys", + "to": "framework/angular/guides/choosing-valid-hotkeys" } ] }, @@ -226,13 +242,17 @@ "label": "Sequences", "to": "framework/vue/guides/sequences" }, + { + "label": "HotkeysProvider & Scopes", + "to": "framework/vue/guides/hotkeys-provider-and-scopes" + }, { "label": "Sensible Defaults", "to": "guides/sensible-defaults" }, { - "label": "HotkeysProvider & Scopes", - "to": "framework/vue/guides/hotkeys-provider-and-scopes" + "label": "Choosing Valid Hotkeys", + "to": "framework/vue/guides/choosing-valid-hotkeys" } ] }, @@ -250,6 +270,10 @@ { "label": "Sensible Defaults", "to": "guides/sensible-defaults" + }, + { + "label": "Choosing Valid Hotkeys", + "to": "framework/lit/guides/choosing-valid-hotkeys" } ] }, @@ -264,13 +288,17 @@ "label": "Sequences", "to": "framework/svelte/guides/sequences" }, + { + "label": "HotkeysProvider & Scopes", + "to": "framework/svelte/guides/hotkeys-provider-and-scopes" + }, { "label": "Sensible Defaults", "to": "guides/sensible-defaults" }, { - "label": "HotkeysProvider & Scopes", - "to": "framework/svelte/guides/hotkeys-provider-and-scopes" + "label": "Choosing Valid Hotkeys", + "to": "framework/svelte/guides/choosing-valid-hotkeys" } ] }, @@ -288,6 +316,10 @@ { "label": "Sensible Defaults", "to": "guides/sensible-defaults" + }, + { + "label": "Choosing Valid Hotkeys", + "to": "framework/alpine/guides/choosing-valid-hotkeys" } ] }, @@ -305,6 +337,10 @@ { "label": "Sensible Defaults", "to": "guides/sensible-defaults" + }, + { + "label": "Choosing Valid Hotkeys", + "to": "framework/ember/guides/choosing-valid-hotkeys" } ] }, @@ -319,13 +355,17 @@ "label": "Sequences", "to": "framework/octane/guides/sequences" }, + { + "label": "HotkeysProvider & Scopes", + "to": "framework/octane/guides/hotkeys-provider-and-scopes" + }, { "label": "Sensible Defaults", "to": "guides/sensible-defaults" }, { - "label": "HotkeysProvider & Scopes", - "to": "framework/octane/guides/hotkeys-provider-and-scopes" + "label": "Choosing Valid Hotkeys", + "to": "framework/octane/guides/choosing-valid-hotkeys" } ] } diff --git a/docs/framework/alpine/guides/choosing-valid-hotkeys.md b/docs/framework/alpine/guides/choosing-valid-hotkeys.md new file mode 100644 index 000000000..8c43301a8 --- /dev/null +++ b/docs/framework/alpine/guides/choosing-valid-hotkeys.md @@ -0,0 +1,229 @@ +--- +title: Choosing Valid Hotkeys in Alpine +id: choosing-valid-hotkeys +description: Why TanStack Hotkeys rejects some hotkey strings, such as Shift+/, what to write instead, and which shortcuts the browser or operating system takes before your Alpine app sees them. +--- + +You write a hotkey on your keyboard, and your users press it on theirs. Their keyboard can have another layout, another operating system, and another browser, and each of those can change what a key press means. A shortcut that works on your machine can fire on the wrong key for a German user, or never fire for someone on a Mac. + +TanStack Hotkeys absorbs most of these differences at runtime. A few it can't, because the hotkey string itself means more than one thing. For those, the types reject the string while you write it, so you find out in your editor and not from a bug report. This guide explains why those strings are rejected and what to write instead. It also covers the shortcuts no string can fix, because the browser or the operating system handles them before your app does. + +## Why `Shift+/` is a type error + +Say you want `?` to open a help dialog. On a US keyboard you type `?` with Shift and the `/` key, so you write down what you press: + +```ts +this.hotkeys.createHotkey('Shift+/', openHelp) // Type error +``` + +TypeScript rejects it. That can feel strict, since the string looks reasonable and would work on your keyboard. The problem shows up on other keyboards. + +A hotkey string names characters, and layouts put `/` and `?` on different keys. On a German keyboard, `/` is Shift+7 and `?` is Shift+ß. There, `Shift+/` can be read two ways: + +- You meant `?`, the character that US Shift+/ types. The library reads it that way, so German Shift+ß fires it. +- The string also says "Shift and `/`", and German Shift+7 is exactly that. So a German user who types a plain `/` fires it too. + +If your app binds `/` to search as well, that German user gets your help dialog instead of search, because an exact Shift match ranks above `/`. The library can't tell which reading you meant. Only you know that, so the types ask you to say it. + +When you mean the character, write the character: + +```ts +import Alpine from 'alpinejs' +import { createHotkeysScope } from '@tanstack/alpine-hotkeys' + +Alpine.data('help', () => ({ + hotkeys: createHotkeysScope(), + init() { + // Fires on whatever key types `?` on the user's layout + this.hotkeys.createHotkey('?', () => openHelp()) + }, + destroy() { + this.hotkeys.destroy() + }, +})) +``` + +`?` means the same thing on every layout. It fires on Shift+/ on a US keyboard and on Shift+ß on a German one, and the matcher takes care of the Shift the user needs to type it. + +When you mean the key's position, name the physical key. `Shift+[Slash]` is Shift with the key that US keyboards label `/`, whatever that key types on the user's layout. + +### Why letters and digits keep Shift + +Shift changes a letter's case, not which letter it is. `Shift+K` names the same key on every layout, so the types allow it. The Shift matters there too: `K` and `Shift+K` are two different shortcuts. + +Digits are safe for another reason. The matcher reads the digit row by position, so `Shift+1` fires on the key that types `1` on every layout. That includes French AZERTY, where the key types `&` without Shift. + +A symbol gets neither guarantee. Which symbol Shift adds to a key is up to the layout. + +### What can follow Shift + +After `Shift`, with or without other modifiers, a hotkey string takes a letter, a digit, a named key such as `Tab`, or a physical code such as `[Slash]`. A symbol after Shift is a type error: + +```ts +this.hotkeys.createHotkey('Shift+/', openHelp) // Type error +this.hotkeys.createHotkey('?', openHelp) // OK +this.hotkeys.createHotkey('Control+?', openHelp) // OK, fires on Control+Shift+/ on a US keyboard +this.hotkeys.createHotkey('Shift+[Slash]', openHelp) // OK, the physical key +this.hotkeys.createHotkey('Mod+Shift+/', openHelp) // Type error +this.hotkeys.createHotkey('Mod+?', openHelp) // OK +``` + +The same rule covers letters from [registered keyboard layouts](./keyboard-layouts): `Shift+Ä` is allowed, and `Shift+§` is a type error. + +The rule lives only in the types. A string from storage or user settings, such as a saved `'Shift+/'`, still matches as it did before, so shortcuts your users already saved keep working. + +TypeScript checks only the hotkeys in your TypeScript files. Alpine evaluates `x-init` and other attributes at runtime, so a hotkey written in markup, such as `$hotkeys.createHotkey('Shift+/', ...)`, gets no type error. + +## Mod with a symbol doesn't reach every Mac + +`Mod+?` is how you write Control+Shift+/ on Windows and Command+Shift+/ on macOS. On Windows and Linux it fires on every layout. macOS is less predictable. + +With Command held, macOS reports a different character for some keys than the one they type. Command+Shift on the key that types `?` reports `/` on German and Dvorak, `'` on Spanish, and `+` on Swedish. So `Mod+?` doesn't fire on those Mac layouts, while it does on US, UK, French, and Italian Macs. + +No symbol spelling covers that press on every Mac layout. When a shortcut has to work for everyone, such as the one that opens your command palette, give it a letter or a digit, such as `Mod+Shift+K` or `Mod+Shift+1`. To bind a key by position, use its physical code, such as `Mod+Shift+[Slash]`. + +[Keys match the character the user types](../../../guides/sensible-defaults.md#keys-match-the-character-the-user-types) has the details of how Command changes the reported key. + +## Replace a Shift string you already wrote + +When existing code has `Shift+` with a symbol, the right replacement depends on the keyboard it was written on, because whoever wrote it wrote what their keyboard typed. `Shift+,` types `<` on a US keyboard, `;` on a German one, and `?` on a French one. Find the string in the first column, then take the replacement from the column for the layout it was written on: + +| Ambiguous | US QWERTY | German | French AZERTY | +| --- | --- | --- | --- | +| `` Shift+` `` | `~` | `` ` `` | `` ` `` | +| `Shift+-` | `_` | `_` | `6` | +| `Shift+=` | `+` | `=` | `+` | +| `Shift+[` | `{` | `[` | `[` | +| `Shift+]` | `}` | `]` | `]` | +| `Shift+\` | `\|` | `\` | `\` | +| `Shift+;` | `:` | `;` | `.` | +| `Shift+'` | `"` | `'` | `4` | +| `Shift+,` | `<` | `;` | `?` | +| `Shift+.` | `>` | `:` | `.` | +| `Shift+/` | `?` | `/` | `/` | +| `Shift+_` | `_` | `_` | `8` | +| `Shift++` | `+` | `*` | `+` | +| `Shift+:` | `:` | `:` | `/` | +| `Shift+"` | `"` | `"` | `3` | +| `Shift+<` | `<` | `>` | `>` | +| `Shift+!` | `!` | `!` | `§` | +| `Shift+#` | `#` | `'` | `#` | +| `Shift+$` | `$` | `$` | `£` | +| `Shift+&` | `&` | `&` | `1` | +| `Shift+*` | `*` | `*` | `Shift+[Backslash]` | +| `Shift+(` | `(` | `(` | `5` | +| `Shift+)` | `)` | `)` | `°` | + +Each cell is what Shift and that key type on that layout. When the layout has no key that types the symbol without Shift, the replacement is the symbol itself. German `/` is Shift+7, so a German developer who wrote `Shift+/` meant `/`. + +A few more rules for reading the table: + +- The table leaves out strings whose replacement is the same symbol on all three layouts, such as `Shift+?` and `Shift+@`. Write the symbol: `?` or `@`. +- With other modifiers, keep them and use the same replacement. On a US keyboard, `Control+Shift+/` becomes `Control+?`, and `Mod+Shift+/` becomes `Mod+?`. +- French `µ` isn't in `FrenchKeys`, so its cell names the key by position instead. +- The German and French columns use the Windows layouts. The Mac layouts place some symbols differently. + +To keep a key's position instead of its character, use Shift with the key's physical code, such as `Shift+[Slash]`. + +## Physical codes name a key, not a character + +Use a physical code when the key's position matters more than its label, such as keys arranged in a row for a game or a drawing tool. The catch is the label. On other layouts the key types something else, so a hint that shows the US symbol can be wrong for those users. Shift and these codes type: + +| Physical code | US QWERTY | US Dvorak | German | +| --- | --- | --- | --- | +| `Shift+[Backquote]` | `~` | `~` | `°` | +| `Shift+[Minus]` | `_` | `{` | `?` | +| `Shift+[Equal]` | `+` | `}` | a dead key | +| `Shift+[BracketLeft]` | `{` | `?` | `Ü` | +| `Shift+[BracketRight]` | `}` | `+` | `*` | +| `Shift+[Backslash]` | `\|` | `\|` | `'` | +| `Shift+[Semicolon]` | `:` | `S` | `Ö` | +| `Shift+[Quote]` | `"` | `_` | `Ä` | +| `Shift+[Comma]` | `<` | `W` | `;` | +| `Shift+[Period]` | `>` | `V` | `:` | +| `Shift+[Slash]` | `?` | `Z` | `_` | + +When you pass a layout map, [`formatForDisplay`](./formatting-display) labels a physical code with the key's character on the user's layout. On a German keyboard, `Shift+[Slash]` shows as `Shift+-`. Without a layout map, which only Chromium browsers provide, the label is the US character for that position. + +## Some shortcuts belong to the browser or the operating system + +Some chords never reach your page. The browser or the operating system handles them first, so your handler doesn't run, and the user gets the browser's action instead. + +The types still accept these chords, and that's deliberate. The same chord can be free in an installed web app, in fullscreen, or in Electron. The types can't know where your app runs, but you do. + +### Browser tab shortcuts + +In a normal browser tab, these chords open, close, or switch tabs and windows. Chrome reserves them. The Firefox and Safari columns come from their source and bug reports, so treat a blank cell as unconfirmed, not as free: + +| Chord | Action | Chrome | Firefox | Safari | +| --- | --- | --- | --- | --- | +| `Mod+W` | Close tab | Reserved | Reserved | Reported reserved | +| `Mod+T` | New tab | Reserved | Reserved | Reported reserved | +| `Mod+N` | New window | Reserved | Reserved | Reported reserved | +| `Mod+Shift+W` | Close window | Reserved | Reserved | | +| `Mod+Shift+T` | Reopen closed tab | Reserved | | | +| `Mod+Shift+N` | New private window | Reserved | | | +| `Control+Tab`, `Control+Shift+Tab` | Next and previous tab | Reserved | Reported reserved | Reported reserved | +| `Control+PageUp`, `Control+PageDown` | Next and previous tab, Windows and Linux | Reserved | | | +| `Mod+Q` | Quit, macOS | Reserved | Not reserved | Reported reserved | + +Chrome reserves none of these in an installed web app window, and in fullscreen it keeps only the keys that leave fullscreen. If your app runs in a browser tab, pick other chords for its own actions. + +### Operating system shortcuts + +Each operating system keeps a few chords for itself. A chord is lost only on the system that keeps it: + +- **Windows.** Control+Alt+Delete, and most chords with the Windows key (`Meta`), such as Windows+L. +- **macOS.** Command+Tab, Command+Space, and Command+Option+Escape. +- **Linux.** Control+Alt+F1 through F12 switch to another virtual terminal. Desktops such as GNOME also take many chords with the Super key. + +Users can change many of these, so no list is complete. Prefer `Mod`, `Shift`, and `Alt` chords over `Meta` chords, which Windows mostly keeps. + +### Chords that can't fire on some layouts + +A few chords type a character the hotkey doesn't name, so they never fire on some layouts: + +- **Option with a shifted symbol on a US Mac.** Option+Shift+/ types `¿`, not `?`, so `Alt+?` and `Mod+Alt+?` never fire on a US Mac. Use the physical code instead, such as `Alt+Shift+[Slash]`. +- **Control+Alt on layouts with AltGr.** Windows treats Control+Alt as AltGr. On a German keyboard, Control+Alt+Q types `@`, so `Control+Alt+Q` never fires, and an `@` binding does. + +## Let users choose their own shortcuts + +The most reliable shortcut is often the one a user picks on their own keyboard. The [hotkey recorder](./custom-hotkey-recording) follows the rules in this guide for you: + +- It records only presses that reach the page, so in a browser tab it never records the browser and operating system chords above. +- It never writes Shift with a symbol. Shift+/ records `?`, and German Shift+7 records `/`. +- On a Mac with Command held, off the key's US position, the browser may not report the symbol the user typed. There the recorder records the key's physical code: Dvorak Command+Shift+/ records `Mod+Shift+[BracketLeft]`. + +A recorded hotkey can still fail on another machine. `Alt+F4` recorded on a Mac closes the window on Windows. See [Save hotkeys that work on another platform](./custom-hotkey-recording#save-hotkeys-that-work-on-another-platform) to keep synced hotkeys portable. + +To reject chords you don't want, such as the browser tab shortcuts in an Electron app that also ships to the web, return an error from `validate`: + +```ts +import Alpine from 'alpinejs' +import { createHotkeyRecorder, createHotkeysScope } from '@tanstack/alpine-hotkeys' + +const browserTabShortcuts = new Set([ + 'Mod+W', + 'Mod+T', + 'Mod+N', + 'Mod+Shift+N', + 'Mod+Shift+T', + 'Mod+Shift+W', +]) + +Alpine.data('shortcutInput', () => { + const hotkeys = createHotkeysScope() + const recorder = createHotkeyRecorder(hotkeys, { + validate: (hotkey) => + !browserTabShortcuts.has(hotkey) || 'The browser uses this shortcut.', + onRecord: (hotkey) => saveHotkey(hotkey), + }) + + return { + recorder, + destroy() { + hotkeys.destroy() + }, + } +}) +``` diff --git a/docs/framework/alpine/guides/custom-hotkey-recording.md b/docs/framework/alpine/guides/custom-hotkey-recording.md index 2a83c42e0..66fe3bdce 100644 --- a/docs/framework/alpine/guides/custom-hotkey-recording.md +++ b/docs/framework/alpine/guides/custom-hotkey-recording.md @@ -47,7 +47,7 @@ Alpine.data('shortcutRecorder', () => { The recorder writes the hotkey the way you would write it by hand. Command+S on macOS, or Control+S on Windows and Linux, records `Mod+S` on any keyboard layout. It records `Mod` rather than Command or Control, so the hotkey works on every platform. Pass the result straight to `createHotkey`, and label it with `createFormatForDisplay`. -The recorder writes what the user typed, as you would by hand: Shift+/ records `?`, and Ctrl+Shift+/, or Cmd+Shift+/ on the US `/` key, records `Mod+?`. With Control, Command or Alt, a digit-row key records its digit, so AZERTY Ctrl+& records `Mod+1`. For the few presses whose character the browser reports differently by platform, the recorder records the key's position, in brackets: Option+/ on macOS records `Alt+[Slash]`, even though it types `÷`. A recorded character such as `@` fires wherever the layout types it, which can be a different key. [Recording captures what the user pressed](../../../guides/sensible-defaults.md#recording-captures-what-the-user-pressed) lists these cases. Set `recordBy: 'code'` to record every key by position, or `recordBy: 'key'` to record the character every press types. Recording by position needs a physical code, so it rejects a press that has none. +The recorder writes what the user typed, as you would by hand: Shift+/ records `?`, and Ctrl+Shift+/, or Cmd+Shift+/ on the US `/` key, records `Mod+?`. With Control, Command or Alt, a digit-row key records its digit, so AZERTY Ctrl+& records `Mod+1`. For the few presses whose character the browser reports differently by platform, the recorder records the key's position, in brackets: Option+/ on macOS records `Alt+[Slash]`, even though it types `÷`. A recorded character such as `@` fires wherever the layout types it, which can be a different key. [Recording captures what the user pressed](../../../guides/sensible-defaults.md#recording-captures-what-the-user-pressed) lists these cases. Set `recordBy: 'code'` to record every key by position, or `recordBy: 'key'` to record the typed character. Recording by position needs a physical code, so it rejects a press that has none. ### Use the `$hotkeyRecorder` magic diff --git a/docs/framework/alpine/guides/hotkey-manager.md b/docs/framework/alpine/guides/hotkey-manager.md index b8dd171cd..44471376d 100644 --- a/docs/framework/alpine/guides/hotkey-manager.md +++ b/docs/framework/alpine/guides/hotkey-manager.md @@ -136,7 +136,7 @@ Alpine.data('keyboardOwner', () => { ## Suspend character key shortcuts -Call `manager.suspendCharacterKeys()` to pause document-level hotkeys made only of keys that type a character, such as `K`, `Shift+/`, or `['G', 'H']`. Hotkeys with `Control`, `Alt`, or `Meta`, non-character keys such as `Escape`, and hotkeys targeted at an element keep working. Suspensions are counted like scope activations, so character key shortcuts stay suspended until every returned resume function runs: +Call `manager.suspendCharacterKeys()` to pause document-level hotkeys made only of keys that type a character, such as `K`, `?`, or `['G', 'H']`. Hotkeys with `Control`, `Alt`, or `Meta`, non-character keys such as `Escape`, and hotkeys targeted at an element keep working. Suspensions are counted like scope activations, so character key shortcuts stay suspended until every returned resume function runs: ```ts const resume = manager.suspendCharacterKeys() diff --git a/docs/framework/alpine/guides/keyboard-layouts.md b/docs/framework/alpine/guides/keyboard-layouts.md index d01f296e9..fd047497f 100644 --- a/docs/framework/alpine/guides/keyboard-layouts.md +++ b/docs/framework/alpine/guides/keyboard-layouts.md @@ -15,7 +15,7 @@ A hotkey on a key that only one layout types fires only for users of that layout - `Mod+S` fires on a Russian layout, where that key types `ы`. - `Mod+;` fires on German Ctrl+Ö and Spanish Ctrl+Ñ, which sit in the same position. - On Greek, Cyrillic, and Hebrew layouts, bind `Mod+A`, not `Mod+Ф`. It fires on the same key, and keeps working after the user switches to a Latin layout. -- US punctuation that a layout types with Shift, such as `/` on German, can't match while Command is held on macOS. [Sensible Defaults](../../../guides/sensible-defaults.md#keys-match-the-character-the-user-types) explains why, and which hotkey to add. +- A US symbol that a layout types with Shift, such as `/` on German, can't match while Command is held on macOS. [Sensible Defaults](../../../guides/sensible-defaults.md#keys-match-the-character-the-user-types) explains why, and which hotkey to add. Register a layout when the key itself matters, such as a single-key `ß` shortcut, or a shortcut that your German interface labels with `Ö`. @@ -53,7 +53,7 @@ TypeScript checks only the hotkeys in your TypeScript files, such as the ones in - The sets replace the US keys. Keep `UsKeys` in the union to keep them. With `keys: GermanKeys` alone, `Mod+[` is a type error, because German types `[` only with AltGr or Option. - A to Z, 0 to 9, named keys such as `Escape` and `F1`, and physical codes such as `[KeyS]` type-check under every registration. - Write letters in uppercase, as you do for A to Z: `Mod+Ö`, not `Mod+ö`. `ß` and the Turkish `ı` stay as typed. -- Letters match Shift exactly. A letter that your layout types with Shift, such as Turkish `İ` or Swiss German `È`, needs Shift in the hotkey: `Shift+İ`. Symbols typed with Shift don't: German types `§` with Shift+3, and `§` matches it. +- Letters match Shift exactly. A letter that your layout types with Shift, such as Turkish `İ` or Swiss German `È`, needs Shift in the hotkey: `Shift+İ`. Symbols typed with Shift don't: German types `§` with Shift+3, and `§` matches it. The types reject `Shift+§`, as they reject `Shift` with any symbol. - The recorder records whatever the user presses, which can be a key outside your registered sets. ## Available key sets diff --git a/docs/framework/angular/guides/choosing-valid-hotkeys.md b/docs/framework/angular/guides/choosing-valid-hotkeys.md new file mode 100644 index 000000000..b40c48818 --- /dev/null +++ b/docs/framework/angular/guides/choosing-valid-hotkeys.md @@ -0,0 +1,228 @@ +--- +title: Choosing Valid Hotkeys in Angular +id: choosing-valid-hotkeys +description: Why TanStack Hotkeys rejects some hotkey strings, such as Shift+/, what to write instead, and which shortcuts the browser or operating system takes before your Angular app sees them. +--- + +You write a hotkey on your keyboard, and your users press it on theirs. Their keyboard can have another layout, another operating system, and another browser, and each of those can change what a key press means. A shortcut that works on your machine can fire on the wrong key for a German user, or never fire for someone on a Mac. + +TanStack Hotkeys absorbs most of these differences at runtime. A few it can't, because the hotkey string itself means more than one thing. For those, the types reject the string while you write it, so you find out in your editor and not from a bug report. This guide explains why those strings are rejected and what to write instead. It also covers the shortcuts no string can fix, because the browser or the operating system handles them before your app does. + +## Why `Shift+/` is a type error + +Say you want `?` to open a help dialog. On a US keyboard you type `?` with Shift and the `/` key, so you write down what you press: + +```ts +injectHotkey('Shift+/', () => this.openHelp()) // Type error +``` + +TypeScript rejects it. That can feel strict, since the string looks reasonable and would work on your keyboard. The problem shows up on other keyboards. + +A hotkey string names characters, and layouts put `/` and `?` on different keys. On a German keyboard, `/` is Shift+7 and `?` is Shift+ß. There, `Shift+/` can be read two ways: + +- You meant `?`, the character that US Shift+/ types. The library reads it that way, so German Shift+ß fires it. +- The string also says "Shift and `/`", and German Shift+7 is exactly that. So a German user who types a plain `/` fires it too. + +If your app binds `/` to search as well, that German user gets your help dialog instead of search, because an exact Shift match ranks above `/`. The library can't tell which reading you meant. Only you know that, so the types ask you to say it. + +When you mean the character, write the character: + +```ts +import { Component } from '@angular/core' +import { injectHotkey } from '@tanstack/angular-hotkeys' + +@Component({ + selector: 'app-help', + template: ``, +}) +export class HelpComponent { + constructor() { + // Fires on whatever key types `?` on the user's layout + injectHotkey('?', () => this.openHelp()) + } + + openHelp() { + // ... + } +} +``` + +`?` means the same thing on every layout. It fires on Shift+/ on a US keyboard and on Shift+ß on a German one, and the matcher takes care of the Shift the user needs to type it. + +When you mean the key's position, name the physical key. `Shift+[Slash]` is Shift with the key that US keyboards label `/`, whatever that key types on the user's layout. + +### Why letters and digits keep Shift + +Shift changes a letter's case, not which letter it is. `Shift+K` names the same key on every layout, so the types allow it. The Shift matters there too: `K` and `Shift+K` are two different shortcuts. + +Digits are safe for another reason. The matcher reads the digit row by position, so `Shift+1` fires on the key that types `1` on every layout. That includes French AZERTY, where the key types `&` without Shift. + +A symbol gets neither guarantee. Which symbol Shift adds to a key is up to the layout. + +### What can follow Shift + +After `Shift`, with or without other modifiers, a hotkey string takes a letter, a digit, a named key such as `Tab`, or a physical code such as `[Slash]`. A symbol after Shift is a type error: + +```ts +injectHotkey('Shift+/', () => this.openHelp()) // Type error +injectHotkey('?', () => this.openHelp()) // OK +injectHotkey('Control+?', () => this.openHelp()) // OK, fires on Control+Shift+/ on a US keyboard +injectHotkey('Shift+[Slash]', () => this.openHelp()) // OK, the physical key +injectHotkey('Mod+Shift+/', () => this.openHelp()) // Type error +injectHotkey('Mod+?', () => this.openHelp()) // OK +``` + +The same rule covers letters from [registered keyboard layouts](./keyboard-layouts): `Shift+Ä` is allowed, and `Shift+§` is a type error. + +The rule lives only in the types. A string from storage or user settings, such as a saved `'Shift+/'`, still matches as it did before, so shortcuts your users already saved keep working. + +## Mod with a symbol doesn't reach every Mac + +`Mod+?` is how you write Control+Shift+/ on Windows and Command+Shift+/ on macOS. On Windows and Linux it fires on every layout. macOS is less predictable. + +With Command held, macOS reports a different character for some keys than the one they type. Command+Shift on the key that types `?` reports `/` on German and Dvorak, `'` on Spanish, and `+` on Swedish. So `Mod+?` doesn't fire on those Mac layouts, while it does on US, UK, French, and Italian Macs. + +No symbol spelling covers that press on every Mac layout. When a shortcut has to work for everyone, such as the one that opens your command palette, give it a letter or a digit, such as `Mod+Shift+K` or `Mod+Shift+1`. To bind a key by position, use its physical code, such as `Mod+Shift+[Slash]`. + +[Keys match the character the user types](../../../guides/sensible-defaults.md#keys-match-the-character-the-user-types) has the details of how Command changes the reported key. + +## Replace a Shift string you already wrote + +When existing code has `Shift+` with a symbol, the right replacement depends on the keyboard it was written on, because whoever wrote it wrote what their keyboard typed. `Shift+,` types `<` on a US keyboard, `;` on a German one, and `?` on a French one. Find the string in the first column, then take the replacement from the column for the layout it was written on: + +| Ambiguous | US QWERTY | German | French AZERTY | +| --- | --- | --- | --- | +| `` Shift+` `` | `~` | `` ` `` | `` ` `` | +| `Shift+-` | `_` | `_` | `6` | +| `Shift+=` | `+` | `=` | `+` | +| `Shift+[` | `{` | `[` | `[` | +| `Shift+]` | `}` | `]` | `]` | +| `Shift+\` | `\|` | `\` | `\` | +| `Shift+;` | `:` | `;` | `.` | +| `Shift+'` | `"` | `'` | `4` | +| `Shift+,` | `<` | `;` | `?` | +| `Shift+.` | `>` | `:` | `.` | +| `Shift+/` | `?` | `/` | `/` | +| `Shift+_` | `_` | `_` | `8` | +| `Shift++` | `+` | `*` | `+` | +| `Shift+:` | `:` | `:` | `/` | +| `Shift+"` | `"` | `"` | `3` | +| `Shift+<` | `<` | `>` | `>` | +| `Shift+!` | `!` | `!` | `§` | +| `Shift+#` | `#` | `'` | `#` | +| `Shift+$` | `$` | `$` | `£` | +| `Shift+&` | `&` | `&` | `1` | +| `Shift+*` | `*` | `*` | `Shift+[Backslash]` | +| `Shift+(` | `(` | `(` | `5` | +| `Shift+)` | `)` | `)` | `°` | + +Each cell is what Shift and that key type on that layout. When the layout has no key that types the symbol without Shift, the replacement is the symbol itself. German `/` is Shift+7, so a German developer who wrote `Shift+/` meant `/`. + +A few more rules for reading the table: + +- The table leaves out strings whose replacement is the same symbol on all three layouts, such as `Shift+?` and `Shift+@`. Write the symbol: `?` or `@`. +- With other modifiers, keep them and use the same replacement. On a US keyboard, `Control+Shift+/` becomes `Control+?`, and `Mod+Shift+/` becomes `Mod+?`. +- French `µ` isn't in `FrenchKeys`, so its cell names the key by position instead. +- The German and French columns use the Windows layouts. The Mac layouts place some symbols differently. + +To keep a key's position instead of its character, use Shift with the key's physical code, such as `Shift+[Slash]`. + +## Physical codes name a key, not a character + +Use a physical code when the key's position matters more than its label, such as keys arranged in a row for a game or a drawing tool. The catch is the label. On other layouts the key types something else, so a hint that shows the US symbol can be wrong for those users. Shift and these codes type: + +| Physical code | US QWERTY | US Dvorak | German | +| --- | --- | --- | --- | +| `Shift+[Backquote]` | `~` | `~` | `°` | +| `Shift+[Minus]` | `_` | `{` | `?` | +| `Shift+[Equal]` | `+` | `}` | a dead key | +| `Shift+[BracketLeft]` | `{` | `?` | `Ü` | +| `Shift+[BracketRight]` | `}` | `+` | `*` | +| `Shift+[Backslash]` | `\|` | `\|` | `'` | +| `Shift+[Semicolon]` | `:` | `S` | `Ö` | +| `Shift+[Quote]` | `"` | `_` | `Ä` | +| `Shift+[Comma]` | `<` | `W` | `;` | +| `Shift+[Period]` | `>` | `V` | `:` | +| `Shift+[Slash]` | `?` | `Z` | `_` | + +When you pass a layout map, [`formatForDisplay`](./formatting-display) labels a physical code with the key's character on the user's layout. On a German keyboard, `Shift+[Slash]` shows as `Shift+-`. Without a layout map, which only Chromium browsers provide, the label is the US character for that position. + +## Some shortcuts belong to the browser or the operating system + +Some chords never reach your page. The browser or the operating system handles them first, so your handler doesn't run, and the user gets the browser's action instead. + +The types still accept these chords, and that's deliberate. The same chord can be free in an installed web app, in fullscreen, or in Electron. The types can't know where your app runs, but you do. + +### Browser tab shortcuts + +In a normal browser tab, these chords open, close, or switch tabs and windows. Chrome reserves them. The Firefox and Safari columns come from their source and bug reports, so treat a blank cell as unconfirmed, not as free: + +| Chord | Action | Chrome | Firefox | Safari | +| --- | --- | --- | --- | --- | +| `Mod+W` | Close tab | Reserved | Reserved | Reported reserved | +| `Mod+T` | New tab | Reserved | Reserved | Reported reserved | +| `Mod+N` | New window | Reserved | Reserved | Reported reserved | +| `Mod+Shift+W` | Close window | Reserved | Reserved | | +| `Mod+Shift+T` | Reopen closed tab | Reserved | | | +| `Mod+Shift+N` | New private window | Reserved | | | +| `Control+Tab`, `Control+Shift+Tab` | Next and previous tab | Reserved | Reported reserved | Reported reserved | +| `Control+PageUp`, `Control+PageDown` | Next and previous tab, Windows and Linux | Reserved | | | +| `Mod+Q` | Quit, macOS | Reserved | Not reserved | Reported reserved | + +Chrome reserves none of these in an installed web app window, and in fullscreen it keeps only the keys that leave fullscreen. If your app runs in a browser tab, pick other chords for its own actions. + +### Operating system shortcuts + +Each operating system keeps a few chords for itself. A chord is lost only on the system that keeps it: + +- **Windows.** Control+Alt+Delete, and most chords with the Windows key (`Meta`), such as Windows+L. +- **macOS.** Command+Tab, Command+Space, and Command+Option+Escape. +- **Linux.** Control+Alt+F1 through F12 switch to another virtual terminal. Desktops such as GNOME also take many chords with the Super key. + +Users can change many of these, so no list is complete. Prefer `Mod`, `Shift`, and `Alt` chords over `Meta` chords, which Windows mostly keeps. + +### Chords that can't fire on some layouts + +A few chords type a character the hotkey doesn't name, so they never fire on some layouts: + +- **Option with a shifted symbol on a US Mac.** Option+Shift+/ types `¿`, not `?`, so `Alt+?` and `Mod+Alt+?` never fire on a US Mac. Use the physical code instead, such as `Alt+Shift+[Slash]`. +- **Control+Alt on layouts with AltGr.** Windows treats Control+Alt as AltGr. On a German keyboard, Control+Alt+Q types `@`, so `Control+Alt+Q` never fires, and an `@` binding does. + +## Let users choose their own shortcuts + +The most reliable shortcut is often the one a user picks on their own keyboard. The [hotkey recorder](./custom-hotkey-recording) follows the rules in this guide for you: + +- It records only presses that reach the page, so in a browser tab it never records the browser and operating system chords above. +- It never writes Shift with a symbol. Shift+/ records `?`, and German Shift+7 records `/`. +- On a Mac with Command held, off the key's US position, the browser may not report the symbol the user typed. There the recorder records the key's physical code: Dvorak Command+Shift+/ records `Mod+Shift+[BracketLeft]`. + +A recorded hotkey can still fail on another machine. `Alt+F4` recorded on a Mac closes the window on Windows. See [Save hotkeys that work on another platform](./custom-hotkey-recording#save-hotkeys-that-work-on-another-platform) to keep synced hotkeys portable. + +To reject chords you don't want, such as the browser tab shortcuts in an Electron app that also ships to the web, return an error from `validate`: + +```ts +import { Component, output } from '@angular/core' +import { injectHotkeyRecorder } from '@tanstack/angular-hotkeys' + +const browserTabShortcuts = new Set([ + 'Mod+W', + 'Mod+T', + 'Mod+N', + 'Mod+Shift+N', + 'Mod+Shift+T', + 'Mod+Shift+W', +]) + +@Component({ + selector: 'app-shortcut-input', + template: ``, +}) +export class ShortcutInputComponent { + readonly save = output() + readonly recorder = injectHotkeyRecorder({ + validate: (hotkey) => + !browserTabShortcuts.has(hotkey) || 'The browser uses this shortcut.', + onRecord: (hotkey) => this.save.emit(hotkey), + }) +} +``` diff --git a/docs/framework/angular/guides/custom-hotkey-recording.md b/docs/framework/angular/guides/custom-hotkey-recording.md index f6733da64..ecb3dfcbb 100644 --- a/docs/framework/angular/guides/custom-hotkey-recording.md +++ b/docs/framework/angular/guides/custom-hotkey-recording.md @@ -41,7 +41,7 @@ export class ShortcutRecorderComponent { } ``` -With the default `recordBy: 'auto'`, the recorder outputs portable strings, written like a hand-typed string. Command+S on macOS and Control+S on Windows and Linux both record `Mod+S`. It records what the press typed, such as `?` for Shift+/ and `Mod+1` for AZERTY Ctrl+&. For the few presses whose character the browser reports differently by platform, it falls back to physical bracketed codes, such as `Alt+[Slash]` for macOS Option+/. A recorded character such as `@` fires wherever the layout types it, which can be a different key. See [Recording captures what the user pressed](../../../guides/sensible-defaults.md#recording-captures-what-the-user-pressed) for the full rules. Set `recordBy: 'code'` to always record the physical key, or `recordBy: 'key'` to always record the typed character. Pass the result straight to `injectHotkey`, and label it with `injectFormatForDisplay`. +With the default `recordBy: 'auto'`, the recorder outputs portable strings, written like a hand-typed string. Command+S on macOS and Control+S on Windows and Linux both record `Mod+S`. It records what the press typed, such as `?` for Shift+/ and `Mod+1` for AZERTY Ctrl+&. For the few presses whose character the browser reports differently by platform, it falls back to physical bracketed codes, such as `Alt+[Slash]` for macOS Option+/. A recorded character such as `@` fires wherever the layout types it, which can be a different key. See [Recording captures what the user pressed](../../../guides/sensible-defaults.md#recording-captures-what-the-user-pressed) for the full rules. Set `recordBy: 'code'` to always record the physical key, or `recordBy: 'key'` to record the typed character. Pass the result straight to `injectHotkey`, and label it with `injectFormatForDisplay`. `injectHotkeyRecorder` returns the recorder's state and controls. State members are signals: diff --git a/docs/framework/angular/guides/hotkey-manager.md b/docs/framework/angular/guides/hotkey-manager.md index 9badaed16..4550e7965 100644 --- a/docs/framework/angular/guides/hotkey-manager.md +++ b/docs/framework/angular/guides/hotkey-manager.md @@ -130,7 +130,7 @@ The [devtools](../../../devtools) show the same scope state without any code. ## Suspend character key shortcuts -Call `manager.suspendCharacterKeys()` to pause document-level hotkeys made only of keys that type a character, such as `K`, `Shift+/`, or `['G', 'H']`. Hotkeys with `Control`, `Alt`, or `Meta`, non-character keys such as `Escape`, and hotkeys targeted at an element keep working. Suspensions are counted like scope activations, so character key shortcuts stay suspended until every returned resume function runs: +Call `manager.suspendCharacterKeys()` to pause document-level hotkeys made only of keys that type a character, such as `K`, `?`, or `['G', 'H']`. Hotkeys with `Control`, `Alt`, or `Meta`, non-character keys such as `Escape`, and hotkeys targeted at an element keep working. Suspensions are counted like scope activations, so character key shortcuts stay suspended until every returned resume function runs: ```ts const resume = manager.suspendCharacterKeys() diff --git a/docs/framework/angular/guides/keyboard-layouts.md b/docs/framework/angular/guides/keyboard-layouts.md index 29f4f6af0..a1155f2b6 100644 --- a/docs/framework/angular/guides/keyboard-layouts.md +++ b/docs/framework/angular/guides/keyboard-layouts.md @@ -15,7 +15,7 @@ Most apps never need to register extra layouts. A to Z, 0 to 9, and common US pu - `Mod+S` matches on a Russian keyboard, where that key types `ы`. - `Mod+;` matches on German `Ctrl+Ö` and Spanish `Ctrl+Ñ` in the same physical slot. - On Greek, Cyrillic, and Hebrew layouts, prefer `Mod+A` over `Mod+Ф`. It matches on the same key and keeps working if the user toggles back to Latin. -- Punctuation that another layout types with `Shift`, such as `/` on German QWERTZ, can't match with `Command` held on macOS. See [Keys match the character the user types](../../../guides/sensible-defaults.md#keys-match-the-character-the-user-types) for why and how to add the shifted fallback. +- A symbol that another layout types with `Shift`, such as `/` on German QWERTZ, can't match with `Command` held on macOS. See [Keys match the character the user types](../../../guides/sensible-defaults.md#keys-match-the-character-the-user-types) for why and how to add the shifted fallback. Register layout sets only when you intentionally target keys unique to specific layouts, such as a single-key `ß` shortcut or shortcuts labeled with `Ö` in a localized UI. @@ -51,7 +51,7 @@ injectHotkey('Mod+Ñ', () => this.search()) // Type error: Spanish isn't registe - **Replaces `UsKeys` unless kept.** Include `UsKeys` in the union if you still want US punctuation like `[`. With `keys: GermanKeys` alone, `Mod+[` fails type-checking because German types `[` with `AltGr` or `Option`. - **Always allowed.** A to Z, 0 to 9, named keys (`Escape`, `F1`), and physical codes (`[KeyS]`) work under every registration. - **Casing.** Write letters uppercase (`Mod+Ö`, not `Mod+ö`), leaving `ß` and Turkish dotless `ı` as typed. -- **Shift-typed characters.** Layout letters typed with `Shift`, such as Turkish `İ` or Swiss German `È`, require `Shift+` (`Shift+İ`). Shift-typed symbols like `§` (via `Shift+3` on German) match without `Shift+`. +- **Shift-typed characters.** Layout letters typed with `Shift`, such as Turkish `İ` or Swiss German `È`, require `Shift+` (`Shift+İ`). Shift-typed symbols like `§` (via `Shift+3` on German) match without `Shift+`, and the types reject `Shift+§`, as they reject `Shift` with any symbol. - **Recorder.** `injectHotkeyRecorder` captures whatever key the user presses, even outside your registered TypeScript union. ## Available key sets diff --git a/docs/framework/ember/guides/choosing-valid-hotkeys.md b/docs/framework/ember/guides/choosing-valid-hotkeys.md new file mode 100644 index 000000000..333d28946 --- /dev/null +++ b/docs/framework/ember/guides/choosing-valid-hotkeys.md @@ -0,0 +1,244 @@ +--- +title: Choosing Valid Hotkeys in Ember +id: choosing-valid-hotkeys +description: Why TanStack Hotkeys rejects some hotkey strings, such as Shift+/, what to write instead, and which shortcuts the browser or operating system takes before your Ember app sees them. +--- + +You write a hotkey on your keyboard, and your users press it on theirs. Their keyboard can have another layout, another operating system, and another browser, and each of those can change what a key press means. A shortcut that works on your machine can fire on the wrong key for a German user, or never fire for someone on a Mac. + +TanStack Hotkeys absorbs most of these differences at runtime. A few it can't, because the hotkey string itself means more than one thing. For those, the types reject the string while you write it, so you find out in your editor and not from a bug report. This guide explains why those strings are rejected and what to write instead. It also covers the shortcuts no string can fix, because the browser or the operating system handles them before your app does. + +## Why `Shift+/` is a type error + +Say you want `?` to open a help dialog. On a US keyboard you type `?` with Shift and the `/` key, so you write down what you press: + +```hbs +{{! Type error }} +{{useHotkey 'Shift+/' this.openHelp}} +``` + +TypeScript rejects it. That can feel strict, since the string looks reasonable and would work on your keyboard. The problem shows up on other keyboards. + +A hotkey string names characters, and layouts put `/` and `?` on different keys. On a German keyboard, `/` is Shift+7 and `?` is Shift+ß. There, `Shift+/` can be read two ways: + +- You meant `?`, the character that US Shift+/ types. The library reads it that way, so German Shift+ß fires it. +- The string also says "Shift and `/`", and German Shift+7 is exactly that. So a German user who types a plain `/` fires it too. + +If your app binds `/` to search as well, that German user gets your help dialog instead of search, because an exact Shift match ranks above `/`. The library can't tell which reading you meant. Only you know that, so the types ask you to say it. + +When you mean the character, write the character: + +```gts +import Component from '@glimmer/component' +import { useHotkey } from '@tanstack/ember-hotkeys' + +export default class Help extends Component { + openHelp = () => { + // ... + } + + +} +``` + +`?` means the same thing on every layout. It fires on Shift+/ on a US keyboard and on Shift+ß on a German one, and the matcher takes care of the Shift the user needs to type it. + +When you mean the key's position, name the physical key. `Shift+[Slash]` is Shift with the key that US keyboards label `/`, whatever that key types on the user's layout. + +### Why letters and digits keep Shift + +Shift changes a letter's case, not which letter it is. `Shift+K` names the same key on every layout, so the types allow it. The Shift matters there too: `K` and `Shift+K` are two different shortcuts. + +Digits are safe for another reason. The matcher reads the digit row by position, so `Shift+1` fires on the key that types `1` on every layout. That includes French AZERTY, where the key types `&` without Shift. + +A symbol gets neither guarantee. Which symbol Shift adds to a key is up to the layout. + +### What can follow Shift + +After `Shift`, with or without other modifiers, a hotkey string takes a letter, a digit, a named key such as `Tab`, or a physical code such as `[Slash]`. A symbol after Shift is a type error: + +```hbs +{{! Type error }} +{{useHotkey 'Shift+/' this.openHelp}} + +{{! OK }} +{{useHotkey '?' this.openHelp}} + +{{! OK, fires on Control+Shift+/ on a US keyboard }} +{{useHotkey 'Control+?' this.openHelp}} + +{{! OK, the physical key }} +{{useHotkey 'Shift+[Slash]' this.openHelp}} + +{{! Type error }} +{{useHotkey 'Mod+Shift+/' this.openHelp}} + +{{! OK }} +{{useHotkey 'Mod+?' this.openHelp}} +``` + +The same rule covers letters from [registered keyboard layouts](./keyboard-layouts): `Shift+Ä` is allowed, and `Shift+§` is a type error. + +The rule lives only in the types. A string from storage or user settings, such as a saved `'Shift+/'`, still matches as it did before, so shortcuts your users already saved keep working. + +Glint checks hotkeys in templates too, so `ember-tsc` reports these errors in `.gts` files. + +## Mod with a symbol doesn't reach every Mac + +`Mod+?` is how you write Control+Shift+/ on Windows and Command+Shift+/ on macOS. On Windows and Linux it fires on every layout. macOS is less predictable. + +With Command held, macOS reports a different character for some keys than the one they type. Command+Shift on the key that types `?` reports `/` on German and Dvorak, `'` on Spanish, and `+` on Swedish. So `Mod+?` doesn't fire on those Mac layouts, while it does on US, UK, French, and Italian Macs. + +No symbol spelling covers that press on every Mac layout. When a shortcut has to work for everyone, such as the one that opens your command palette, give it a letter or a digit, such as `Mod+Shift+K` or `Mod+Shift+1`. To bind a key by position, use its physical code, such as `Mod+Shift+[Slash]`. + +[Keys match the character the user types](../../../guides/sensible-defaults.md#keys-match-the-character-the-user-types) has the details of how Command changes the reported key. + +## Replace a Shift string you already wrote + +When existing code has `Shift+` with a symbol, the right replacement depends on the keyboard it was written on, because whoever wrote it wrote what their keyboard typed. `Shift+,` types `<` on a US keyboard, `;` on a German one, and `?` on a French one. Find the string in the first column, then take the replacement from the column for the layout it was written on: + +| Ambiguous | US QWERTY | German | French AZERTY | +| --- | --- | --- | --- | +| `` Shift+` `` | `~` | `` ` `` | `` ` `` | +| `Shift+-` | `_` | `_` | `6` | +| `Shift+=` | `+` | `=` | `+` | +| `Shift+[` | `{` | `[` | `[` | +| `Shift+]` | `}` | `]` | `]` | +| `Shift+\` | `\|` | `\` | `\` | +| `Shift+;` | `:` | `;` | `.` | +| `Shift+'` | `"` | `'` | `4` | +| `Shift+,` | `<` | `;` | `?` | +| `Shift+.` | `>` | `:` | `.` | +| `Shift+/` | `?` | `/` | `/` | +| `Shift+_` | `_` | `_` | `8` | +| `Shift++` | `+` | `*` | `+` | +| `Shift+:` | `:` | `:` | `/` | +| `Shift+"` | `"` | `"` | `3` | +| `Shift+<` | `<` | `>` | `>` | +| `Shift+!` | `!` | `!` | `§` | +| `Shift+#` | `#` | `'` | `#` | +| `Shift+$` | `$` | `$` | `£` | +| `Shift+&` | `&` | `&` | `1` | +| `Shift+*` | `*` | `*` | `Shift+[Backslash]` | +| `Shift+(` | `(` | `(` | `5` | +| `Shift+)` | `)` | `)` | `°` | + +Each cell is what Shift and that key type on that layout. When the layout has no key that types the symbol without Shift, the replacement is the symbol itself. German `/` is Shift+7, so a German developer who wrote `Shift+/` meant `/`. + +A few more rules for reading the table: + +- The table leaves out strings whose replacement is the same symbol on all three layouts, such as `Shift+?` and `Shift+@`. Write the symbol: `?` or `@`. +- With other modifiers, keep them and use the same replacement. On a US keyboard, `Control+Shift+/` becomes `Control+?`, and `Mod+Shift+/` becomes `Mod+?`. +- French `µ` isn't in `FrenchKeys`, so its cell names the key by position instead. +- The German and French columns use the Windows layouts. The Mac layouts place some symbols differently. + +To keep a key's position instead of its character, use Shift with the key's physical code, such as `Shift+[Slash]`. + +## Physical codes name a key, not a character + +Use a physical code when the key's position matters more than its label, such as keys arranged in a row for a game or a drawing tool. The catch is the label. On other layouts the key types something else, so a hint that shows the US symbol can be wrong for those users. Shift and these codes type: + +| Physical code | US QWERTY | US Dvorak | German | +| --- | --- | --- | --- | +| `Shift+[Backquote]` | `~` | `~` | `°` | +| `Shift+[Minus]` | `_` | `{` | `?` | +| `Shift+[Equal]` | `+` | `}` | a dead key | +| `Shift+[BracketLeft]` | `{` | `?` | `Ü` | +| `Shift+[BracketRight]` | `}` | `+` | `*` | +| `Shift+[Backslash]` | `\|` | `\|` | `'` | +| `Shift+[Semicolon]` | `:` | `S` | `Ö` | +| `Shift+[Quote]` | `"` | `_` | `Ä` | +| `Shift+[Comma]` | `<` | `W` | `;` | +| `Shift+[Period]` | `>` | `V` | `:` | +| `Shift+[Slash]` | `?` | `Z` | `_` | + +When you pass a layout map, [`formatForDisplay`](./formatting-display) labels a physical code with the key's character on the user's layout. On a German keyboard, `Shift+[Slash]` shows as `Shift+-`. Without a layout map, which only Chromium browsers provide, the label is the US character for that position. + +## Some shortcuts belong to the browser or the operating system + +Some chords never reach your page. The browser or the operating system handles them first, so your handler doesn't run, and the user gets the browser's action instead. + +The types still accept these chords, and that's deliberate. The same chord can be free in an installed web app, in fullscreen, or in Electron. The types can't know where your app runs, but you do. + +### Browser tab shortcuts + +In a normal browser tab, these chords open, close, or switch tabs and windows. Chrome reserves them. The Firefox and Safari columns come from their source and bug reports, so treat a blank cell as unconfirmed, not as free: + +| Chord | Action | Chrome | Firefox | Safari | +| --- | --- | --- | --- | --- | +| `Mod+W` | Close tab | Reserved | Reserved | Reported reserved | +| `Mod+T` | New tab | Reserved | Reserved | Reported reserved | +| `Mod+N` | New window | Reserved | Reserved | Reported reserved | +| `Mod+Shift+W` | Close window | Reserved | Reserved | | +| `Mod+Shift+T` | Reopen closed tab | Reserved | | | +| `Mod+Shift+N` | New private window | Reserved | | | +| `Control+Tab`, `Control+Shift+Tab` | Next and previous tab | Reserved | Reported reserved | Reported reserved | +| `Control+PageUp`, `Control+PageDown` | Next and previous tab, Windows and Linux | Reserved | | | +| `Mod+Q` | Quit, macOS | Reserved | Not reserved | Reported reserved | + +Chrome reserves none of these in an installed web app window, and in fullscreen it keeps only the keys that leave fullscreen. If your app runs in a browser tab, pick other chords for its own actions. + +### Operating system shortcuts + +Each operating system keeps a few chords for itself. A chord is lost only on the system that keeps it: + +- **Windows.** Control+Alt+Delete, and most chords with the Windows key (`Meta`), such as Windows+L. +- **macOS.** Command+Tab, Command+Space, and Command+Option+Escape. +- **Linux.** Control+Alt+F1 through F12 switch to another virtual terminal. Desktops such as GNOME also take many chords with the Super key. + +Users can change many of these, so no list is complete. Prefer `Mod`, `Shift`, and `Alt` chords over `Meta` chords, which Windows mostly keeps. + +### Chords that can't fire on some layouts + +A few chords type a character the hotkey doesn't name, so they never fire on some layouts: + +- **Option with a shifted symbol on a US Mac.** Option+Shift+/ types `¿`, not `?`, so `Alt+?` and `Mod+Alt+?` never fire on a US Mac. Use the physical code instead, such as `Alt+Shift+[Slash]`. +- **Control+Alt on layouts with AltGr.** Windows treats Control+Alt as AltGr. On a German keyboard, Control+Alt+Q types `@`, so `Control+Alt+Q` never fires, and an `@` binding does. + +## Let users choose their own shortcuts + +The most reliable shortcut is often the one a user picks on their own keyboard. The [hotkey recorder](./custom-hotkey-recording) follows the rules in this guide for you: + +- It records only presses that reach the page, so in a browser tab it never records the browser and operating system chords above. +- It never writes Shift with a symbol. Shift+/ records `?`, and German Shift+7 records `/`. +- On a Mac with Command held, off the key's US position, the browser may not report the symbol the user typed. There the recorder records the key's physical code: Dvorak Command+Shift+/ records `Mod+Shift+[BracketLeft]`. + +A recorded hotkey can still fail on another machine. `Alt+F4` recorded on a Mac closes the window on Windows. See [Save hotkeys that work on another platform](./custom-hotkey-recording#save-hotkeys-that-work-on-another-platform) to keep synced hotkeys portable. + +To reject chords you don't want, such as the browser tab shortcuts in an Electron app that also ships to the web, return an error from `validate`: + +```gts +import Component from '@glimmer/component' +import { on } from '@ember/modifier' +import { useHotkeyRecorder } from '@tanstack/ember-hotkeys' + +const browserTabShortcuts = new Set([ + 'Mod+W', + 'Mod+T', + 'Mod+N', + 'Mod+Shift+N', + 'Mod+Shift+T', + 'Mod+Shift+W', +]) + +interface ShortcutInputSignature { + Args: { onSave: (hotkey: string) => void } +} + +export default class ShortcutInput extends Component { + recorder = useHotkeyRecorder(this, { + validate: (hotkey) => + !browserTabShortcuts.has(hotkey) || 'The browser uses this shortcut.', + onRecord: (hotkey) => this.args.onSave(hotkey), + }) + + +} +``` diff --git a/docs/framework/ember/guides/custom-hotkey-recording.md b/docs/framework/ember/guides/custom-hotkey-recording.md index baed54982..fac7d5fa8 100644 --- a/docs/framework/ember/guides/custom-hotkey-recording.md +++ b/docs/framework/ember/guides/custom-hotkey-recording.md @@ -40,7 +40,7 @@ export default class ShortcutRecorder extends Component { The recorder writes the hotkey the way you would write it by hand. Command+S on macOS, or Control+S on Windows and Linux, records `Mod+S` on any keyboard layout. It records `Mod` rather than Command or Control, so the hotkey works on every platform. Pass the result straight to `useHotkey`, and label it with `useFormatForDisplay`. -The recorder writes what the user typed, as you would by hand: Shift+/ records `?`, and Ctrl+Shift+/, or Cmd+Shift+/ on the US `/` key, records `Mod+?`. With Control, Command or Alt, a digit-row key records its digit, so AZERTY Ctrl+& records `Mod+1`. For the few presses whose character the browser reports differently by platform, the recorder records the key's position, in brackets: Option+/ on macOS records `Alt+[Slash]`, even though it types `÷`. A recorded character such as `@` fires wherever the layout types it, which can be a different key. [Recording captures what the user pressed](../../../guides/sensible-defaults.md#recording-captures-what-the-user-pressed) lists these cases. Set `recordBy: 'code'` to record every key by position, or `recordBy: 'key'` to record the character every press types. Recording by position needs a physical code, so it rejects a press that has none. +The recorder writes what the user typed, as you would by hand: Shift+/ records `?`, and Ctrl+Shift+/, or Cmd+Shift+/ on the US `/` key, records `Mod+?`. With Control, Command or Alt, a digit-row key records its digit, so AZERTY Ctrl+& records `Mod+1`. For the few presses whose character the browser reports differently by platform, the recorder records the key's position, in brackets: Option+/ on macOS records `Alt+[Slash]`, even though it types `÷`. A recorded character such as `@` fires wherever the layout types it, which can be a different key. [Recording captures what the user pressed](../../../guides/sensible-defaults.md#recording-captures-what-the-user-pressed) lists these cases. Set `recordBy: 'code'` to record every key by position, or `recordBy: 'key'` to record the typed character. Recording by position needs a physical code, so it rejects a press that has none. Pass the component as the owner, and the recorder is destroyed with it. The recorder has its state and controls, and its state members are tracked getters: diff --git a/docs/framework/ember/guides/hotkey-manager.md b/docs/framework/ember/guides/hotkey-manager.md index 4b4522464..911c9156c 100644 --- a/docs/framework/ember/guides/hotkey-manager.md +++ b/docs/framework/ember/guides/hotkey-manager.md @@ -126,7 +126,7 @@ export default class KeyboardOwner extends Component { ## Suspend character key shortcuts -Call `manager.suspendCharacterKeys()` to pause document-level hotkeys made only of keys that type a character, such as `K`, `Shift+/`, or `['G', 'H']`. Hotkeys with `Control`, `Alt`, or `Meta`, non-character keys such as `Escape`, and hotkeys targeted at an element keep working. Suspensions are counted like scope activations, so character key shortcuts stay suspended until every returned resume function runs: +Call `manager.suspendCharacterKeys()` to pause document-level hotkeys made only of keys that type a character, such as `K`, `?`, or `['G', 'H']`. Hotkeys with `Control`, `Alt`, or `Meta`, non-character keys such as `Escape`, and hotkeys targeted at an element keep working. Suspensions are counted like scope activations, so character key shortcuts stay suspended until every returned resume function runs: ```ts const resume = manager.suspendCharacterKeys() diff --git a/docs/framework/ember/guides/keyboard-layouts.md b/docs/framework/ember/guides/keyboard-layouts.md index 4a70a2733..f8e633fff 100644 --- a/docs/framework/ember/guides/keyboard-layouts.md +++ b/docs/framework/ember/guides/keyboard-layouts.md @@ -15,7 +15,7 @@ A hotkey on a key that only one layout types fires only for users of that layout - `Mod+S` fires on a Russian layout, where that key types `ы`. - `Mod+;` fires on German Ctrl+Ö and Spanish Ctrl+Ñ, which sit in the same position. - On Greek, Cyrillic, and Hebrew layouts, bind `Mod+A`, not `Mod+Ф`. It fires on the same key, and keeps working after the user switches to a Latin layout. -- US punctuation that a layout types with Shift, such as `/` on German, can't match while Command is held on macOS. [Sensible Defaults](../../../guides/sensible-defaults.md#keys-match-the-character-the-user-types) explains why, and which hotkey to add. +- A US symbol that a layout types with Shift, such as `/` on German, can't match while Command is held on macOS. [Sensible Defaults](../../../guides/sensible-defaults.md#keys-match-the-character-the-user-types) explains why, and which hotkey to add. Register a layout when the key itself matters, such as a single-key `ß` shortcut, or a shortcut that your German interface labels with `Ö`. @@ -57,7 +57,7 @@ Glint applies the registration to templates, so `ember-tsc` reports the `Mod+Ñ` - The sets replace the US keys. Keep `UsKeys` in the union to keep them. With `keys: GermanKeys` alone, `Mod+[` is a type error, because German types `[` only with AltGr or Option. - A to Z, 0 to 9, named keys such as `Escape` and `F1`, and physical codes such as `[KeyS]` type-check under every registration. - Write letters in uppercase, as you do for A to Z: `Mod+Ö`, not `Mod+ö`. `ß` and the Turkish `ı` stay as typed. -- Letters match Shift exactly. A letter that your layout types with Shift, such as Turkish `İ` or Swiss German `È`, needs Shift in the hotkey: `Shift+İ`. Symbols typed with Shift don't: German types `§` with Shift+3, and `§` matches it. +- Letters match Shift exactly. A letter that your layout types with Shift, such as Turkish `İ` or Swiss German `È`, needs Shift in the hotkey: `Shift+İ`. Symbols typed with Shift don't: German types `§` with Shift+3, and `§` matches it. The types reject `Shift+§`, as they reject `Shift` with any symbol. - The recorder records whatever the user presses, which can be a key outside your registered sets. ## Available key sets diff --git a/docs/framework/lit/guides/choosing-valid-hotkeys.md b/docs/framework/lit/guides/choosing-valid-hotkeys.md new file mode 100644 index 000000000..94df064dc --- /dev/null +++ b/docs/framework/lit/guides/choosing-valid-hotkeys.md @@ -0,0 +1,235 @@ +--- +title: Choosing Valid Hotkeys in Lit +id: choosing-valid-hotkeys +description: Why TanStack Hotkeys rejects some hotkey strings, such as Shift+/, what to write instead, and which shortcuts the browser or operating system takes before your Lit app sees them. +--- + +You write a hotkey on your keyboard, and your users press it on theirs. Their keyboard can have another layout, another operating system, and another browser, and each of those can change what a key press means. A shortcut that works on your machine can fire on the wrong key for a German user, or never fire for someone on a Mac. + +TanStack Hotkeys absorbs most of these differences at runtime. A few it can't, because the hotkey string itself means more than one thing. For those, the types reject the string while you write it, so you find out in your editor and not from a bug report. This guide explains why those strings are rejected and what to write instead. It also covers the shortcuts no string can fix, because the browser or the operating system handles them before your app does. + +## Why `Shift+/` is a type error + +Say you want `?` to open a help dialog. On a US keyboard you type `?` with Shift and the `/` key, so you write down what you press: + +```ts +@hotkey('Shift+/') // Type error +openHelp() {} +``` + +TypeScript rejects it. That can feel strict, since the string looks reasonable and would work on your keyboard. The problem shows up on other keyboards. + +A hotkey string names characters, and layouts put `/` and `?` on different keys. On a German keyboard, `/` is Shift+7 and `?` is Shift+ß. There, `Shift+/` can be read two ways: + +- You meant `?`, the character that US Shift+/ types. The library reads it that way, so German Shift+ß fires it. +- The string also says "Shift and `/`", and German Shift+7 is exactly that. So a German user who types a plain `/` fires it too. + +If your app binds `/` to search as well, that German user gets your help dialog instead of search, because an exact Shift match ranks above `/`. The library can't tell which reading you meant. Only you know that, so the types ask you to say it. + +When you mean the character, write the character: + +```ts +import { LitElement, html } from 'lit' +import { customElement } from 'lit/decorators.js' +import { hotkey } from '@tanstack/lit-hotkeys' + +@customElement('help-button') +class HelpButton extends LitElement { + // Fires on whatever key types `?` on the user's layout + @hotkey('?') + openHelp() { + // ... + } + + render() { + return html`` + } +} +``` + +`?` means the same thing on every layout. It fires on Shift+/ on a US keyboard and on Shift+ß on a German one, and the matcher takes care of the Shift the user needs to type it. + +When you mean the key's position, name the physical key. `Shift+[Slash]` is Shift with the key that US keyboards label `/`, whatever that key types on the user's layout. + +### Why letters and digits keep Shift + +Shift changes a letter's case, not which letter it is. `Shift+K` names the same key on every layout, so the types allow it. The Shift matters there too: `K` and `Shift+K` are two different shortcuts. + +Digits are safe for another reason. The matcher reads the digit row by position, so `Shift+1` fires on the key that types `1` on every layout. That includes French AZERTY, where the key types `&` without Shift. + +A symbol gets neither guarantee. Which symbol Shift adds to a key is up to the layout. + +### What can follow Shift + +After `Shift`, with or without other modifiers, a hotkey string takes a letter, a digit, a named key such as `Tab`, or a physical code such as `[Slash]`. A symbol after Shift is a type error: + +```ts +@hotkey('Shift+/') // Type error +@hotkey('?') // OK +@hotkey('Control+?') // OK, fires on Control+Shift+/ on a US keyboard +@hotkey('Shift+[Slash]') // OK, the physical key +@hotkey('Mod+Shift+/') // Type error +@hotkey('Mod+?') // OK +openHelp() {} +``` + +The same rule covers letters from [registered keyboard layouts](./keyboard-layouts): `Shift+Ä` is allowed, and `Shift+§` is a type error. + +The rule lives only in the types. A string from storage or user settings, such as a saved `'Shift+/'`, still matches as it did before, so shortcuts your users already saved keep working. + +## Mod with a symbol doesn't reach every Mac + +`Mod+?` is how you write Control+Shift+/ on Windows and Command+Shift+/ on macOS. On Windows and Linux it fires on every layout. macOS is less predictable. + +With Command held, macOS reports a different character for some keys than the one they type. Command+Shift on the key that types `?` reports `/` on German and Dvorak, `'` on Spanish, and `+` on Swedish. So `Mod+?` doesn't fire on those Mac layouts, while it does on US, UK, French, and Italian Macs. + +No symbol spelling covers that press on every Mac layout. When a shortcut has to work for everyone, such as the one that opens your command palette, give it a letter or a digit, such as `Mod+Shift+K` or `Mod+Shift+1`. To bind a key by position, use its physical code, such as `Mod+Shift+[Slash]`. + +[Keys match the character the user types](../../../guides/sensible-defaults.md#keys-match-the-character-the-user-types) has the details of how Command changes the reported key. + +## Replace a Shift string you already wrote + +When existing code has `Shift+` with a symbol, the right replacement depends on the keyboard it was written on, because whoever wrote it wrote what their keyboard typed. `Shift+,` types `<` on a US keyboard, `;` on a German one, and `?` on a French one. Find the string in the first column, then take the replacement from the column for the layout it was written on: + +| Ambiguous | US QWERTY | German | French AZERTY | +| --- | --- | --- | --- | +| `` Shift+` `` | `~` | `` ` `` | `` ` `` | +| `Shift+-` | `_` | `_` | `6` | +| `Shift+=` | `+` | `=` | `+` | +| `Shift+[` | `{` | `[` | `[` | +| `Shift+]` | `}` | `]` | `]` | +| `Shift+\` | `\|` | `\` | `\` | +| `Shift+;` | `:` | `;` | `.` | +| `Shift+'` | `"` | `'` | `4` | +| `Shift+,` | `<` | `;` | `?` | +| `Shift+.` | `>` | `:` | `.` | +| `Shift+/` | `?` | `/` | `/` | +| `Shift+_` | `_` | `_` | `8` | +| `Shift++` | `+` | `*` | `+` | +| `Shift+:` | `:` | `:` | `/` | +| `Shift+"` | `"` | `"` | `3` | +| `Shift+<` | `<` | `>` | `>` | +| `Shift+!` | `!` | `!` | `§` | +| `Shift+#` | `#` | `'` | `#` | +| `Shift+$` | `$` | `$` | `£` | +| `Shift+&` | `&` | `&` | `1` | +| `Shift+*` | `*` | `*` | `Shift+[Backslash]` | +| `Shift+(` | `(` | `(` | `5` | +| `Shift+)` | `)` | `)` | `°` | + +Each cell is what Shift and that key type on that layout. When the layout has no key that types the symbol without Shift, the replacement is the symbol itself. German `/` is Shift+7, so a German developer who wrote `Shift+/` meant `/`. + +A few more rules for reading the table: + +- The table leaves out strings whose replacement is the same symbol on all three layouts, such as `Shift+?` and `Shift+@`. Write the symbol: `?` or `@`. +- With other modifiers, keep them and use the same replacement. On a US keyboard, `Control+Shift+/` becomes `Control+?`, and `Mod+Shift+/` becomes `Mod+?`. +- French `µ` isn't in `FrenchKeys`, so its cell names the key by position instead. +- The German and French columns use the Windows layouts. The Mac layouts place some symbols differently. + +To keep a key's position instead of its character, use Shift with the key's physical code, such as `Shift+[Slash]`. + +## Physical codes name a key, not a character + +Use a physical code when the key's position matters more than its label, such as keys arranged in a row for a game or a drawing tool. The catch is the label. On other layouts the key types something else, so a hint that shows the US symbol can be wrong for those users. Shift and these codes type: + +| Physical code | US QWERTY | US Dvorak | German | +| --- | --- | --- | --- | +| `Shift+[Backquote]` | `~` | `~` | `°` | +| `Shift+[Minus]` | `_` | `{` | `?` | +| `Shift+[Equal]` | `+` | `}` | a dead key | +| `Shift+[BracketLeft]` | `{` | `?` | `Ü` | +| `Shift+[BracketRight]` | `}` | `+` | `*` | +| `Shift+[Backslash]` | `\|` | `\|` | `'` | +| `Shift+[Semicolon]` | `:` | `S` | `Ö` | +| `Shift+[Quote]` | `"` | `_` | `Ä` | +| `Shift+[Comma]` | `<` | `W` | `;` | +| `Shift+[Period]` | `>` | `V` | `:` | +| `Shift+[Slash]` | `?` | `Z` | `_` | + +When you pass a layout map, [`formatForDisplay`](./formatting-display) labels a physical code with the key's character on the user's layout. On a German keyboard, `Shift+[Slash]` shows as `Shift+-`. Without a layout map, which only Chromium browsers provide, the label is the US character for that position. + +## Some shortcuts belong to the browser or the operating system + +Some chords never reach your page. The browser or the operating system handles them first, so your handler doesn't run, and the user gets the browser's action instead. + +The types still accept these chords, and that's deliberate. The same chord can be free in an installed web app, in fullscreen, or in Electron. The types can't know where your app runs, but you do. + +### Browser tab shortcuts + +In a normal browser tab, these chords open, close, or switch tabs and windows. Chrome reserves them. The Firefox and Safari columns come from their source and bug reports, so treat a blank cell as unconfirmed, not as free: + +| Chord | Action | Chrome | Firefox | Safari | +| --- | --- | --- | --- | --- | +| `Mod+W` | Close tab | Reserved | Reserved | Reported reserved | +| `Mod+T` | New tab | Reserved | Reserved | Reported reserved | +| `Mod+N` | New window | Reserved | Reserved | Reported reserved | +| `Mod+Shift+W` | Close window | Reserved | Reserved | | +| `Mod+Shift+T` | Reopen closed tab | Reserved | | | +| `Mod+Shift+N` | New private window | Reserved | | | +| `Control+Tab`, `Control+Shift+Tab` | Next and previous tab | Reserved | Reported reserved | Reported reserved | +| `Control+PageUp`, `Control+PageDown` | Next and previous tab, Windows and Linux | Reserved | | | +| `Mod+Q` | Quit, macOS | Reserved | Not reserved | Reported reserved | + +Chrome reserves none of these in an installed web app window, and in fullscreen it keeps only the keys that leave fullscreen. If your app runs in a browser tab, pick other chords for its own actions. + +### Operating system shortcuts + +Each operating system keeps a few chords for itself. A chord is lost only on the system that keeps it: + +- **Windows.** Control+Alt+Delete, and most chords with the Windows key (`Meta`), such as Windows+L. +- **macOS.** Command+Tab, Command+Space, and Command+Option+Escape. +- **Linux.** Control+Alt+F1 through F12 switch to another virtual terminal. Desktops such as GNOME also take many chords with the Super key. + +Users can change many of these, so no list is complete. Prefer `Mod`, `Shift`, and `Alt` chords over `Meta` chords, which Windows mostly keeps. + +### Chords that can't fire on some layouts + +A few chords type a character the hotkey doesn't name, so they never fire on some layouts: + +- **Option with a shifted symbol on a US Mac.** Option+Shift+/ types `¿`, not `?`, so `Alt+?` and `Mod+Alt+?` never fire on a US Mac. Use the physical code instead, such as `Alt+Shift+[Slash]`. +- **Control+Alt on layouts with AltGr.** Windows treats Control+Alt as AltGr. On a German keyboard, Control+Alt+Q types `@`, so `Control+Alt+Q` never fires, and an `@` binding does. + +## Let users choose their own shortcuts + +The most reliable shortcut is often the one a user picks on their own keyboard. The [hotkey recorder](./custom-hotkey-recording) follows the rules in this guide for you: + +- It records only presses that reach the page, so in a browser tab it never records the browser and operating system chords above. +- It never writes Shift with a symbol. Shift+/ records `?`, and German Shift+7 records `/`. +- On a Mac with Command held, off the key's US position, the browser may not report the symbol the user typed. There the recorder records the key's physical code: Dvorak Command+Shift+/ records `Mod+Shift+[BracketLeft]`. + +A recorded hotkey can still fail on another machine. `Alt+F4` recorded on a Mac closes the window on Windows. See [Save hotkeys that work on another platform](./custom-hotkey-recording#save-hotkeys-that-work-on-another-platform) to keep synced hotkeys portable. + +To reject chords you don't want, such as the browser tab shortcuts in an Electron app that also ships to the web, return an error from `validate`: + +```ts +import { LitElement, html } from 'lit' +import { customElement } from 'lit/decorators.js' +import { HotkeyRecorderController } from '@tanstack/lit-hotkeys' + +const browserTabShortcuts = new Set([ + 'Mod+W', + 'Mod+T', + 'Mod+N', + 'Mod+Shift+N', + 'Mod+Shift+T', + 'Mod+Shift+W', +]) + +@customElement('shortcut-input') +class ShortcutInput extends LitElement { + private recorder = new HotkeyRecorderController(this, { + validate: (hotkey) => + !browserTabShortcuts.has(hotkey) || 'The browser uses this shortcut.', + onRecord: (hotkey) => + this.dispatchEvent(new CustomEvent('save', { detail: hotkey })), + }) + + render() { + return html` + + ` + } +} +``` diff --git a/docs/framework/lit/guides/custom-hotkey-recording.md b/docs/framework/lit/guides/custom-hotkey-recording.md index 9f066f1e0..1775809fe 100644 --- a/docs/framework/lit/guides/custom-hotkey-recording.md +++ b/docs/framework/lit/guides/custom-hotkey-recording.md @@ -47,7 +47,7 @@ class ShortcutRecorder extends LitElement { The recorder writes the hotkey the way you would write it by hand. Command+S on macOS, or Control+S on Windows and Linux, records `Mod+S` on any keyboard layout. It records `Mod` rather than Command or Control, so the hotkey works on every platform. Pass the result straight to `HotkeyController`, and label it with `FormatForDisplayController`. -The recorder writes what the user typed, as you would by hand: Shift+/ records `?`, and Ctrl+Shift+/, or Cmd+Shift+/ on the US `/` key, records `Mod+?`. With Control, Command or Alt, a digit-row key records its digit, so AZERTY Ctrl+& records `Mod+1`. For the few presses whose character the browser reports differently by platform, the recorder records the key's position, in brackets: Option+/ on macOS records `Alt+[Slash]`, even though it types `÷`. A recorded character such as `@` fires wherever the layout types it, which can be a different key. [Recording captures what the user pressed](../../../guides/sensible-defaults.md#recording-captures-what-the-user-pressed) lists these cases. Set `recordBy: 'code'` to record every key by position, or `recordBy: 'key'` to record the character every press types. Recording by position needs a physical code, so it rejects a press that has none. +The recorder writes what the user typed, as you would by hand: Shift+/ records `?`, and Ctrl+Shift+/, or Cmd+Shift+/ on the US `/` key, records `Mod+?`. With Control, Command or Alt, a digit-row key records its digit, so AZERTY Ctrl+& records `Mod+1`. For the few presses whose character the browser reports differently by platform, the recorder records the key's position, in brackets: Option+/ on macOS records `Alt+[Slash]`, even though it types `÷`. A recorded character such as `@` fires wherever the layout types it, which can be a different key. [Recording captures what the user pressed](../../../guides/sensible-defaults.md#recording-captures-what-the-user-pressed) lists these cases. Set `recordBy: 'code'` to record every key by position, or `recordBy: 'key'` to record the typed character. Recording by position needs a physical code, so it rejects a press that has none. The controller adds itself to the element, requests an update whenever its state changes, and has the recorder's state and controls: diff --git a/docs/framework/lit/guides/hotkey-manager.md b/docs/framework/lit/guides/hotkey-manager.md index e6539d911..4b914c3a9 100644 --- a/docs/framework/lit/guides/hotkey-manager.md +++ b/docs/framework/lit/guides/hotkey-manager.md @@ -126,7 +126,7 @@ class KeyboardOwner extends LitElement { ## Suspend character key shortcuts -Call `manager.suspendCharacterKeys()` to pause document-level hotkeys made only of keys that type a character, such as `K`, `Shift+/`, or `['G', 'H']`. Hotkeys with `Control`, `Alt`, or `Meta`, non-character keys such as `Escape`, and hotkeys targeted at an element keep working. Suspensions are counted like scope activations, so character key shortcuts stay suspended until every returned resume function runs: +Call `manager.suspendCharacterKeys()` to pause document-level hotkeys made only of keys that type a character, such as `K`, `?`, or `['G', 'H']`. Hotkeys with `Control`, `Alt`, or `Meta`, non-character keys such as `Escape`, and hotkeys targeted at an element keep working. Suspensions are counted like scope activations, so character key shortcuts stay suspended until every returned resume function runs: ```ts const resume = manager.suspendCharacterKeys() diff --git a/docs/framework/lit/guides/keyboard-layouts.md b/docs/framework/lit/guides/keyboard-layouts.md index d4abb4260..d3857e1c4 100644 --- a/docs/framework/lit/guides/keyboard-layouts.md +++ b/docs/framework/lit/guides/keyboard-layouts.md @@ -15,7 +15,7 @@ A hotkey on a key that only one layout types fires only for users of that layout - `Mod+S` fires on a Russian layout, where that key types `ы`. - `Mod+;` fires on German Ctrl+Ö and Spanish Ctrl+Ñ, which sit in the same position. - On Greek, Cyrillic, and Hebrew layouts, bind `Mod+A`, not `Mod+Ф`. It fires on the same key, and keeps working after the user switches to a Latin layout. -- US punctuation that a layout types with Shift, such as `/` on German, can't match while Command is held on macOS. [Sensible Defaults](../../../guides/sensible-defaults.md#keys-match-the-character-the-user-types) explains why, and which hotkey to add. +- A US symbol that a layout types with Shift, such as `/` on German, can't match while Command is held on macOS. [Sensible Defaults](../../../guides/sensible-defaults.md#keys-match-the-character-the-user-types) explains why, and which hotkey to add. Register a layout when the key itself matters, such as a single-key `ß` shortcut, or a shortcut that your German interface labels with `Ö`. @@ -58,7 +58,7 @@ search() {} - The sets replace the US keys. Keep `UsKeys` in the union to keep them. With `keys: GermanKeys` alone, `Mod+[` is a type error, because German types `[` only with AltGr or Option. - A to Z, 0 to 9, named keys such as `Escape` and `F1`, and physical codes such as `[KeyS]` type-check under every registration. - Write letters in uppercase, as you do for A to Z: `Mod+Ö`, not `Mod+ö`. `ß` and the Turkish `ı` stay as typed. -- Letters match Shift exactly. A letter that your layout types with Shift, such as Turkish `İ` or Swiss German `È`, needs Shift in the hotkey: `Shift+İ`. Symbols typed with Shift don't: German types `§` with Shift+3, and `§` matches it. +- Letters match Shift exactly. A letter that your layout types with Shift, such as Turkish `İ` or Swiss German `È`, needs Shift in the hotkey: `Shift+İ`. Symbols typed with Shift don't: German types `§` with Shift+3, and `§` matches it. The types reject `Shift+§`, as they reject `Shift` with any symbol. - The recorder records whatever the user presses, which can be a key outside your registered sets. ## Available key sets diff --git a/docs/framework/octane/guides/choosing-valid-hotkeys.md b/docs/framework/octane/guides/choosing-valid-hotkeys.md new file mode 100644 index 000000000..d80928add --- /dev/null +++ b/docs/framework/octane/guides/choosing-valid-hotkeys.md @@ -0,0 +1,214 @@ +--- +title: Choosing Valid Hotkeys in Octane +id: choosing-valid-hotkeys +description: Why TanStack Hotkeys rejects some hotkey strings, such as Shift+/, what to write instead, and which shortcuts the browser or operating system takes before your Octane app sees them. +--- + +You write a hotkey on your keyboard, and your users press it on theirs. Their keyboard can have another layout, another operating system, and another browser, and each of those can change what a key press means. A shortcut that works on your machine can fire on the wrong key for a German user, or never fire for someone on a Mac. + +TanStack Hotkeys absorbs most of these differences at runtime. A few it can't, because the hotkey string itself means more than one thing. For those, the types reject the string while you write it, so you find out in your editor and not from a bug report. This guide explains why those strings are rejected and what to write instead. It also covers the shortcuts no string can fix, because the browser or the operating system handles them before your app does. + +## Why `Shift+/` is a type error + +Say you want `?` to open a help dialog. On a US keyboard you type `?` with Shift and the `/` key, so you write down what you press: + +```tsx +useHotkey('Shift+/', openHelp) // Type error +``` + +TypeScript rejects it. That can feel strict, since the string looks reasonable and would work on your keyboard. The problem shows up on other keyboards. + +A hotkey string names characters, and layouts put `/` and `?` on different keys. On a German keyboard, `/` is Shift+7 and `?` is Shift+ß. There, `Shift+/` can be read two ways: + +- You meant `?`, the character that US Shift+/ types. The library reads it that way, so German Shift+ß fires it. +- The string also says "Shift and `/`", and German Shift+7 is exactly that. So a German user who types a plain `/` fires it too. + +If your app binds `/` to search as well, that German user gets your help dialog instead of search, because an exact Shift match ranks above `/`. The library can't tell which reading you meant. Only you know that, so the types ask you to say it. + +When you mean the character, write the character: + +```tsx +import { useHotkey } from '@tanstack/octane-hotkeys' + +function Help() @{ + // Fires on whatever key types `?` on the user's layout + useHotkey('?', () => openHelp()) + + +} +``` + +`?` means the same thing on every layout. It fires on Shift+/ on a US keyboard and on Shift+ß on a German one, and the matcher takes care of the Shift the user needs to type it. + +When you mean the key's position, name the physical key. `Shift+[Slash]` is Shift with the key that US keyboards label `/`, whatever that key types on the user's layout. + +### Why letters and digits keep Shift + +Shift changes a letter's case, not which letter it is. `Shift+K` names the same key on every layout, so the types allow it. The Shift matters there too: `K` and `Shift+K` are two different shortcuts. + +Digits are safe for another reason. The matcher reads the digit row by position, so `Shift+1` fires on the key that types `1` on every layout. That includes French AZERTY, where the key types `&` without Shift. + +A symbol gets neither guarantee. Which symbol Shift adds to a key is up to the layout. + +### What can follow Shift + +After `Shift`, with or without other modifiers, a hotkey string takes a letter, a digit, a named key such as `Tab`, or a physical code such as `[Slash]`. A symbol after Shift is a type error: + +```tsx +useHotkey('Shift+/', openHelp) // Type error +useHotkey('?', openHelp) // OK +useHotkey('Control+?', openHelp) // OK, fires on Control+Shift+/ on a US keyboard +useHotkey('Shift+[Slash]', openHelp) // OK, the physical key +useHotkey('Mod+Shift+/', openHelp) // Type error +useHotkey('Mod+?', openHelp) // OK +``` + +The same rule covers letters from [registered keyboard layouts](./keyboard-layouts): `Shift+Ä` is allowed, and `Shift+§` is a type error. + +The rule lives only in the types. A string from storage or user settings, such as a saved `'Shift+/'`, still matches as it did before, so shortcuts your users already saved keep working. + +## Mod with a symbol doesn't reach every Mac + +`Mod+?` is how you write Control+Shift+/ on Windows and Command+Shift+/ on macOS. On Windows and Linux it fires on every layout. macOS is less predictable. + +With Command held, macOS reports a different character for some keys than the one they type. Command+Shift on the key that types `?` reports `/` on German and Dvorak, `'` on Spanish, and `+` on Swedish. So `Mod+?` doesn't fire on those Mac layouts, while it does on US, UK, French, and Italian Macs. + +No symbol spelling covers that press on every Mac layout. When a shortcut has to work for everyone, such as the one that opens your command palette, give it a letter or a digit, such as `Mod+Shift+K` or `Mod+Shift+1`. To bind a key by position, use its physical code, such as `Mod+Shift+[Slash]`. + +[Keys match the character the user types](../../../guides/sensible-defaults.md#keys-match-the-character-the-user-types) has the details of how Command changes the reported key. + +## Replace a Shift string you already wrote + +When existing code has `Shift+` with a symbol, the right replacement depends on the keyboard it was written on, because whoever wrote it wrote what their keyboard typed. `Shift+,` types `<` on a US keyboard, `;` on a German one, and `?` on a French one. Find the string in the first column, then take the replacement from the column for the layout it was written on: + +| Ambiguous | US QWERTY | German | French AZERTY | +| --- | --- | --- | --- | +| `` Shift+` `` | `~` | `` ` `` | `` ` `` | +| `Shift+-` | `_` | `_` | `6` | +| `Shift+=` | `+` | `=` | `+` | +| `Shift+[` | `{` | `[` | `[` | +| `Shift+]` | `}` | `]` | `]` | +| `Shift+\` | `\|` | `\` | `\` | +| `Shift+;` | `:` | `;` | `.` | +| `Shift+'` | `"` | `'` | `4` | +| `Shift+,` | `<` | `;` | `?` | +| `Shift+.` | `>` | `:` | `.` | +| `Shift+/` | `?` | `/` | `/` | +| `Shift+_` | `_` | `_` | `8` | +| `Shift++` | `+` | `*` | `+` | +| `Shift+:` | `:` | `:` | `/` | +| `Shift+"` | `"` | `"` | `3` | +| `Shift+<` | `<` | `>` | `>` | +| `Shift+!` | `!` | `!` | `§` | +| `Shift+#` | `#` | `'` | `#` | +| `Shift+$` | `$` | `$` | `£` | +| `Shift+&` | `&` | `&` | `1` | +| `Shift+*` | `*` | `*` | `Shift+[Backslash]` | +| `Shift+(` | `(` | `(` | `5` | +| `Shift+)` | `)` | `)` | `°` | + +Each cell is what Shift and that key type on that layout. When the layout has no key that types the symbol without Shift, the replacement is the symbol itself. German `/` is Shift+7, so a German developer who wrote `Shift+/` meant `/`. + +A few more rules for reading the table: + +- The table leaves out strings whose replacement is the same symbol on all three layouts, such as `Shift+?` and `Shift+@`. Write the symbol: `?` or `@`. +- With other modifiers, keep them and use the same replacement. On a US keyboard, `Control+Shift+/` becomes `Control+?`, and `Mod+Shift+/` becomes `Mod+?`. +- French `µ` isn't in `FrenchKeys`, so its cell names the key by position instead. +- The German and French columns use the Windows layouts. The Mac layouts place some symbols differently. + +To keep a key's position instead of its character, use Shift with the key's physical code, such as `Shift+[Slash]`. + +## Physical codes name a key, not a character + +Use a physical code when the key's position matters more than its label, such as keys arranged in a row for a game or a drawing tool. The catch is the label. On other layouts the key types something else, so a hint that shows the US symbol can be wrong for those users. Shift and these codes type: + +| Physical code | US QWERTY | US Dvorak | German | +| --- | --- | --- | --- | +| `Shift+[Backquote]` | `~` | `~` | `°` | +| `Shift+[Minus]` | `_` | `{` | `?` | +| `Shift+[Equal]` | `+` | `}` | a dead key | +| `Shift+[BracketLeft]` | `{` | `?` | `Ü` | +| `Shift+[BracketRight]` | `}` | `+` | `*` | +| `Shift+[Backslash]` | `\|` | `\|` | `'` | +| `Shift+[Semicolon]` | `:` | `S` | `Ö` | +| `Shift+[Quote]` | `"` | `_` | `Ä` | +| `Shift+[Comma]` | `<` | `W` | `;` | +| `Shift+[Period]` | `>` | `V` | `:` | +| `Shift+[Slash]` | `?` | `Z` | `_` | + +When you pass a layout map, [`formatForDisplay`](./formatting-display) labels a physical code with the key's character on the user's layout. On a German keyboard, `Shift+[Slash]` shows as `Shift+-`. Without a layout map, which only Chromium browsers provide, the label is the US character for that position. + +## Some shortcuts belong to the browser or the operating system + +Some chords never reach your page. The browser or the operating system handles them first, so your handler doesn't run, and the user gets the browser's action instead. + +The types still accept these chords, and that's deliberate. The same chord can be free in an installed web app, in fullscreen, or in Electron. The types can't know where your app runs, but you do. + +### Browser tab shortcuts + +In a normal browser tab, these chords open, close, or switch tabs and windows. Chrome reserves them. The Firefox and Safari columns come from their source and bug reports, so treat a blank cell as unconfirmed, not as free: + +| Chord | Action | Chrome | Firefox | Safari | +| --- | --- | --- | --- | --- | +| `Mod+W` | Close tab | Reserved | Reserved | Reported reserved | +| `Mod+T` | New tab | Reserved | Reserved | Reported reserved | +| `Mod+N` | New window | Reserved | Reserved | Reported reserved | +| `Mod+Shift+W` | Close window | Reserved | Reserved | | +| `Mod+Shift+T` | Reopen closed tab | Reserved | | | +| `Mod+Shift+N` | New private window | Reserved | | | +| `Control+Tab`, `Control+Shift+Tab` | Next and previous tab | Reserved | Reported reserved | Reported reserved | +| `Control+PageUp`, `Control+PageDown` | Next and previous tab, Windows and Linux | Reserved | | | +| `Mod+Q` | Quit, macOS | Reserved | Not reserved | Reported reserved | + +Chrome reserves none of these in an installed web app window, and in fullscreen it keeps only the keys that leave fullscreen. If your app runs in a browser tab, pick other chords for its own actions. + +### Operating system shortcuts + +Each operating system keeps a few chords for itself. A chord is lost only on the system that keeps it: + +- **Windows.** Control+Alt+Delete, and most chords with the Windows key (`Meta`), such as Windows+L. +- **macOS.** Command+Tab, Command+Space, and Command+Option+Escape. +- **Linux.** Control+Alt+F1 through F12 switch to another virtual terminal. Desktops such as GNOME also take many chords with the Super key. + +Users can change many of these, so no list is complete. Prefer `Mod`, `Shift`, and `Alt` chords over `Meta` chords, which Windows mostly keeps. + +### Chords that can't fire on some layouts + +A few chords type a character the hotkey doesn't name, so they never fire on some layouts: + +- **Option with a shifted symbol on a US Mac.** Option+Shift+/ types `¿`, not `?`, so `Alt+?` and `Mod+Alt+?` never fire on a US Mac. Use the physical code instead, such as `Alt+Shift+[Slash]`. +- **Control+Alt on layouts with AltGr.** Windows treats Control+Alt as AltGr. On a German keyboard, Control+Alt+Q types `@`, so `Control+Alt+Q` never fires, and an `@` binding does. + +## Let users choose their own shortcuts + +The most reliable shortcut is often the one a user picks on their own keyboard. The [hotkey recorder](./custom-hotkey-recording) follows the rules in this guide for you: + +- It records only presses that reach the page, so in a browser tab it never records the browser and operating system chords above. +- It never writes Shift with a symbol. Shift+/ records `?`, and German Shift+7 records `/`. +- On a Mac with Command held, off the key's US position, the browser may not report the symbol the user typed. There the recorder records the key's physical code: Dvorak Command+Shift+/ records `Mod+Shift+[BracketLeft]`. + +A recorded hotkey can still fail on another machine. `Alt+F4` recorded on a Mac closes the window on Windows. See [Save hotkeys that work on another platform](./custom-hotkey-recording#save-hotkeys-that-work-on-another-platform) to keep synced hotkeys portable. + +To reject chords you don't want, such as the browser tab shortcuts in an Electron app that also ships to the web, return an error from `validate`: + +```tsx +import { useHotkeyRecorder } from '@tanstack/octane-hotkeys' + +const browserTabShortcuts = new Set([ + 'Mod+W', + 'Mod+T', + 'Mod+N', + 'Mod+Shift+N', + 'Mod+Shift+T', + 'Mod+Shift+W', +]) + +function ShortcutInput({ onSave }: { onSave: (hotkey: string) => void }) @{ + const recorder = useHotkeyRecorder({ + validate: (hotkey) => + !browserTabShortcuts.has(hotkey) || 'The browser uses this shortcut.', + onRecord: onSave, + }) + // ... +} +``` diff --git a/docs/framework/octane/guides/custom-hotkey-recording.md b/docs/framework/octane/guides/custom-hotkey-recording.md index a511ee03b..0ca70a798 100644 --- a/docs/framework/octane/guides/custom-hotkey-recording.md +++ b/docs/framework/octane/guides/custom-hotkey-recording.md @@ -36,7 +36,7 @@ function ShortcutRecorder() @{ } ``` -With the default `recordBy: 'auto'`, the recorder outputs portable strings just like you write by hand: `Mod+S` for Command+S on macOS or Control+S on Windows and Linux. It records what the press typed (`?` for Shift+/, `Mod+1` for AZERTY Ctrl+&), and falls back to physical bracketed codes for the few presses whose character the browser reports differently by platform, such as `Alt+[Slash]` for macOS Option+/. A recorded character such as `@` fires wherever the layout types it, which can be a different key. See [Recording captures what the user pressed](../../../guides/sensible-defaults.md#recording-captures-what-the-user-pressed) for the full rules, or set `recordBy: 'code'` (always physical) or `recordBy: 'key'` (always typed character). +With the default `recordBy: 'auto'`, the recorder outputs portable strings just like you write by hand: `Mod+S` for Command+S on macOS or Control+S on Windows and Linux. It records what the press typed (`?` for Shift+/, `Mod+1` for AZERTY Ctrl+&), and falls back to physical bracketed codes for the few presses whose character the browser reports differently by platform, such as `Alt+[Slash]` for macOS Option+/. A recorded character such as `@` fires wherever the layout types it, which can be a different key. See [Recording captures what the user pressed](../../../guides/sensible-defaults.md#recording-captures-what-the-user-pressed) for the full rules, or set `recordBy: 'code'` (always physical) or `recordBy: 'key'` (typed character). | Property or method | Description | | --- | --- | diff --git a/docs/framework/octane/guides/hotkey-manager.md b/docs/framework/octane/guides/hotkey-manager.md index 67689352f..5e9b27c02 100644 --- a/docs/framework/octane/guides/hotkey-manager.md +++ b/docs/framework/octane/guides/hotkey-manager.md @@ -121,7 +121,7 @@ function KeyboardOwner() @{ ## Suspend character key shortcuts -Call `manager.suspendCharacterKeys()` to pause document-level hotkeys made only of keys that type a character, such as `K`, `Shift+/`, or `['G', 'H']`. Hotkeys with `Control`, `Alt`, or `Meta`, non-character keys such as `Escape`, and hotkeys targeted at an element keep working. Suspensions are counted like scope activations, so character key shortcuts stay suspended until every returned resume function runs: +Call `manager.suspendCharacterKeys()` to pause document-level hotkeys made only of keys that type a character, such as `K`, `?`, or `['G', 'H']`. Hotkeys with `Control`, `Alt`, or `Meta`, non-character keys such as `Escape`, and hotkeys targeted at an element keep working. Suspensions are counted like scope activations, so character key shortcuts stay suspended until every returned resume function runs: ```ts const resume = manager.suspendCharacterKeys() diff --git a/docs/framework/octane/guides/keyboard-layouts.md b/docs/framework/octane/guides/keyboard-layouts.md index 809dbcdbe..710b3719c 100644 --- a/docs/framework/octane/guides/keyboard-layouts.md +++ b/docs/framework/octane/guides/keyboard-layouts.md @@ -15,7 +15,7 @@ Most apps never need to register extra layouts. A to Z, 0 to 9, and common US pu - `Mod+S` matches on a Russian keyboard, where that key types `ы`. - `Mod+;` matches on German `Ctrl+Ö` and Spanish `Ctrl+Ñ` in the same physical slot. - On Greek, Cyrillic, and Hebrew layouts, prefer `Mod+A` over `Mod+Ф`. It matches on the same key and keeps working if the user toggles back to Latin. -- Punctuation that another layout types with `Shift`, such as `/` on German QWERTZ, can't match with `Command` held on macOS. See [Keys match the character the user types](../../../guides/sensible-defaults.md#keys-match-the-character-the-user-types) for why and how to add the shifted fallback. +- A symbol that another layout types with `Shift`, such as `/` on German QWERTZ, can't match with `Command` held on macOS. See [Keys match the character the user types](../../../guides/sensible-defaults.md#keys-match-the-character-the-user-types) for why and how to add the shifted fallback. Register layout sets only when you intentionally target keys unique to specific layouts, such as a single-key `ß` shortcut or shortcuts labeled with `Ö` in a localized UI. @@ -51,7 +51,7 @@ All hooks (`useHotkeys`, `useHotkeyHint`, `useFormatForDisplay`), app hotkeys, c - **Replaces `UsKeys` unless kept.** Include `UsKeys` in the union if you still want US punctuation like `[`. With `keys: GermanKeys` alone, `Mod+[` fails type-checking because German types `[` with `AltGr` or `Option`. - **Always allowed.** A to Z, 0 to 9, named keys (`Escape`, `F1`), and physical codes (`[KeyS]`) work under every registration. - **Casing.** Write letters uppercase (`Mod+Ö`, not `Mod+ö`), leaving `ß` and Turkish dotless `ı` as typed. -- **Shift-typed characters.** Layout letters typed with `Shift`, such as Turkish `İ` or Swiss German `È`, require `Shift+` (`Shift+İ`). Shift-typed symbols like `§` (via `Shift+3` on German) match without `Shift+`. +- **Shift-typed characters.** Layout letters typed with `Shift`, such as Turkish `İ` or Swiss German `È`, require `Shift+` (`Shift+İ`). Shift-typed symbols like `§` (via `Shift+3` on German) match without `Shift+`, and the types reject `Shift+§`, as they reject `Shift` with any symbol. - **Recorder.** `useHotkeyRecorder` captures whatever key the user presses, even outside your registered TypeScript union. ## Available key sets diff --git a/docs/framework/preact/guides/choosing-valid-hotkeys.md b/docs/framework/preact/guides/choosing-valid-hotkeys.md new file mode 100644 index 000000000..a875c3bcb --- /dev/null +++ b/docs/framework/preact/guides/choosing-valid-hotkeys.md @@ -0,0 +1,213 @@ +--- +title: Choosing Valid Hotkeys in Preact +id: choosing-valid-hotkeys +description: Why TanStack Hotkeys rejects some hotkey strings, such as Shift+/, what to write instead, and which shortcuts the browser or operating system takes before your Preact app sees them. +--- + +You write a hotkey on your keyboard, and your users press it on theirs. Their keyboard can have another layout, another operating system, and another browser, and each of those can change what a key press means. A shortcut that works on your machine can fire on the wrong key for a German user, or never fire for someone on a Mac. + +TanStack Hotkeys absorbs most of these differences at runtime. A few it can't, because the hotkey string itself means more than one thing. For those, the types reject the string while you write it, so you find out in your editor and not from a bug report. This guide explains why those strings are rejected and what to write instead. It also covers the shortcuts no string can fix, because the browser or the operating system handles them before your app does. + +## Why `Shift+/` is a type error + +Say you want `?` to open a help dialog. On a US keyboard you type `?` with Shift and the `/` key, so you write down what you press: + +```tsx +useHotkey('Shift+/', openHelp) // Type error +``` + +TypeScript rejects it. That can feel strict, since the string looks reasonable and would work on your keyboard. The problem shows up on other keyboards. + +A hotkey string names characters, and layouts put `/` and `?` on different keys. On a German keyboard, `/` is Shift+7 and `?` is Shift+ß. There, `Shift+/` can be read two ways: + +- You meant `?`, the character that US Shift+/ types. The library reads it that way, so German Shift+ß fires it. +- The string also says "Shift and `/`", and German Shift+7 is exactly that. So a German user who types a plain `/` fires it too. + +If your app binds `/` to search as well, that German user gets your help dialog instead of search, because an exact Shift match ranks above `/`. The library can't tell which reading you meant. Only you know that, so the types ask you to say it. + +When you mean the character, write the character: + +```tsx +import { useHotkey } from '@tanstack/preact-hotkeys' + +function Help() { + // Fires on whatever key types `?` on the user's layout + useHotkey('?', () => openHelp()) + return null +} +``` + +`?` means the same thing on every layout. It fires on Shift+/ on a US keyboard and on Shift+ß on a German one, and the matcher takes care of the Shift the user needs to type it. + +When you mean the key's position, name the physical key. `Shift+[Slash]` is Shift with the key that US keyboards label `/`, whatever that key types on the user's layout. + +### Why letters and digits keep Shift + +Shift changes a letter's case, not which letter it is. `Shift+K` names the same key on every layout, so the types allow it. The Shift matters there too: `K` and `Shift+K` are two different shortcuts. + +Digits are safe for another reason. The matcher reads the digit row by position, so `Shift+1` fires on the key that types `1` on every layout. That includes French AZERTY, where the key types `&` without Shift. + +A symbol gets neither guarantee. Which symbol Shift adds to a key is up to the layout. + +### What can follow Shift + +After `Shift`, with or without other modifiers, a hotkey string takes a letter, a digit, a named key such as `Tab`, or a physical code such as `[Slash]`. A symbol after Shift is a type error: + +```tsx +useHotkey('Shift+/', openHelp) // Type error +useHotkey('?', openHelp) // OK +useHotkey('Control+?', openHelp) // OK, fires on Control+Shift+/ on a US keyboard +useHotkey('Shift+[Slash]', openHelp) // OK, the physical key +useHotkey('Mod+Shift+/', openHelp) // Type error +useHotkey('Mod+?', openHelp) // OK +``` + +The same rule covers letters from [registered keyboard layouts](./keyboard-layouts): `Shift+Ä` is allowed, and `Shift+§` is a type error. + +The rule lives only in the types. A string from storage or user settings, such as a saved `'Shift+/'`, still matches as it did before, so shortcuts your users already saved keep working. + +## Mod with a symbol doesn't reach every Mac + +`Mod+?` is how you write Control+Shift+/ on Windows and Command+Shift+/ on macOS. On Windows and Linux it fires on every layout. macOS is less predictable. + +With Command held, macOS reports a different character for some keys than the one they type. Command+Shift on the key that types `?` reports `/` on German and Dvorak, `'` on Spanish, and `+` on Swedish. So `Mod+?` doesn't fire on those Mac layouts, while it does on US, UK, French, and Italian Macs. + +No symbol spelling covers that press on every Mac layout. When a shortcut has to work for everyone, such as the one that opens your command palette, give it a letter or a digit, such as `Mod+Shift+K` or `Mod+Shift+1`. To bind a key by position, use its physical code, such as `Mod+Shift+[Slash]`. + +[Keys match the character the user types](../../../guides/sensible-defaults.md#keys-match-the-character-the-user-types) has the details of how Command changes the reported key. + +## Replace a Shift string you already wrote + +When existing code has `Shift+` with a symbol, the right replacement depends on the keyboard it was written on, because whoever wrote it wrote what their keyboard typed. `Shift+,` types `<` on a US keyboard, `;` on a German one, and `?` on a French one. Find the string in the first column, then take the replacement from the column for the layout it was written on: + +| Ambiguous | US QWERTY | German | French AZERTY | +| --- | --- | --- | --- | +| `` Shift+` `` | `~` | `` ` `` | `` ` `` | +| `Shift+-` | `_` | `_` | `6` | +| `Shift+=` | `+` | `=` | `+` | +| `Shift+[` | `{` | `[` | `[` | +| `Shift+]` | `}` | `]` | `]` | +| `Shift+\` | `\|` | `\` | `\` | +| `Shift+;` | `:` | `;` | `.` | +| `Shift+'` | `"` | `'` | `4` | +| `Shift+,` | `<` | `;` | `?` | +| `Shift+.` | `>` | `:` | `.` | +| `Shift+/` | `?` | `/` | `/` | +| `Shift+_` | `_` | `_` | `8` | +| `Shift++` | `+` | `*` | `+` | +| `Shift+:` | `:` | `:` | `/` | +| `Shift+"` | `"` | `"` | `3` | +| `Shift+<` | `<` | `>` | `>` | +| `Shift+!` | `!` | `!` | `§` | +| `Shift+#` | `#` | `'` | `#` | +| `Shift+$` | `$` | `$` | `£` | +| `Shift+&` | `&` | `&` | `1` | +| `Shift+*` | `*` | `*` | `Shift+[Backslash]` | +| `Shift+(` | `(` | `(` | `5` | +| `Shift+)` | `)` | `)` | `°` | + +Each cell is what Shift and that key type on that layout. When the layout has no key that types the symbol without Shift, the replacement is the symbol itself. German `/` is Shift+7, so a German developer who wrote `Shift+/` meant `/`. + +A few more rules for reading the table: + +- The table leaves out strings whose replacement is the same symbol on all three layouts, such as `Shift+?` and `Shift+@`. Write the symbol: `?` or `@`. +- With other modifiers, keep them and use the same replacement. On a US keyboard, `Control+Shift+/` becomes `Control+?`, and `Mod+Shift+/` becomes `Mod+?`. +- French `µ` isn't in `FrenchKeys`, so its cell names the key by position instead. +- The German and French columns use the Windows layouts. The Mac layouts place some symbols differently. + +To keep a key's position instead of its character, use Shift with the key's physical code, such as `Shift+[Slash]`. + +## Physical codes name a key, not a character + +Use a physical code when the key's position matters more than its label, such as keys arranged in a row for a game or a drawing tool. The catch is the label. On other layouts the key types something else, so a hint that shows the US symbol can be wrong for those users. Shift and these codes type: + +| Physical code | US QWERTY | US Dvorak | German | +| --- | --- | --- | --- | +| `Shift+[Backquote]` | `~` | `~` | `°` | +| `Shift+[Minus]` | `_` | `{` | `?` | +| `Shift+[Equal]` | `+` | `}` | a dead key | +| `Shift+[BracketLeft]` | `{` | `?` | `Ü` | +| `Shift+[BracketRight]` | `}` | `+` | `*` | +| `Shift+[Backslash]` | `\|` | `\|` | `'` | +| `Shift+[Semicolon]` | `:` | `S` | `Ö` | +| `Shift+[Quote]` | `"` | `_` | `Ä` | +| `Shift+[Comma]` | `<` | `W` | `;` | +| `Shift+[Period]` | `>` | `V` | `:` | +| `Shift+[Slash]` | `?` | `Z` | `_` | + +When you pass a layout map, [`formatForDisplay`](./formatting-display) labels a physical code with the key's character on the user's layout. On a German keyboard, `Shift+[Slash]` shows as `Shift+-`. Without a layout map, which only Chromium browsers provide, the label is the US character for that position. + +## Some shortcuts belong to the browser or the operating system + +Some chords never reach your page. The browser or the operating system handles them first, so your handler doesn't run, and the user gets the browser's action instead. + +The types still accept these chords, and that's deliberate. The same chord can be free in an installed web app, in fullscreen, or in Electron. The types can't know where your app runs, but you do. + +### Browser tab shortcuts + +In a normal browser tab, these chords open, close, or switch tabs and windows. Chrome reserves them. The Firefox and Safari columns come from their source and bug reports, so treat a blank cell as unconfirmed, not as free: + +| Chord | Action | Chrome | Firefox | Safari | +| --- | --- | --- | --- | --- | +| `Mod+W` | Close tab | Reserved | Reserved | Reported reserved | +| `Mod+T` | New tab | Reserved | Reserved | Reported reserved | +| `Mod+N` | New window | Reserved | Reserved | Reported reserved | +| `Mod+Shift+W` | Close window | Reserved | Reserved | | +| `Mod+Shift+T` | Reopen closed tab | Reserved | | | +| `Mod+Shift+N` | New private window | Reserved | | | +| `Control+Tab`, `Control+Shift+Tab` | Next and previous tab | Reserved | Reported reserved | Reported reserved | +| `Control+PageUp`, `Control+PageDown` | Next and previous tab, Windows and Linux | Reserved | | | +| `Mod+Q` | Quit, macOS | Reserved | Not reserved | Reported reserved | + +Chrome reserves none of these in an installed web app window, and in fullscreen it keeps only the keys that leave fullscreen. If your app runs in a browser tab, pick other chords for its own actions. + +### Operating system shortcuts + +Each operating system keeps a few chords for itself. A chord is lost only on the system that keeps it: + +- **Windows.** Control+Alt+Delete, and most chords with the Windows key (`Meta`), such as Windows+L. +- **macOS.** Command+Tab, Command+Space, and Command+Option+Escape. +- **Linux.** Control+Alt+F1 through F12 switch to another virtual terminal. Desktops such as GNOME also take many chords with the Super key. + +Users can change many of these, so no list is complete. Prefer `Mod`, `Shift`, and `Alt` chords over `Meta` chords, which Windows mostly keeps. + +### Chords that can't fire on some layouts + +A few chords type a character the hotkey doesn't name, so they never fire on some layouts: + +- **Option with a shifted symbol on a US Mac.** Option+Shift+/ types `¿`, not `?`, so `Alt+?` and `Mod+Alt+?` never fire on a US Mac. Use the physical code instead, such as `Alt+Shift+[Slash]`. +- **Control+Alt on layouts with AltGr.** Windows treats Control+Alt as AltGr. On a German keyboard, Control+Alt+Q types `@`, so `Control+Alt+Q` never fires, and an `@` binding does. + +## Let users choose their own shortcuts + +The most reliable shortcut is often the one a user picks on their own keyboard. The [hotkey recorder](./custom-hotkey-recording) follows the rules in this guide for you: + +- It records only presses that reach the page, so in a browser tab it never records the browser and operating system chords above. +- It never writes Shift with a symbol. Shift+/ records `?`, and German Shift+7 records `/`. +- On a Mac with Command held, off the key's US position, the browser may not report the symbol the user typed. There the recorder records the key's physical code: Dvorak Command+Shift+/ records `Mod+Shift+[BracketLeft]`. + +A recorded hotkey can still fail on another machine. `Alt+F4` recorded on a Mac closes the window on Windows. See [Save hotkeys that work on another platform](./custom-hotkey-recording#save-hotkeys-that-work-on-another-platform) to keep synced hotkeys portable. + +To reject chords you don't want, such as the browser tab shortcuts in an Electron app that also ships to the web, return an error from `validate`: + +```tsx +import { useHotkeyRecorder } from '@tanstack/preact-hotkeys' + +const browserTabShortcuts = new Set([ + 'Mod+W', + 'Mod+T', + 'Mod+N', + 'Mod+Shift+N', + 'Mod+Shift+T', + 'Mod+Shift+W', +]) + +function ShortcutInput({ onSave }: { onSave: (hotkey: string) => void }) { + const recorder = useHotkeyRecorder({ + validate: (hotkey) => + !browserTabShortcuts.has(hotkey) || 'The browser uses this shortcut.', + onRecord: onSave, + }) + // ... +} +``` diff --git a/docs/framework/preact/guides/custom-hotkey-recording.md b/docs/framework/preact/guides/custom-hotkey-recording.md index d27357fdd..f91c7d69c 100644 --- a/docs/framework/preact/guides/custom-hotkey-recording.md +++ b/docs/framework/preact/guides/custom-hotkey-recording.md @@ -37,7 +37,7 @@ function ShortcutRecorder() { } ``` -With the default `recordBy: 'auto'`, the recorder outputs portable strings just like you write by hand: `Mod+S` for Command+S on macOS or Control+S on Windows and Linux. It records what the press typed (`?` for Shift+/, `Mod+1` for AZERTY Ctrl+&), and falls back to physical bracketed codes for the few presses whose character the browser reports differently by platform, such as `Alt+[Slash]` for macOS Option+/. A recorded character such as `@` fires wherever the layout types it, which can be a different key. See [Recording captures what the user pressed](../../../guides/sensible-defaults.md#recording-captures-what-the-user-pressed) for the full rules, or set `recordBy: 'code'` (always physical) or `recordBy: 'key'` (always typed character). +With the default `recordBy: 'auto'`, the recorder outputs portable strings just like you write by hand: `Mod+S` for Command+S on macOS or Control+S on Windows and Linux. It records what the press typed (`?` for Shift+/, `Mod+1` for AZERTY Ctrl+&), and falls back to physical bracketed codes for the few presses whose character the browser reports differently by platform, such as `Alt+[Slash]` for macOS Option+/. A recorded character such as `@` fires wherever the layout types it, which can be a different key. See [Recording captures what the user pressed](../../../guides/sensible-defaults.md#recording-captures-what-the-user-pressed) for the full rules, or set `recordBy: 'code'` (always physical) or `recordBy: 'key'` (typed character). | Property or method | Description | | --- | --- | diff --git a/docs/framework/preact/guides/hotkey-manager.md b/docs/framework/preact/guides/hotkey-manager.md index b292f5ad8..4d98e1a17 100644 --- a/docs/framework/preact/guides/hotkey-manager.md +++ b/docs/framework/preact/guides/hotkey-manager.md @@ -121,7 +121,7 @@ The [devtools](../../../devtools) display the same live scope state without writ ## Suspend character key shortcuts -Call `manager.suspendCharacterKeys()` to pause document-level hotkeys made only of keys that type a character, such as `K`, `Shift+/`, or `['G', 'H']`. Hotkeys with `Control`, `Alt`, or `Meta`, non-character keys such as `Escape`, and hotkeys targeted at an element keep working. Suspensions are counted like scope activations, so character key shortcuts stay suspended until every returned resume function runs: +Call `manager.suspendCharacterKeys()` to pause document-level hotkeys made only of keys that type a character, such as `K`, `?`, or `['G', 'H']`. Hotkeys with `Control`, `Alt`, or `Meta`, non-character keys such as `Escape`, and hotkeys targeted at an element keep working. Suspensions are counted like scope activations, so character key shortcuts stay suspended until every returned resume function runs: ```ts const resume = manager.suspendCharacterKeys() diff --git a/docs/framework/preact/guides/keyboard-layouts.md b/docs/framework/preact/guides/keyboard-layouts.md index b580d152a..75fec0595 100644 --- a/docs/framework/preact/guides/keyboard-layouts.md +++ b/docs/framework/preact/guides/keyboard-layouts.md @@ -15,7 +15,7 @@ Most apps never need to register extra layouts. A to Z, 0 to 9, and common US pu - `Mod+S` matches on a Russian keyboard, where that key types `ы`. - `Mod+;` matches on German `Ctrl+Ö` and Spanish `Ctrl+Ñ` in the same physical slot. - On Greek, Cyrillic, and Hebrew layouts, prefer `Mod+A` over `Mod+Ф`. It matches on the same key and keeps working if the user toggles back to Latin. -- Punctuation that another layout types with `Shift`, such as `/` on German QWERTZ, can't match with `Command` held on macOS. See [Keys match the character the user types](../../../guides/sensible-defaults.md#keys-match-the-character-the-user-types) for why and how to add the shifted fallback. +- A symbol that another layout types with `Shift`, such as `/` on German QWERTZ, can't match with `Command` held on macOS. See [Keys match the character the user types](../../../guides/sensible-defaults.md#keys-match-the-character-the-user-types) for why and how to add the shifted fallback. Register layout sets only when you intentionally target keys unique to specific layouts, such as a single-key `ß` shortcut or shortcuts labeled with `Ö` in a localized UI. @@ -49,7 +49,7 @@ All hooks (`useHotkeys`, `useHotkeyHint`, `useFormatForDisplay`), app hotkeys, c - **Replaces `UsKeys` unless kept.** Include `UsKeys` in the union if you still want US punctuation like `[`. With `keys: GermanKeys` alone, `Mod+[` fails type-checking because German types `[` with `AltGr` or `Option`. - **Always allowed.** A to Z, 0 to 9, named keys (`Escape`, `F1`), and physical codes (`[KeyS]`) work under every registration. - **Casing.** Write letters uppercase (`Mod+Ö`, not `Mod+ö`), leaving `ß` and Turkish dotless `ı` as typed. -- **Shift-typed characters.** Layout letters typed with `Shift`, such as Turkish `İ` or Swiss German `È`, require `Shift+` (`Shift+İ`). Shift-typed symbols like `§` (via `Shift+3` on German) match without `Shift+`. +- **Shift-typed characters.** Layout letters typed with `Shift`, such as Turkish `İ` or Swiss German `È`, require `Shift+` (`Shift+İ`). Shift-typed symbols like `§` (via `Shift+3` on German) match without `Shift+`, and the types reject `Shift+§`, as they reject `Shift` with any symbol. - **Recorder.** `useHotkeyRecorder` captures whatever key the user presses, even outside your registered TypeScript union. ## Available key sets diff --git a/docs/framework/react/guides/choosing-valid-hotkeys.md b/docs/framework/react/guides/choosing-valid-hotkeys.md new file mode 100644 index 000000000..0b549be87 --- /dev/null +++ b/docs/framework/react/guides/choosing-valid-hotkeys.md @@ -0,0 +1,213 @@ +--- +title: Choosing Valid Hotkeys in React +id: choosing-valid-hotkeys +description: Why TanStack Hotkeys rejects some hotkey strings, such as Shift+/, what to write instead, and which shortcuts the browser or operating system takes before your React app sees them. +--- + +You write a hotkey on your keyboard, and your users press it on theirs. Their keyboard can have another layout, another operating system, and another browser, and each of those can change what a key press means. A shortcut that works on your machine can fire on the wrong key for a German user, or never fire for someone on a Mac. + +TanStack Hotkeys absorbs most of these differences at runtime. A few it can't, because the hotkey string itself means more than one thing. For those, the types reject the string while you write it, so you find out in your editor and not from a bug report. This guide explains why those strings are rejected and what to write instead. It also covers the shortcuts no string can fix, because the browser or the operating system handles them before your app does. + +## Why `Shift+/` is a type error + +Say you want `?` to open a help dialog. On a US keyboard you type `?` with Shift and the `/` key, so you write down what you press: + +```tsx +useHotkey('Shift+/', openHelp) // Type error +``` + +TypeScript rejects it. That can feel strict, since the string looks reasonable and would work on your keyboard. The problem shows up on other keyboards. + +A hotkey string names characters, and layouts put `/` and `?` on different keys. On a German keyboard, `/` is Shift+7 and `?` is Shift+ß. There, `Shift+/` can be read two ways: + +- You meant `?`, the character that US Shift+/ types. The library reads it that way, so German Shift+ß fires it. +- The string also says "Shift and `/`", and German Shift+7 is exactly that. So a German user who types a plain `/` fires it too. + +If your app binds `/` to search as well, that German user gets your help dialog instead of search, because an exact Shift match ranks above `/`. The library can't tell which reading you meant. Only you know that, so the types ask you to say it. + +When you mean the character, write the character: + +```tsx +import { useHotkey } from '@tanstack/react-hotkeys' + +function Help() { + // Fires on whatever key types `?` on the user's layout + useHotkey('?', () => openHelp()) + return null +} +``` + +`?` means the same thing on every layout. It fires on Shift+/ on a US keyboard and on Shift+ß on a German one, and the matcher takes care of the Shift the user needs to type it. + +When you mean the key's position, name the physical key. `Shift+[Slash]` is Shift with the key that US keyboards label `/`, whatever that key types on the user's layout. + +### Why letters and digits keep Shift + +Shift changes a letter's case, not which letter it is. `Shift+K` names the same key on every layout, so the types allow it. The Shift matters there too: `K` and `Shift+K` are two different shortcuts. + +Digits are safe for another reason. The matcher reads the digit row by position, so `Shift+1` fires on the key that types `1` on every layout. That includes French AZERTY, where the key types `&` without Shift. + +A symbol gets neither guarantee. Which symbol Shift adds to a key is up to the layout. + +### What can follow Shift + +After `Shift`, with or without other modifiers, a hotkey string takes a letter, a digit, a named key such as `Tab`, or a physical code such as `[Slash]`. A symbol after Shift is a type error: + +```tsx +useHotkey('Shift+/', openHelp) // Type error +useHotkey('?', openHelp) // OK +useHotkey('Control+?', openHelp) // OK, fires on Control+Shift+/ on a US keyboard +useHotkey('Shift+[Slash]', openHelp) // OK, the physical key +useHotkey('Mod+Shift+/', openHelp) // Type error +useHotkey('Mod+?', openHelp) // OK +``` + +The same rule covers letters from [registered keyboard layouts](./keyboard-layouts): `Shift+Ä` is allowed, and `Shift+§` is a type error. + +The rule lives only in the types. A string from storage or user settings, such as a saved `'Shift+/'`, still matches as it did before, so shortcuts your users already saved keep working. + +## Mod with a symbol doesn't reach every Mac + +`Mod+?` is how you write Control+Shift+/ on Windows and Command+Shift+/ on macOS. On Windows and Linux it fires on every layout. macOS is less predictable. + +With Command held, macOS reports a different character for some keys than the one they type. Command+Shift on the key that types `?` reports `/` on German and Dvorak, `'` on Spanish, and `+` on Swedish. So `Mod+?` doesn't fire on those Mac layouts, while it does on US, UK, French, and Italian Macs. + +No symbol spelling covers that press on every Mac layout. When a shortcut has to work for everyone, such as the one that opens your command palette, give it a letter or a digit, such as `Mod+Shift+K` or `Mod+Shift+1`. To bind a key by position, use its physical code, such as `Mod+Shift+[Slash]`. + +[Keys match the character the user types](../../../guides/sensible-defaults.md#keys-match-the-character-the-user-types) has the details of how Command changes the reported key. + +## Replace a Shift string you already wrote + +When existing code has `Shift+` with a symbol, the right replacement depends on the keyboard it was written on, because whoever wrote it wrote what their keyboard typed. `Shift+,` types `<` on a US keyboard, `;` on a German one, and `?` on a French one. Find the string in the first column, then take the replacement from the column for the layout it was written on: + +| Ambiguous | US QWERTY | German | French AZERTY | +| --- | --- | --- | --- | +| `` Shift+` `` | `~` | `` ` `` | `` ` `` | +| `Shift+-` | `_` | `_` | `6` | +| `Shift+=` | `+` | `=` | `+` | +| `Shift+[` | `{` | `[` | `[` | +| `Shift+]` | `}` | `]` | `]` | +| `Shift+\` | `\|` | `\` | `\` | +| `Shift+;` | `:` | `;` | `.` | +| `Shift+'` | `"` | `'` | `4` | +| `Shift+,` | `<` | `;` | `?` | +| `Shift+.` | `>` | `:` | `.` | +| `Shift+/` | `?` | `/` | `/` | +| `Shift+_` | `_` | `_` | `8` | +| `Shift++` | `+` | `*` | `+` | +| `Shift+:` | `:` | `:` | `/` | +| `Shift+"` | `"` | `"` | `3` | +| `Shift+<` | `<` | `>` | `>` | +| `Shift+!` | `!` | `!` | `§` | +| `Shift+#` | `#` | `'` | `#` | +| `Shift+$` | `$` | `$` | `£` | +| `Shift+&` | `&` | `&` | `1` | +| `Shift+*` | `*` | `*` | `Shift+[Backslash]` | +| `Shift+(` | `(` | `(` | `5` | +| `Shift+)` | `)` | `)` | `°` | + +Each cell is what Shift and that key type on that layout. When the layout has no key that types the symbol without Shift, the replacement is the symbol itself. German `/` is Shift+7, so a German developer who wrote `Shift+/` meant `/`. + +A few more rules for reading the table: + +- The table leaves out strings whose replacement is the same symbol on all three layouts, such as `Shift+?` and `Shift+@`. Write the symbol: `?` or `@`. +- With other modifiers, keep them and use the same replacement. On a US keyboard, `Control+Shift+/` becomes `Control+?`, and `Mod+Shift+/` becomes `Mod+?`. +- French `µ` isn't in `FrenchKeys`, so its cell names the key by position instead. +- The German and French columns use the Windows layouts. The Mac layouts place some symbols differently. + +To keep a key's position instead of its character, use Shift with the key's physical code, such as `Shift+[Slash]`. + +## Physical codes name a key, not a character + +Use a physical code when the key's position matters more than its label, such as keys arranged in a row for a game or a drawing tool. The catch is the label. On other layouts the key types something else, so a hint that shows the US symbol can be wrong for those users. Shift and these codes type: + +| Physical code | US QWERTY | US Dvorak | German | +| --- | --- | --- | --- | +| `Shift+[Backquote]` | `~` | `~` | `°` | +| `Shift+[Minus]` | `_` | `{` | `?` | +| `Shift+[Equal]` | `+` | `}` | a dead key | +| `Shift+[BracketLeft]` | `{` | `?` | `Ü` | +| `Shift+[BracketRight]` | `}` | `+` | `*` | +| `Shift+[Backslash]` | `\|` | `\|` | `'` | +| `Shift+[Semicolon]` | `:` | `S` | `Ö` | +| `Shift+[Quote]` | `"` | `_` | `Ä` | +| `Shift+[Comma]` | `<` | `W` | `;` | +| `Shift+[Period]` | `>` | `V` | `:` | +| `Shift+[Slash]` | `?` | `Z` | `_` | + +When you pass a layout map, [`formatForDisplay`](./formatting-display) labels a physical code with the key's character on the user's layout. On a German keyboard, `Shift+[Slash]` shows as `Shift+-`. Without a layout map, which only Chromium browsers provide, the label is the US character for that position. + +## Some shortcuts belong to the browser or the operating system + +Some chords never reach your page. The browser or the operating system handles them first, so your handler doesn't run, and the user gets the browser's action instead. + +The types still accept these chords, and that's deliberate. The same chord can be free in an installed web app, in fullscreen, or in Electron. The types can't know where your app runs, but you do. + +### Browser tab shortcuts + +In a normal browser tab, these chords open, close, or switch tabs and windows. Chrome reserves them. The Firefox and Safari columns come from their source and bug reports, so treat a blank cell as unconfirmed, not as free: + +| Chord | Action | Chrome | Firefox | Safari | +| --- | --- | --- | --- | --- | +| `Mod+W` | Close tab | Reserved | Reserved | Reported reserved | +| `Mod+T` | New tab | Reserved | Reserved | Reported reserved | +| `Mod+N` | New window | Reserved | Reserved | Reported reserved | +| `Mod+Shift+W` | Close window | Reserved | Reserved | | +| `Mod+Shift+T` | Reopen closed tab | Reserved | | | +| `Mod+Shift+N` | New private window | Reserved | | | +| `Control+Tab`, `Control+Shift+Tab` | Next and previous tab | Reserved | Reported reserved | Reported reserved | +| `Control+PageUp`, `Control+PageDown` | Next and previous tab, Windows and Linux | Reserved | | | +| `Mod+Q` | Quit, macOS | Reserved | Not reserved | Reported reserved | + +Chrome reserves none of these in an installed web app window, and in fullscreen it keeps only the keys that leave fullscreen. If your app runs in a browser tab, pick other chords for its own actions. + +### Operating system shortcuts + +Each operating system keeps a few chords for itself. A chord is lost only on the system that keeps it: + +- **Windows.** Control+Alt+Delete, and most chords with the Windows key (`Meta`), such as Windows+L. +- **macOS.** Command+Tab, Command+Space, and Command+Option+Escape. +- **Linux.** Control+Alt+F1 through F12 switch to another virtual terminal. Desktops such as GNOME also take many chords with the Super key. + +Users can change many of these, so no list is complete. Prefer `Mod`, `Shift`, and `Alt` chords over `Meta` chords, which Windows mostly keeps. + +### Chords that can't fire on some layouts + +A few chords type a character the hotkey doesn't name, so they never fire on some layouts: + +- **Option with a shifted symbol on a US Mac.** Option+Shift+/ types `¿`, not `?`, so `Alt+?` and `Mod+Alt+?` never fire on a US Mac. Use the physical code instead, such as `Alt+Shift+[Slash]`. +- **Control+Alt on layouts with AltGr.** Windows treats Control+Alt as AltGr. On a German keyboard, Control+Alt+Q types `@`, so `Control+Alt+Q` never fires, and an `@` binding does. + +## Let users choose their own shortcuts + +The most reliable shortcut is often the one a user picks on their own keyboard. The [hotkey recorder](./custom-hotkey-recording) follows the rules in this guide for you: + +- It records only presses that reach the page, so in a browser tab it never records the browser and operating system chords above. +- It never writes Shift with a symbol. Shift+/ records `?`, and German Shift+7 records `/`. +- On a Mac with Command held, off the key's US position, the browser may not report the symbol the user typed. There the recorder records the key's physical code: Dvorak Command+Shift+/ records `Mod+Shift+[BracketLeft]`. + +A recorded hotkey can still fail on another machine. `Alt+F4` recorded on a Mac closes the window on Windows. See [Save hotkeys that work on another platform](./custom-hotkey-recording#save-hotkeys-that-work-on-another-platform) to keep synced hotkeys portable. + +To reject chords you don't want, such as the browser tab shortcuts in an Electron app that also ships to the web, return an error from `validate`: + +```tsx +import { useHotkeyRecorder } from '@tanstack/react-hotkeys' + +const browserTabShortcuts = new Set([ + 'Mod+W', + 'Mod+T', + 'Mod+N', + 'Mod+Shift+N', + 'Mod+Shift+T', + 'Mod+Shift+W', +]) + +function ShortcutInput({ onSave }: { onSave: (hotkey: string) => void }) { + const recorder = useHotkeyRecorder({ + validate: (hotkey) => + !browserTabShortcuts.has(hotkey) || 'The browser uses this shortcut.', + onRecord: onSave, + }) + // ... +} +``` diff --git a/docs/framework/react/guides/custom-hotkey-recording.md b/docs/framework/react/guides/custom-hotkey-recording.md index 61b1e9252..2ae7e7dc2 100644 --- a/docs/framework/react/guides/custom-hotkey-recording.md +++ b/docs/framework/react/guides/custom-hotkey-recording.md @@ -37,7 +37,7 @@ function ShortcutRecorder() { } ``` -With the default `recordBy: 'auto'`, the recorder outputs portable strings just like you write by hand: `Mod+S` for Command+S on macOS or Control+S on Windows and Linux. It records what the press typed (`?` for Shift+/, `Mod+1` for AZERTY Ctrl+&), and falls back to physical bracketed codes for the few presses whose character the browser reports differently by platform, such as `Alt+[Slash]` for macOS Option+/. A recorded character such as `@` fires wherever the layout types it, which can be a different key. See [Recording captures what the user pressed](../../../guides/sensible-defaults.md#recording-captures-what-the-user-pressed) for the full rules, or set `recordBy: 'code'` (always physical) or `recordBy: 'key'` (always typed character). +With the default `recordBy: 'auto'`, the recorder outputs portable strings just like you write by hand: `Mod+S` for Command+S on macOS or Control+S on Windows and Linux. It records what the press typed (`?` for Shift+/, `Mod+1` for AZERTY Ctrl+&), and falls back to physical bracketed codes for the few presses whose character the browser reports differently by platform, such as `Alt+[Slash]` for macOS Option+/. A recorded character such as `@` fires wherever the layout types it, which can be a different key. See [Recording captures what the user pressed](../../../guides/sensible-defaults.md#recording-captures-what-the-user-pressed) for the full rules, or set `recordBy: 'code'` (always physical) or `recordBy: 'key'` (typed character). | Property or method | Description | | --- | --- | diff --git a/docs/framework/react/guides/hotkey-manager.md b/docs/framework/react/guides/hotkey-manager.md index c4cc8e421..4ef59754b 100644 --- a/docs/framework/react/guides/hotkey-manager.md +++ b/docs/framework/react/guides/hotkey-manager.md @@ -121,7 +121,7 @@ The [devtools](../../../devtools) display the same live scope state without writ ## Suspend character key shortcuts -Call `manager.suspendCharacterKeys()` to pause document-level hotkeys made only of keys that type a character, such as `K`, `Shift+/`, or `['G', 'H']`. Hotkeys with `Control`, `Alt`, or `Meta`, non-character keys such as `Escape`, and hotkeys targeted at an element keep working. Suspensions are counted like scope activations, so character key shortcuts stay suspended until every returned resume function runs: +Call `manager.suspendCharacterKeys()` to pause document-level hotkeys made only of keys that type a character, such as `K`, `?`, or `['G', 'H']`. Hotkeys with `Control`, `Alt`, or `Meta`, non-character keys such as `Escape`, and hotkeys targeted at an element keep working. Suspensions are counted like scope activations, so character key shortcuts stay suspended until every returned resume function runs: ```ts const resume = manager.suspendCharacterKeys() diff --git a/docs/framework/react/guides/keyboard-layouts.md b/docs/framework/react/guides/keyboard-layouts.md index f928ba60c..deb506210 100644 --- a/docs/framework/react/guides/keyboard-layouts.md +++ b/docs/framework/react/guides/keyboard-layouts.md @@ -15,7 +15,7 @@ Most apps never need to register extra layouts. A to Z, 0 to 9, and common US pu - `Mod+S` matches on a Russian keyboard, where that key types `ы`. - `Mod+;` matches on German `Ctrl+Ö` and Spanish `Ctrl+Ñ` in the same physical slot. - On Greek, Cyrillic, and Hebrew layouts, prefer `Mod+A` over `Mod+Ф`. It matches on the same key and keeps working if the user toggles back to Latin. -- Punctuation that another layout types with `Shift`, such as `/` on German QWERTZ, can't match with `Command` held on macOS. See [Keys match the character the user types](../../../guides/sensible-defaults.md#keys-match-the-character-the-user-types) for why and how to add the shifted fallback. +- A symbol that another layout types with `Shift`, such as `/` on German QWERTZ, can't match with `Command` held on macOS. See [Keys match the character the user types](../../../guides/sensible-defaults.md#keys-match-the-character-the-user-types) for why and how to add the shifted fallback. Register layout sets only when you intentionally target keys unique to specific layouts, such as a single-key `ß` shortcut or shortcuts labeled with `Ö` in a localized UI. @@ -49,7 +49,7 @@ All hooks (`useHotkeys`, `useHotkeyHint`, `useFormatForDisplay`), app hotkeys, c - **Replaces `UsKeys` unless kept.** Include `UsKeys` in the union if you still want US punctuation like `[`. With `keys: GermanKeys` alone, `Mod+[` fails type-checking because German types `[` with `AltGr` or `Option`. - **Always allowed.** A to Z, 0 to 9, named keys (`Escape`, `F1`), and physical codes (`[KeyS]`) work under every registration. - **Casing.** Write letters uppercase (`Mod+Ö`, not `Mod+ö`), leaving `ß` and Turkish dotless `ı` as typed. -- **Shift-typed characters.** Layout letters typed with `Shift`, such as Turkish `İ` or Swiss German `È`, require `Shift+` (`Shift+İ`). Shift-typed symbols like `§` (via `Shift+3` on German) match without `Shift+`. +- **Shift-typed characters.** Layout letters typed with `Shift`, such as Turkish `İ` or Swiss German `È`, require `Shift+` (`Shift+İ`). Shift-typed symbols like `§` (via `Shift+3` on German) match without `Shift+`, and the types reject `Shift+§`, as they reject `Shift` with any symbol. - **Recorder.** `useHotkeyRecorder` captures whatever key the user presses, even outside your registered TypeScript union. ## Available key sets diff --git a/docs/framework/solid/guides/choosing-valid-hotkeys.md b/docs/framework/solid/guides/choosing-valid-hotkeys.md new file mode 100644 index 000000000..ac7a2ef83 --- /dev/null +++ b/docs/framework/solid/guides/choosing-valid-hotkeys.md @@ -0,0 +1,213 @@ +--- +title: Choosing Valid Hotkeys in Solid +id: choosing-valid-hotkeys +description: Why TanStack Hotkeys rejects some hotkey strings, such as Shift+/, what to write instead, and which shortcuts the browser or operating system takes before your Solid app sees them. +--- + +You write a hotkey on your keyboard, and your users press it on theirs. Their keyboard can have another layout, another operating system, and another browser, and each of those can change what a key press means. A shortcut that works on your machine can fire on the wrong key for a German user, or never fire for someone on a Mac. + +TanStack Hotkeys absorbs most of these differences at runtime. A few it can't, because the hotkey string itself means more than one thing. For those, the types reject the string while you write it, so you find out in your editor and not from a bug report. This guide explains why those strings are rejected and what to write instead. It also covers the shortcuts no string can fix, because the browser or the operating system handles them before your app does. + +## Why `Shift+/` is a type error + +Say you want `?` to open a help dialog. On a US keyboard you type `?` with Shift and the `/` key, so you write down what you press: + +```tsx +createHotkey('Shift+/', openHelp) // Type error +``` + +TypeScript rejects it. That can feel strict, since the string looks reasonable and would work on your keyboard. The problem shows up on other keyboards. + +A hotkey string names characters, and layouts put `/` and `?` on different keys. On a German keyboard, `/` is Shift+7 and `?` is Shift+ß. There, `Shift+/` can be read two ways: + +- You meant `?`, the character that US Shift+/ types. The library reads it that way, so German Shift+ß fires it. +- The string also says "Shift and `/`", and German Shift+7 is exactly that. So a German user who types a plain `/` fires it too. + +If your app binds `/` to search as well, that German user gets your help dialog instead of search, because an exact Shift match ranks above `/`. The library can't tell which reading you meant. Only you know that, so the types ask you to say it. + +When you mean the character, write the character: + +```tsx +import { createHotkey } from '@tanstack/solid-hotkeys' + +function Help() { + // Fires on whatever key types `?` on the user's layout + createHotkey('?', () => openHelp()) + return null +} +``` + +`?` means the same thing on every layout. It fires on Shift+/ on a US keyboard and on Shift+ß on a German one, and the matcher takes care of the Shift the user needs to type it. + +When you mean the key's position, name the physical key. `Shift+[Slash]` is Shift with the key that US keyboards label `/`, whatever that key types on the user's layout. + +### Why letters and digits keep Shift + +Shift changes a letter's case, not which letter it is. `Shift+K` names the same key on every layout, so the types allow it. The Shift matters there too: `K` and `Shift+K` are two different shortcuts. + +Digits are safe for another reason. The matcher reads the digit row by position, so `Shift+1` fires on the key that types `1` on every layout. That includes French AZERTY, where the key types `&` without Shift. + +A symbol gets neither guarantee. Which symbol Shift adds to a key is up to the layout. + +### What can follow Shift + +After `Shift`, with or without other modifiers, a hotkey string takes a letter, a digit, a named key such as `Tab`, or a physical code such as `[Slash]`. A symbol after Shift is a type error: + +```tsx +createHotkey('Shift+/', openHelp) // Type error +createHotkey('?', openHelp) // OK +createHotkey('Control+?', openHelp) // OK, fires on Control+Shift+/ on a US keyboard +createHotkey('Shift+[Slash]', openHelp) // OK, the physical key +createHotkey('Mod+Shift+/', openHelp) // Type error +createHotkey('Mod+?', openHelp) // OK +``` + +The same rule covers letters from [registered keyboard layouts](./keyboard-layouts): `Shift+Ä` is allowed, and `Shift+§` is a type error. + +The rule lives only in the types. A string from storage or user settings, such as a saved `'Shift+/'`, still matches as it did before, so shortcuts your users already saved keep working. + +## Mod with a symbol doesn't reach every Mac + +`Mod+?` is how you write Control+Shift+/ on Windows and Command+Shift+/ on macOS. On Windows and Linux it fires on every layout. macOS is less predictable. + +With Command held, macOS reports a different character for some keys than the one they type. Command+Shift on the key that types `?` reports `/` on German and Dvorak, `'` on Spanish, and `+` on Swedish. So `Mod+?` doesn't fire on those Mac layouts, while it does on US, UK, French, and Italian Macs. + +No symbol spelling covers that press on every Mac layout. When a shortcut has to work for everyone, such as the one that opens your command palette, give it a letter or a digit, such as `Mod+Shift+K` or `Mod+Shift+1`. To bind a key by position, use its physical code, such as `Mod+Shift+[Slash]`. + +[Keys match the character the user types](../../../guides/sensible-defaults.md#keys-match-the-character-the-user-types) has the details of how Command changes the reported key. + +## Replace a Shift string you already wrote + +When existing code has `Shift+` with a symbol, the right replacement depends on the keyboard it was written on, because whoever wrote it wrote what their keyboard typed. `Shift+,` types `<` on a US keyboard, `;` on a German one, and `?` on a French one. Find the string in the first column, then take the replacement from the column for the layout it was written on: + +| Ambiguous | US QWERTY | German | French AZERTY | +| --- | --- | --- | --- | +| `` Shift+` `` | `~` | `` ` `` | `` ` `` | +| `Shift+-` | `_` | `_` | `6` | +| `Shift+=` | `+` | `=` | `+` | +| `Shift+[` | `{` | `[` | `[` | +| `Shift+]` | `}` | `]` | `]` | +| `Shift+\` | `\|` | `\` | `\` | +| `Shift+;` | `:` | `;` | `.` | +| `Shift+'` | `"` | `'` | `4` | +| `Shift+,` | `<` | `;` | `?` | +| `Shift+.` | `>` | `:` | `.` | +| `Shift+/` | `?` | `/` | `/` | +| `Shift+_` | `_` | `_` | `8` | +| `Shift++` | `+` | `*` | `+` | +| `Shift+:` | `:` | `:` | `/` | +| `Shift+"` | `"` | `"` | `3` | +| `Shift+<` | `<` | `>` | `>` | +| `Shift+!` | `!` | `!` | `§` | +| `Shift+#` | `#` | `'` | `#` | +| `Shift+$` | `$` | `$` | `£` | +| `Shift+&` | `&` | `&` | `1` | +| `Shift+*` | `*` | `*` | `Shift+[Backslash]` | +| `Shift+(` | `(` | `(` | `5` | +| `Shift+)` | `)` | `)` | `°` | + +Each cell is what Shift and that key type on that layout. When the layout has no key that types the symbol without Shift, the replacement is the symbol itself. German `/` is Shift+7, so a German developer who wrote `Shift+/` meant `/`. + +A few more rules for reading the table: + +- The table leaves out strings whose replacement is the same symbol on all three layouts, such as `Shift+?` and `Shift+@`. Write the symbol: `?` or `@`. +- With other modifiers, keep them and use the same replacement. On a US keyboard, `Control+Shift+/` becomes `Control+?`, and `Mod+Shift+/` becomes `Mod+?`. +- French `µ` isn't in `FrenchKeys`, so its cell names the key by position instead. +- The German and French columns use the Windows layouts. The Mac layouts place some symbols differently. + +To keep a key's position instead of its character, use Shift with the key's physical code, such as `Shift+[Slash]`. + +## Physical codes name a key, not a character + +Use a physical code when the key's position matters more than its label, such as keys arranged in a row for a game or a drawing tool. The catch is the label. On other layouts the key types something else, so a hint that shows the US symbol can be wrong for those users. Shift and these codes type: + +| Physical code | US QWERTY | US Dvorak | German | +| --- | --- | --- | --- | +| `Shift+[Backquote]` | `~` | `~` | `°` | +| `Shift+[Minus]` | `_` | `{` | `?` | +| `Shift+[Equal]` | `+` | `}` | a dead key | +| `Shift+[BracketLeft]` | `{` | `?` | `Ü` | +| `Shift+[BracketRight]` | `}` | `+` | `*` | +| `Shift+[Backslash]` | `\|` | `\|` | `'` | +| `Shift+[Semicolon]` | `:` | `S` | `Ö` | +| `Shift+[Quote]` | `"` | `_` | `Ä` | +| `Shift+[Comma]` | `<` | `W` | `;` | +| `Shift+[Period]` | `>` | `V` | `:` | +| `Shift+[Slash]` | `?` | `Z` | `_` | + +When you pass a layout map, [`formatForDisplay`](./formatting-display) labels a physical code with the key's character on the user's layout. On a German keyboard, `Shift+[Slash]` shows as `Shift+-`. Without a layout map, which only Chromium browsers provide, the label is the US character for that position. + +## Some shortcuts belong to the browser or the operating system + +Some chords never reach your page. The browser or the operating system handles them first, so your handler doesn't run, and the user gets the browser's action instead. + +The types still accept these chords, and that's deliberate. The same chord can be free in an installed web app, in fullscreen, or in Electron. The types can't know where your app runs, but you do. + +### Browser tab shortcuts + +In a normal browser tab, these chords open, close, or switch tabs and windows. Chrome reserves them. The Firefox and Safari columns come from their source and bug reports, so treat a blank cell as unconfirmed, not as free: + +| Chord | Action | Chrome | Firefox | Safari | +| --- | --- | --- | --- | --- | +| `Mod+W` | Close tab | Reserved | Reserved | Reported reserved | +| `Mod+T` | New tab | Reserved | Reserved | Reported reserved | +| `Mod+N` | New window | Reserved | Reserved | Reported reserved | +| `Mod+Shift+W` | Close window | Reserved | Reserved | | +| `Mod+Shift+T` | Reopen closed tab | Reserved | | | +| `Mod+Shift+N` | New private window | Reserved | | | +| `Control+Tab`, `Control+Shift+Tab` | Next and previous tab | Reserved | Reported reserved | Reported reserved | +| `Control+PageUp`, `Control+PageDown` | Next and previous tab, Windows and Linux | Reserved | | | +| `Mod+Q` | Quit, macOS | Reserved | Not reserved | Reported reserved | + +Chrome reserves none of these in an installed web app window, and in fullscreen it keeps only the keys that leave fullscreen. If your app runs in a browser tab, pick other chords for its own actions. + +### Operating system shortcuts + +Each operating system keeps a few chords for itself. A chord is lost only on the system that keeps it: + +- **Windows.** Control+Alt+Delete, and most chords with the Windows key (`Meta`), such as Windows+L. +- **macOS.** Command+Tab, Command+Space, and Command+Option+Escape. +- **Linux.** Control+Alt+F1 through F12 switch to another virtual terminal. Desktops such as GNOME also take many chords with the Super key. + +Users can change many of these, so no list is complete. Prefer `Mod`, `Shift`, and `Alt` chords over `Meta` chords, which Windows mostly keeps. + +### Chords that can't fire on some layouts + +A few chords type a character the hotkey doesn't name, so they never fire on some layouts: + +- **Option with a shifted symbol on a US Mac.** Option+Shift+/ types `¿`, not `?`, so `Alt+?` and `Mod+Alt+?` never fire on a US Mac. Use the physical code instead, such as `Alt+Shift+[Slash]`. +- **Control+Alt on layouts with AltGr.** Windows treats Control+Alt as AltGr. On a German keyboard, Control+Alt+Q types `@`, so `Control+Alt+Q` never fires, and an `@` binding does. + +## Let users choose their own shortcuts + +The most reliable shortcut is often the one a user picks on their own keyboard. The [hotkey recorder](./custom-hotkey-recording) follows the rules in this guide for you: + +- It records only presses that reach the page, so in a browser tab it never records the browser and operating system chords above. +- It never writes Shift with a symbol. Shift+/ records `?`, and German Shift+7 records `/`. +- On a Mac with Command held, off the key's US position, the browser may not report the symbol the user typed. There the recorder records the key's physical code: Dvorak Command+Shift+/ records `Mod+Shift+[BracketLeft]`. + +A recorded hotkey can still fail on another machine. `Alt+F4` recorded on a Mac closes the window on Windows. See [Save hotkeys that work on another platform](./custom-hotkey-recording#save-hotkeys-that-work-on-another-platform) to keep synced hotkeys portable. + +To reject chords you don't want, such as the browser tab shortcuts in an Electron app that also ships to the web, return an error from `validate`: + +```tsx +import { createHotkeyRecorder } from '@tanstack/solid-hotkeys' + +const browserTabShortcuts = new Set([ + 'Mod+W', + 'Mod+T', + 'Mod+N', + 'Mod+Shift+N', + 'Mod+Shift+T', + 'Mod+Shift+W', +]) + +function ShortcutInput({ onSave }: { onSave: (hotkey: string) => void }) { + const recorder = createHotkeyRecorder({ + validate: (hotkey) => + !browserTabShortcuts.has(hotkey) || 'The browser uses this shortcut.', + onRecord: onSave, + }) + // ... +} +``` diff --git a/docs/framework/solid/guides/custom-hotkey-recording.md b/docs/framework/solid/guides/custom-hotkey-recording.md index 7f6904747..1840f4b5a 100644 --- a/docs/framework/solid/guides/custom-hotkey-recording.md +++ b/docs/framework/solid/guides/custom-hotkey-recording.md @@ -39,7 +39,7 @@ function ShortcutRecorder() { } ``` -With the default `recordBy: 'auto'`, the recorder outputs portable strings like those written by hand: `Mod+S` for Command+S on macOS or Control+S on Windows and Linux. It records what the press typed (`?` for Shift+/, `Mod+1` for AZERTY Ctrl+&), and falls back to physical bracketed codes for the few presses whose character the browser reports differently by platform, such as `Alt+[Slash]` for macOS Option+/. A recorded character such as `@` fires wherever the layout types it, which can be a different key. See [Recording captures what the user pressed](../../../guides/sensible-defaults.md#recording-captures-what-the-user-pressed) for the full rules, or set `recordBy: 'code'` (always physical) or `recordBy: 'key'` (always typed character). Recording by position rejects a press that has no physical code. +With the default `recordBy: 'auto'`, the recorder outputs portable strings like those written by hand: `Mod+S` for Command+S on macOS or Control+S on Windows and Linux. It records what the press typed (`?` for Shift+/, `Mod+1` for AZERTY Ctrl+&), and falls back to physical bracketed codes for the few presses whose character the browser reports differently by platform, such as `Alt+[Slash]` for macOS Option+/. A recorded character such as `@` fires wherever the layout types it, which can be a different key. See [Recording captures what the user pressed](../../../guides/sensible-defaults.md#recording-captures-what-the-user-pressed) for the full rules, or set `recordBy: 'code'` (always physical) or `recordBy: 'key'` (typed character). Recording by position rejects a press that has no physical code. Pass the result straight to `createHotkey`, and label it with `createFormatForDisplay`. `createHotkeyRecorder` returns the recorder's state and controls. Each state member is an accessor: diff --git a/docs/framework/solid/guides/hotkey-manager.md b/docs/framework/solid/guides/hotkey-manager.md index be8756a67..e670cb4d2 100644 --- a/docs/framework/solid/guides/hotkey-manager.md +++ b/docs/framework/solid/guides/hotkey-manager.md @@ -127,7 +127,7 @@ The [devtools](../../../devtools) display the same live scope state without writ ## Suspend character key shortcuts -Call `manager.suspendCharacterKeys()` to pause document-level hotkeys made only of keys that type a character, such as `K`, `Shift+/`, or `['G', 'H']`. Hotkeys with `Control`, `Alt`, or `Meta`, non-character keys such as `Escape`, and hotkeys targeted at an element keep working. Suspensions are counted like scope activations, so character key shortcuts stay suspended until every returned resume function runs: +Call `manager.suspendCharacterKeys()` to pause document-level hotkeys made only of keys that type a character, such as `K`, `?`, or `['G', 'H']`. Hotkeys with `Control`, `Alt`, or `Meta`, non-character keys such as `Escape`, and hotkeys targeted at an element keep working. Suspensions are counted like scope activations, so character key shortcuts stay suspended until every returned resume function runs: ```ts const resume = manager.suspendCharacterKeys() diff --git a/docs/framework/solid/guides/keyboard-layouts.md b/docs/framework/solid/guides/keyboard-layouts.md index f94abbb51..2e66f4149 100644 --- a/docs/framework/solid/guides/keyboard-layouts.md +++ b/docs/framework/solid/guides/keyboard-layouts.md @@ -15,7 +15,7 @@ Most apps never need to register extra layouts. A to Z, 0 to 9, and common US pu - `Mod+S` matches on a Russian keyboard, where that key types `ы`. - `Mod+;` matches on German `Ctrl+Ö` and Spanish `Ctrl+Ñ` in the same physical slot. - On Greek, Cyrillic, and Hebrew layouts, prefer `Mod+A` over `Mod+Ф`. It matches on the same key and keeps working if the user toggles back to Latin. -- Punctuation that another layout types with `Shift`, such as `/` on German QWERTZ, can't match with `Command` held on macOS. See [Keys match the character the user types](../../../guides/sensible-defaults.md#keys-match-the-character-the-user-types) for why and how to add the shifted fallback. +- A symbol that another layout types with `Shift`, such as `/` on German QWERTZ, can't match with `Command` held on macOS. See [Keys match the character the user types](../../../guides/sensible-defaults.md#keys-match-the-character-the-user-types) for why and how to add the shifted fallback. Register layout sets only when you intentionally target keys unique to specific layouts, such as a single-key `ß` shortcut or shortcuts labeled with `Ö` in a localized UI. @@ -49,7 +49,7 @@ All primitives (`createHotkeys`, `createHotkeyHint`, `createFormatForDisplay`), - **Replaces `UsKeys` unless kept.** Include `UsKeys` in the union if you still want US punctuation like `[`. With `keys: GermanKeys` alone, `Mod+[` fails type-checking because German types `[` with `AltGr` or `Option`. - **Always allowed.** A to Z, 0 to 9, named keys (`Escape`, `F1`), and physical codes (`[KeyS]`) work under every registration. - **Casing.** Write letters uppercase (`Mod+Ö`, not `Mod+ö`), leaving `ß` and Turkish dotless `ı` as typed. -- **Shift-typed characters.** Layout letters typed with `Shift`, such as Turkish `İ` or Swiss German `È`, require `Shift+` (`Shift+İ`). Shift-typed symbols like `§` (via `Shift+3` on German) match without `Shift+`. +- **Shift-typed characters.** Layout letters typed with `Shift`, such as Turkish `İ` or Swiss German `È`, require `Shift+` (`Shift+İ`). Shift-typed symbols like `§` (via `Shift+3` on German) match without `Shift+`, and the types reject `Shift+§`, as they reject `Shift` with any symbol. - **Recorder.** `createHotkeyRecorder` captures whatever key the user presses, even outside your registered TypeScript union. ## Available key sets diff --git a/docs/framework/svelte/guides/choosing-valid-hotkeys.md b/docs/framework/svelte/guides/choosing-valid-hotkeys.md new file mode 100644 index 000000000..3bd73cd22 --- /dev/null +++ b/docs/framework/svelte/guides/choosing-valid-hotkeys.md @@ -0,0 +1,217 @@ +--- +title: Choosing Valid Hotkeys in Svelte +id: choosing-valid-hotkeys +description: Why TanStack Hotkeys rejects some hotkey strings, such as Shift+/, what to write instead, and which shortcuts the browser or operating system takes before your Svelte app sees them. +--- + +You write a hotkey on your keyboard, and your users press it on theirs. Their keyboard can have another layout, another operating system, and another browser, and each of those can change what a key press means. A shortcut that works on your machine can fire on the wrong key for a German user, or never fire for someone on a Mac. + +TanStack Hotkeys absorbs most of these differences at runtime. A few it can't, because the hotkey string itself means more than one thing. For those, the types reject the string while you write it, so you find out in your editor and not from a bug report. This guide explains why those strings are rejected and what to write instead. It also covers the shortcuts no string can fix, because the browser or the operating system handles them before your app does. + +## Why `Shift+/` is a type error + +Say you want `?` to open a help dialog. On a US keyboard you type `?` with Shift and the `/` key, so you write down what you press: + +```ts +createHotkey('Shift+/', openHelp) // Type error +``` + +TypeScript rejects it. That can feel strict, since the string looks reasonable and would work on your keyboard. The problem shows up on other keyboards. + +A hotkey string names characters, and layouts put `/` and `?` on different keys. On a German keyboard, `/` is Shift+7 and `?` is Shift+ß. There, `Shift+/` can be read two ways: + +- You meant `?`, the character that US Shift+/ types. The library reads it that way, so German Shift+ß fires it. +- The string also says "Shift and `/`", and German Shift+7 is exactly that. So a German user who types a plain `/` fires it too. + +If your app binds `/` to search as well, that German user gets your help dialog instead of search, because an exact Shift match ranks above `/`. The library can't tell which reading you meant. Only you know that, so the types ask you to say it. + +When you mean the character, write the character: + +```svelte + +``` + +`?` means the same thing on every layout. It fires on Shift+/ on a US keyboard and on Shift+ß on a German one, and the matcher takes care of the Shift the user needs to type it. + +When you mean the key's position, name the physical key. `Shift+[Slash]` is Shift with the key that US keyboards label `/`, whatever that key types on the user's layout. + +### Why letters and digits keep Shift + +Shift changes a letter's case, not which letter it is. `Shift+K` names the same key on every layout, so the types allow it. The Shift matters there too: `K` and `Shift+K` are two different shortcuts. + +Digits are safe for another reason. The matcher reads the digit row by position, so `Shift+1` fires on the key that types `1` on every layout. That includes French AZERTY, where the key types `&` without Shift. + +A symbol gets neither guarantee. Which symbol Shift adds to a key is up to the layout. + +### What can follow Shift + +After `Shift`, with or without other modifiers, a hotkey string takes a letter, a digit, a named key such as `Tab`, or a physical code such as `[Slash]`. A symbol after Shift is a type error: + +```ts +createHotkey('Shift+/', openHelp) // Type error +createHotkey('?', openHelp) // OK +createHotkey('Control+?', openHelp) // OK, fires on Control+Shift+/ on a US keyboard +createHotkey('Shift+[Slash]', openHelp) // OK, the physical key +createHotkey('Mod+Shift+/', openHelp) // Type error +createHotkey('Mod+?', openHelp) // OK +``` + +The same rule covers letters from [registered keyboard layouts](./keyboard-layouts): `Shift+Ä` is allowed, and `Shift+§` is a type error. + +The rule lives only in the types. A string from storage or user settings, such as a saved `'Shift+/'`, still matches as it did before, so shortcuts your users already saved keep working. + +In `.svelte` files, `svelte-check` reports these errors. `tsc` alone doesn't read them. + +## Mod with a symbol doesn't reach every Mac + +`Mod+?` is how you write Control+Shift+/ on Windows and Command+Shift+/ on macOS. On Windows and Linux it fires on every layout. macOS is less predictable. + +With Command held, macOS reports a different character for some keys than the one they type. Command+Shift on the key that types `?` reports `/` on German and Dvorak, `'` on Spanish, and `+` on Swedish. So `Mod+?` doesn't fire on those Mac layouts, while it does on US, UK, French, and Italian Macs. + +No symbol spelling covers that press on every Mac layout. When a shortcut has to work for everyone, such as the one that opens your command palette, give it a letter or a digit, such as `Mod+Shift+K` or `Mod+Shift+1`. To bind a key by position, use its physical code, such as `Mod+Shift+[Slash]`. + +[Keys match the character the user types](../../../guides/sensible-defaults.md#keys-match-the-character-the-user-types) has the details of how Command changes the reported key. + +## Replace a Shift string you already wrote + +When existing code has `Shift+` with a symbol, the right replacement depends on the keyboard it was written on, because whoever wrote it wrote what their keyboard typed. `Shift+,` types `<` on a US keyboard, `;` on a German one, and `?` on a French one. Find the string in the first column, then take the replacement from the column for the layout it was written on: + +| Ambiguous | US QWERTY | German | French AZERTY | +| --- | --- | --- | --- | +| `` Shift+` `` | `~` | `` ` `` | `` ` `` | +| `Shift+-` | `_` | `_` | `6` | +| `Shift+=` | `+` | `=` | `+` | +| `Shift+[` | `{` | `[` | `[` | +| `Shift+]` | `}` | `]` | `]` | +| `Shift+\` | `\|` | `\` | `\` | +| `Shift+;` | `:` | `;` | `.` | +| `Shift+'` | `"` | `'` | `4` | +| `Shift+,` | `<` | `;` | `?` | +| `Shift+.` | `>` | `:` | `.` | +| `Shift+/` | `?` | `/` | `/` | +| `Shift+_` | `_` | `_` | `8` | +| `Shift++` | `+` | `*` | `+` | +| `Shift+:` | `:` | `:` | `/` | +| `Shift+"` | `"` | `"` | `3` | +| `Shift+<` | `<` | `>` | `>` | +| `Shift+!` | `!` | `!` | `§` | +| `Shift+#` | `#` | `'` | `#` | +| `Shift+$` | `$` | `$` | `£` | +| `Shift+&` | `&` | `&` | `1` | +| `Shift+*` | `*` | `*` | `Shift+[Backslash]` | +| `Shift+(` | `(` | `(` | `5` | +| `Shift+)` | `)` | `)` | `°` | + +Each cell is what Shift and that key type on that layout. When the layout has no key that types the symbol without Shift, the replacement is the symbol itself. German `/` is Shift+7, so a German developer who wrote `Shift+/` meant `/`. + +A few more rules for reading the table: + +- The table leaves out strings whose replacement is the same symbol on all three layouts, such as `Shift+?` and `Shift+@`. Write the symbol: `?` or `@`. +- With other modifiers, keep them and use the same replacement. On a US keyboard, `Control+Shift+/` becomes `Control+?`, and `Mod+Shift+/` becomes `Mod+?`. +- French `µ` isn't in `FrenchKeys`, so its cell names the key by position instead. +- The German and French columns use the Windows layouts. The Mac layouts place some symbols differently. + +To keep a key's position instead of its character, use Shift with the key's physical code, such as `Shift+[Slash]`. + +## Physical codes name a key, not a character + +Use a physical code when the key's position matters more than its label, such as keys arranged in a row for a game or a drawing tool. The catch is the label. On other layouts the key types something else, so a hint that shows the US symbol can be wrong for those users. Shift and these codes type: + +| Physical code | US QWERTY | US Dvorak | German | +| --- | --- | --- | --- | +| `Shift+[Backquote]` | `~` | `~` | `°` | +| `Shift+[Minus]` | `_` | `{` | `?` | +| `Shift+[Equal]` | `+` | `}` | a dead key | +| `Shift+[BracketLeft]` | `{` | `?` | `Ü` | +| `Shift+[BracketRight]` | `}` | `+` | `*` | +| `Shift+[Backslash]` | `\|` | `\|` | `'` | +| `Shift+[Semicolon]` | `:` | `S` | `Ö` | +| `Shift+[Quote]` | `"` | `_` | `Ä` | +| `Shift+[Comma]` | `<` | `W` | `;` | +| `Shift+[Period]` | `>` | `V` | `:` | +| `Shift+[Slash]` | `?` | `Z` | `_` | + +When you pass a layout map, [`formatForDisplay`](./formatting-display) labels a physical code with the key's character on the user's layout. On a German keyboard, `Shift+[Slash]` shows as `Shift+-`. Without a layout map, which only Chromium browsers provide, the label is the US character for that position. + +## Some shortcuts belong to the browser or the operating system + +Some chords never reach your page. The browser or the operating system handles them first, so your handler doesn't run, and the user gets the browser's action instead. + +The types still accept these chords, and that's deliberate. The same chord can be free in an installed web app, in fullscreen, or in Electron. The types can't know where your app runs, but you do. + +### Browser tab shortcuts + +In a normal browser tab, these chords open, close, or switch tabs and windows. Chrome reserves them. The Firefox and Safari columns come from their source and bug reports, so treat a blank cell as unconfirmed, not as free: + +| Chord | Action | Chrome | Firefox | Safari | +| --- | --- | --- | --- | --- | +| `Mod+W` | Close tab | Reserved | Reserved | Reported reserved | +| `Mod+T` | New tab | Reserved | Reserved | Reported reserved | +| `Mod+N` | New window | Reserved | Reserved | Reported reserved | +| `Mod+Shift+W` | Close window | Reserved | Reserved | | +| `Mod+Shift+T` | Reopen closed tab | Reserved | | | +| `Mod+Shift+N` | New private window | Reserved | | | +| `Control+Tab`, `Control+Shift+Tab` | Next and previous tab | Reserved | Reported reserved | Reported reserved | +| `Control+PageUp`, `Control+PageDown` | Next and previous tab, Windows and Linux | Reserved | | | +| `Mod+Q` | Quit, macOS | Reserved | Not reserved | Reported reserved | + +Chrome reserves none of these in an installed web app window, and in fullscreen it keeps only the keys that leave fullscreen. If your app runs in a browser tab, pick other chords for its own actions. + +### Operating system shortcuts + +Each operating system keeps a few chords for itself. A chord is lost only on the system that keeps it: + +- **Windows.** Control+Alt+Delete, and most chords with the Windows key (`Meta`), such as Windows+L. +- **macOS.** Command+Tab, Command+Space, and Command+Option+Escape. +- **Linux.** Control+Alt+F1 through F12 switch to another virtual terminal. Desktops such as GNOME also take many chords with the Super key. + +Users can change many of these, so no list is complete. Prefer `Mod`, `Shift`, and `Alt` chords over `Meta` chords, which Windows mostly keeps. + +### Chords that can't fire on some layouts + +A few chords type a character the hotkey doesn't name, so they never fire on some layouts: + +- **Option with a shifted symbol on a US Mac.** Option+Shift+/ types `¿`, not `?`, so `Alt+?` and `Mod+Alt+?` never fire on a US Mac. Use the physical code instead, such as `Alt+Shift+[Slash]`. +- **Control+Alt on layouts with AltGr.** Windows treats Control+Alt as AltGr. On a German keyboard, Control+Alt+Q types `@`, so `Control+Alt+Q` never fires, and an `@` binding does. + +## Let users choose their own shortcuts + +The most reliable shortcut is often the one a user picks on their own keyboard. The [hotkey recorder](./custom-hotkey-recording) follows the rules in this guide for you: + +- It records only presses that reach the page, so in a browser tab it never records the browser and operating system chords above. +- It never writes Shift with a symbol. Shift+/ records `?`, and German Shift+7 records `/`. +- On a Mac with Command held, off the key's US position, the browser may not report the symbol the user typed. There the recorder records the key's physical code: Dvorak Command+Shift+/ records `Mod+Shift+[BracketLeft]`. + +A recorded hotkey can still fail on another machine. `Alt+F4` recorded on a Mac closes the window on Windows. See [Save hotkeys that work on another platform](./custom-hotkey-recording#save-hotkeys-that-work-on-another-platform) to keep synced hotkeys portable. + +To reject chords you don't want, such as the browser tab shortcuts in an Electron app that also ships to the web, return an error from `validate`: + +```svelte + + + +``` diff --git a/docs/framework/svelte/guides/custom-hotkey-recording.md b/docs/framework/svelte/guides/custom-hotkey-recording.md index 37fee3bb4..66cf336d5 100644 --- a/docs/framework/svelte/guides/custom-hotkey-recording.md +++ b/docs/framework/svelte/guides/custom-hotkey-recording.md @@ -36,7 +36,7 @@ While any recorder is listening, registered hotkeys pause automatically so press ``` -With the default `recordBy: 'auto'`, the recorder outputs portable strings, written like a hand-typed string. Command+S on macOS and Control+S on Windows and Linux both record `Mod+S`. It records what the press typed, such as `?` for Shift+/ and `Mod+1` for AZERTY Ctrl+&. For the few presses whose character the browser reports differently by platform, it falls back to physical bracketed codes, such as `Alt+[Slash]` for macOS Option+/. A recorded character such as `@` fires wherever the layout types it, which can be a different key. See [Recording captures what the user pressed](../../../guides/sensible-defaults.md#recording-captures-what-the-user-pressed) for the full rules. Set `recordBy: 'code'` to always record the physical key, or `recordBy: 'key'` to always record the typed character. Pass the result straight to `createHotkey`, and label it with `getFormatForDisplay`. +With the default `recordBy: 'auto'`, the recorder outputs portable strings, written like a hand-typed string. Command+S on macOS and Control+S on Windows and Linux both record `Mod+S`. It records what the press typed, such as `?` for Shift+/ and `Mod+1` for AZERTY Ctrl+&. For the few presses whose character the browser reports differently by platform, it falls back to physical bracketed codes, such as `Alt+[Slash]` for macOS Option+/. A recorded character such as `@` fires wherever the layout types it, which can be a different key. See [Recording captures what the user pressed](../../../guides/sensible-defaults.md#recording-captures-what-the-user-pressed) for the full rules. Set `recordBy: 'code'` to always record the physical key, or `recordBy: 'key'` to record the typed character. Pass the result straight to `createHotkey`, and label it with `getFormatForDisplay`. `createHotkeyRecorder` returns the recorder's state and controls. State members are reactive getters, so read them from the recorder object instead of destructuring them once: diff --git a/docs/framework/svelte/guides/hotkey-manager.md b/docs/framework/svelte/guides/hotkey-manager.md index 2580eb596..3228f43eb 100644 --- a/docs/framework/svelte/guides/hotkey-manager.md +++ b/docs/framework/svelte/guides/hotkey-manager.md @@ -126,7 +126,7 @@ The [devtools](../../../devtools) show the same scope state without any code. ## Suspend character key shortcuts -Call `manager.suspendCharacterKeys()` to pause document-level hotkeys made only of keys that type a character, such as `K`, `Shift+/`, or `['G', 'H']`. Hotkeys with `Control`, `Alt`, or `Meta`, non-character keys such as `Escape`, and hotkeys targeted at an element keep working. Suspensions are counted like scope activations, so character key shortcuts stay suspended until every returned resume function runs: +Call `manager.suspendCharacterKeys()` to pause document-level hotkeys made only of keys that type a character, such as `K`, `?`, or `['G', 'H']`. Hotkeys with `Control`, `Alt`, or `Meta`, non-character keys such as `Escape`, and hotkeys targeted at an element keep working. Suspensions are counted like scope activations, so character key shortcuts stay suspended until every returned resume function runs: ```ts const resume = manager.suspendCharacterKeys() diff --git a/docs/framework/svelte/guides/keyboard-layouts.md b/docs/framework/svelte/guides/keyboard-layouts.md index 55e57e7ab..6fe6f75fe 100644 --- a/docs/framework/svelte/guides/keyboard-layouts.md +++ b/docs/framework/svelte/guides/keyboard-layouts.md @@ -15,7 +15,7 @@ Most apps never need to register extra layouts. A to Z, 0 to 9, and common US pu - `Mod+S` matches on a Russian keyboard, where that key types `ы`. - `Mod+;` matches on German `Ctrl+Ö` and Spanish `Ctrl+Ñ` in the same physical slot. - On Greek, Cyrillic, and Hebrew layouts, prefer `Mod+A` over `Mod+Ф`. It matches on the same key and keeps working if the user toggles back to Latin. -- Punctuation that another layout types with `Shift`, such as `/` on German QWERTZ, can't match with `Command` held on macOS. See [Keys match the character the user types](../../../guides/sensible-defaults.md#keys-match-the-character-the-user-types) for why and how to add the shifted fallback. +- A symbol that another layout types with `Shift`, such as `/` on German QWERTZ, can't match with `Command` held on macOS. See [Keys match the character the user types](../../../guides/sensible-defaults.md#keys-match-the-character-the-user-types) for why and how to add the shifted fallback. Register layout sets only when you intentionally target keys unique to specific layouts, such as a single-key `ß` shortcut or shortcuts labeled with `Ö` in a localized UI. @@ -51,7 +51,7 @@ createHotkey('Mod+Ñ', search) // Type error: Spanish isn't registered - **Replaces `UsKeys` unless kept.** Include `UsKeys` in the union if you still want US punctuation like `[`. With `keys: GermanKeys` alone, `Mod+[` fails type-checking because German types `[` with `AltGr` or `Option`. - **Always allowed.** A to Z, 0 to 9, named keys (`Escape`, `F1`), and physical codes (`[KeyS]`) work under every registration. - **Casing.** Write letters uppercase (`Mod+Ö`, not `Mod+ö`), leaving `ß` and Turkish dotless `ı` as typed. -- **Shift-typed characters.** Layout letters typed with `Shift`, such as Turkish `İ` or Swiss German `È`, require `Shift+` (`Shift+İ`). Shift-typed symbols like `§` (via `Shift+3` on German) match without `Shift+`. +- **Shift-typed characters.** Layout letters typed with `Shift`, such as Turkish `İ` or Swiss German `È`, require `Shift+` (`Shift+İ`). Shift-typed symbols like `§` (via `Shift+3` on German) match without `Shift+`, and the types reject `Shift+§`, as they reject `Shift` with any symbol. - **Recorder.** `createHotkeyRecorder` captures whatever key the user presses, even outside your registered TypeScript union. ## Available key sets diff --git a/docs/framework/vue/guides/choosing-valid-hotkeys.md b/docs/framework/vue/guides/choosing-valid-hotkeys.md new file mode 100644 index 000000000..995439662 --- /dev/null +++ b/docs/framework/vue/guides/choosing-valid-hotkeys.md @@ -0,0 +1,219 @@ +--- +title: Choosing Valid Hotkeys in Vue +id: choosing-valid-hotkeys +description: Why TanStack Hotkeys rejects some hotkey strings, such as Shift+/, what to write instead, and which shortcuts the browser or operating system takes before your Vue app sees them. +--- + +You write a hotkey on your keyboard, and your users press it on theirs. Their keyboard can have another layout, another operating system, and another browser, and each of those can change what a key press means. A shortcut that works on your machine can fire on the wrong key for a German user, or never fire for someone on a Mac. + +TanStack Hotkeys absorbs most of these differences at runtime. A few it can't, because the hotkey string itself means more than one thing. For those, the types reject the string while you write it, so you find out in your editor and not from a bug report. This guide explains why those strings are rejected and what to write instead. It also covers the shortcuts no string can fix, because the browser or the operating system handles them before your app does. + +## Why `Shift+/` is a type error + +Say you want `?` to open a help dialog. On a US keyboard you type `?` with Shift and the `/` key, so you write down what you press: + +```ts +useHotkey('Shift+/', openHelp) // Type error +``` + +TypeScript rejects it. That can feel strict, since the string looks reasonable and would work on your keyboard. The problem shows up on other keyboards. + +A hotkey string names characters, and layouts put `/` and `?` on different keys. On a German keyboard, `/` is Shift+7 and `?` is Shift+ß. There, `Shift+/` can be read two ways: + +- You meant `?`, the character that US Shift+/ types. The library reads it that way, so German Shift+ß fires it. +- The string also says "Shift and `/`", and German Shift+7 is exactly that. So a German user who types a plain `/` fires it too. + +If your app binds `/` to search as well, that German user gets your help dialog instead of search, because an exact Shift match ranks above `/`. The library can't tell which reading you meant. Only you know that, so the types ask you to say it. + +When you mean the character, write the character: + +```vue + +``` + +`?` means the same thing on every layout. It fires on Shift+/ on a US keyboard and on Shift+ß on a German one, and the matcher takes care of the Shift the user needs to type it. + +When you mean the key's position, name the physical key. `Shift+[Slash]` is Shift with the key that US keyboards label `/`, whatever that key types on the user's layout. + +### Why letters and digits keep Shift + +Shift changes a letter's case, not which letter it is. `Shift+K` names the same key on every layout, so the types allow it. The Shift matters there too: `K` and `Shift+K` are two different shortcuts. + +Digits are safe for another reason. The matcher reads the digit row by position, so `Shift+1` fires on the key that types `1` on every layout. That includes French AZERTY, where the key types `&` without Shift. + +A symbol gets neither guarantee. Which symbol Shift adds to a key is up to the layout. + +### What can follow Shift + +After `Shift`, with or without other modifiers, a hotkey string takes a letter, a digit, a named key such as `Tab`, or a physical code such as `[Slash]`. A symbol after Shift is a type error: + +```ts +useHotkey('Shift+/', openHelp) // Type error +useHotkey('?', openHelp) // OK +useHotkey('Control+?', openHelp) // OK, fires on Control+Shift+/ on a US keyboard +useHotkey('Shift+[Slash]', openHelp) // OK, the physical key +useHotkey('Mod+Shift+/', openHelp) // Type error +useHotkey('Mod+?', openHelp) // OK +``` + +The same rule covers letters from [registered keyboard layouts](./keyboard-layouts): `Shift+Ä` is allowed, and `Shift+§` is a type error. + +The rule lives only in the types. A string from storage or user settings, such as a saved `'Shift+/'`, still matches as it did before, so shortcuts your users already saved keep working. + +In `.vue` files, `vue-tsc` reports these errors. `tsc` alone doesn't read them. + +## Mod with a symbol doesn't reach every Mac + +`Mod+?` is how you write Control+Shift+/ on Windows and Command+Shift+/ on macOS. On Windows and Linux it fires on every layout. macOS is less predictable. + +With Command held, macOS reports a different character for some keys than the one they type. Command+Shift on the key that types `?` reports `/` on German and Dvorak, `'` on Spanish, and `+` on Swedish. So `Mod+?` doesn't fire on those Mac layouts, while it does on US, UK, French, and Italian Macs. + +No symbol spelling covers that press on every Mac layout. When a shortcut has to work for everyone, such as the one that opens your command palette, give it a letter or a digit, such as `Mod+Shift+K` or `Mod+Shift+1`. To bind a key by position, use its physical code, such as `Mod+Shift+[Slash]`. + +[Keys match the character the user types](../../../guides/sensible-defaults.md#keys-match-the-character-the-user-types) has the details of how Command changes the reported key. + +## Replace a Shift string you already wrote + +When existing code has `Shift+` with a symbol, the right replacement depends on the keyboard it was written on, because whoever wrote it wrote what their keyboard typed. `Shift+,` types `<` on a US keyboard, `;` on a German one, and `?` on a French one. Find the string in the first column, then take the replacement from the column for the layout it was written on: + +| Ambiguous | US QWERTY | German | French AZERTY | +| --- | --- | --- | --- | +| `` Shift+` `` | `~` | `` ` `` | `` ` `` | +| `Shift+-` | `_` | `_` | `6` | +| `Shift+=` | `+` | `=` | `+` | +| `Shift+[` | `{` | `[` | `[` | +| `Shift+]` | `}` | `]` | `]` | +| `Shift+\` | `\|` | `\` | `\` | +| `Shift+;` | `:` | `;` | `.` | +| `Shift+'` | `"` | `'` | `4` | +| `Shift+,` | `<` | `;` | `?` | +| `Shift+.` | `>` | `:` | `.` | +| `Shift+/` | `?` | `/` | `/` | +| `Shift+_` | `_` | `_` | `8` | +| `Shift++` | `+` | `*` | `+` | +| `Shift+:` | `:` | `:` | `/` | +| `Shift+"` | `"` | `"` | `3` | +| `Shift+<` | `<` | `>` | `>` | +| `Shift+!` | `!` | `!` | `§` | +| `Shift+#` | `#` | `'` | `#` | +| `Shift+$` | `$` | `$` | `£` | +| `Shift+&` | `&` | `&` | `1` | +| `Shift+*` | `*` | `*` | `Shift+[Backslash]` | +| `Shift+(` | `(` | `(` | `5` | +| `Shift+)` | `)` | `)` | `°` | + +Each cell is what Shift and that key type on that layout. When the layout has no key that types the symbol without Shift, the replacement is the symbol itself. German `/` is Shift+7, so a German developer who wrote `Shift+/` meant `/`. + +A few more rules for reading the table: + +- The table leaves out strings whose replacement is the same symbol on all three layouts, such as `Shift+?` and `Shift+@`. Write the symbol: `?` or `@`. +- With other modifiers, keep them and use the same replacement. On a US keyboard, `Control+Shift+/` becomes `Control+?`, and `Mod+Shift+/` becomes `Mod+?`. +- French `µ` isn't in `FrenchKeys`, so its cell names the key by position instead. +- The German and French columns use the Windows layouts. The Mac layouts place some symbols differently. + +To keep a key's position instead of its character, use Shift with the key's physical code, such as `Shift+[Slash]`. + +## Physical codes name a key, not a character + +Use a physical code when the key's position matters more than its label, such as keys arranged in a row for a game or a drawing tool. The catch is the label. On other layouts the key types something else, so a hint that shows the US symbol can be wrong for those users. Shift and these codes type: + +| Physical code | US QWERTY | US Dvorak | German | +| --- | --- | --- | --- | +| `Shift+[Backquote]` | `~` | `~` | `°` | +| `Shift+[Minus]` | `_` | `{` | `?` | +| `Shift+[Equal]` | `+` | `}` | a dead key | +| `Shift+[BracketLeft]` | `{` | `?` | `Ü` | +| `Shift+[BracketRight]` | `}` | `+` | `*` | +| `Shift+[Backslash]` | `\|` | `\|` | `'` | +| `Shift+[Semicolon]` | `:` | `S` | `Ö` | +| `Shift+[Quote]` | `"` | `_` | `Ä` | +| `Shift+[Comma]` | `<` | `W` | `;` | +| `Shift+[Period]` | `>` | `V` | `:` | +| `Shift+[Slash]` | `?` | `Z` | `_` | + +When you pass a layout map, [`formatForDisplay`](./formatting-display) labels a physical code with the key's character on the user's layout. On a German keyboard, `Shift+[Slash]` shows as `Shift+-`. Without a layout map, which only Chromium browsers provide, the label is the US character for that position. + +## Some shortcuts belong to the browser or the operating system + +Some chords never reach your page. The browser or the operating system handles them first, so your handler doesn't run, and the user gets the browser's action instead. + +The types still accept these chords, and that's deliberate. The same chord can be free in an installed web app, in fullscreen, or in Electron. The types can't know where your app runs, but you do. + +### Browser tab shortcuts + +In a normal browser tab, these chords open, close, or switch tabs and windows. Chrome reserves them. The Firefox and Safari columns come from their source and bug reports, so treat a blank cell as unconfirmed, not as free: + +| Chord | Action | Chrome | Firefox | Safari | +| --- | --- | --- | --- | --- | +| `Mod+W` | Close tab | Reserved | Reserved | Reported reserved | +| `Mod+T` | New tab | Reserved | Reserved | Reported reserved | +| `Mod+N` | New window | Reserved | Reserved | Reported reserved | +| `Mod+Shift+W` | Close window | Reserved | Reserved | | +| `Mod+Shift+T` | Reopen closed tab | Reserved | | | +| `Mod+Shift+N` | New private window | Reserved | | | +| `Control+Tab`, `Control+Shift+Tab` | Next and previous tab | Reserved | Reported reserved | Reported reserved | +| `Control+PageUp`, `Control+PageDown` | Next and previous tab, Windows and Linux | Reserved | | | +| `Mod+Q` | Quit, macOS | Reserved | Not reserved | Reported reserved | + +Chrome reserves none of these in an installed web app window, and in fullscreen it keeps only the keys that leave fullscreen. If your app runs in a browser tab, pick other chords for its own actions. + +### Operating system shortcuts + +Each operating system keeps a few chords for itself. A chord is lost only on the system that keeps it: + +- **Windows.** Control+Alt+Delete, and most chords with the Windows key (`Meta`), such as Windows+L. +- **macOS.** Command+Tab, Command+Space, and Command+Option+Escape. +- **Linux.** Control+Alt+F1 through F12 switch to another virtual terminal. Desktops such as GNOME also take many chords with the Super key. + +Users can change many of these, so no list is complete. Prefer `Mod`, `Shift`, and `Alt` chords over `Meta` chords, which Windows mostly keeps. + +### Chords that can't fire on some layouts + +A few chords type a character the hotkey doesn't name, so they never fire on some layouts: + +- **Option with a shifted symbol on a US Mac.** Option+Shift+/ types `¿`, not `?`, so `Alt+?` and `Mod+Alt+?` never fire on a US Mac. Use the physical code instead, such as `Alt+Shift+[Slash]`. +- **Control+Alt on layouts with AltGr.** Windows treats Control+Alt as AltGr. On a German keyboard, Control+Alt+Q types `@`, so `Control+Alt+Q` never fires, and an `@` binding does. + +## Let users choose their own shortcuts + +The most reliable shortcut is often the one a user picks on their own keyboard. The [hotkey recorder](./custom-hotkey-recording) follows the rules in this guide for you: + +- It records only presses that reach the page, so in a browser tab it never records the browser and operating system chords above. +- It never writes Shift with a symbol. Shift+/ records `?`, and German Shift+7 records `/`. +- On a Mac with Command held, off the key's US position, the browser may not report the symbol the user typed. There the recorder records the key's physical code: Dvorak Command+Shift+/ records `Mod+Shift+[BracketLeft]`. + +A recorded hotkey can still fail on another machine. `Alt+F4` recorded on a Mac closes the window on Windows. See [Save hotkeys that work on another platform](./custom-hotkey-recording#save-hotkeys-that-work-on-another-platform) to keep synced hotkeys portable. + +To reject chords you don't want, such as the browser tab shortcuts in an Electron app that also ships to the web, return an error from `validate`: + +```vue + + + +``` diff --git a/docs/framework/vue/guides/custom-hotkey-recording.md b/docs/framework/vue/guides/custom-hotkey-recording.md index 9a0ce9b3d..614c206a0 100644 --- a/docs/framework/vue/guides/custom-hotkey-recording.md +++ b/docs/framework/vue/guides/custom-hotkey-recording.md @@ -39,7 +39,7 @@ const { isRecording, recordedHotkey, startRecording, cancelRecording } = ``` -With the default `recordBy: 'auto'`, the recorder outputs portable strings, written like a hand-typed string. Command+S on macOS and Control+S on Windows and Linux both record `Mod+S`. It records what the press typed, such as `?` for Shift+/ and `Mod+1` for AZERTY Ctrl+&. For the few presses whose character the browser reports differently by platform, it falls back to physical bracketed codes, such as `Alt+[Slash]` for macOS Option+/. A recorded character such as `@` fires wherever the layout types it, which can be a different key. See [Recording captures what the user pressed](../../../guides/sensible-defaults.md#recording-captures-what-the-user-pressed) for the full rules. Set `recordBy: 'code'` to always record the physical key, or `recordBy: 'key'` to always record the typed character. Pass the result straight to `useHotkey`, and label it with `useFormatForDisplay`. +With the default `recordBy: 'auto'`, the recorder outputs portable strings, written like a hand-typed string. Command+S on macOS and Control+S on Windows and Linux both record `Mod+S`. It records what the press typed, such as `?` for Shift+/ and `Mod+1` for AZERTY Ctrl+&. For the few presses whose character the browser reports differently by platform, it falls back to physical bracketed codes, such as `Alt+[Slash]` for macOS Option+/. A recorded character such as `@` fires wherever the layout types it, which can be a different key. See [Recording captures what the user pressed](../../../guides/sensible-defaults.md#recording-captures-what-the-user-pressed) for the full rules. Set `recordBy: 'code'` to always record the physical key, or `recordBy: 'key'` to record the typed character. Pass the result straight to `useHotkey`, and label it with `useFormatForDisplay`. The composable returns the recorder's state and controls. State members are readonly refs, so destructure them at the top level of `