feat: add physical hotkeys, recorder validation, hints, and display options - #151
Conversation
|
Important Review skippedToo many files! This PR contains 224 files, which is 74 over the limit of 150. To get a review, reduce the PR to 150 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry. ⚙️ Run configurationConfiguration used: Repository: TanStack/hotkeys/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (145)
📒 Files selected for processing (224)
You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
🚀 Changeset Version Preview13 package(s) bumped directly, 0 bumped as dependents. 🟥 Major bumps
🟨 Minor bumps
|
@tanstack/angular-hotkeys
@tanstack/hotkeys
@tanstack/hotkeys-devtools
@tanstack/lit-hotkeys
@tanstack/preact-hotkeys
@tanstack/preact-hotkeys-devtools
@tanstack/react-hotkeys
@tanstack/react-hotkeys-devtools
@tanstack/solid-hotkeys
@tanstack/solid-hotkeys-devtools
@tanstack/svelte-hotkeys
@tanstack/vue-hotkeys
@tanstack/vue-hotkeys-devtools
commit: |
Changes
Add explicit physical bindings (
Mod+[KeyS]or{ code: 'KeyS', mod: true }) alongside logical key bindings. Recorders default to physical codes so Option-modified characters and shifted digits can be recorded and triggered consistently. Parsed and raw bindings carry eitherkeyorcode.meta.group, modifier-held hint helpers for every framework, and display parts, independent symbol options, readable physical labels, and optional caller-supplied layout maps.Bindings and persistence remain application state. This does not introduce an action catalog or preferences store.
Issues addressed
event.keyis an accented letter.useHotkeyreadstargetonce and never re-reads it.useHotkeysre-reads it every render, so the two hooks behave differently for the same option. #147 — re-readuseHotkeytargets after commit, including late refs and replacement elements.getHeldKeys()returns stale state duringHotkeySequenceRecorder/HotkeyRecorderrecording #114 — keep held-key state current while either recorder is active.Control+[KeyA]across non-Latin layouts. Active IME composition remains suppressed.+,_,;,Mod++, and shifted equals/minus.Mod+Shift+[BracketLeft]/Mod+Shift+[BracketRight].Mod+?/?missing #19 — support?andMod+?, including Shift used to produce?.Related discussions:
formatForDisplay(binding, { parts: true })supplies individual labels for custom keycap rendering.Validation
pnpm format && pnpm test && pnpm generate-docs(139 test/build/check tasks across 70 projects).TypeDoc reports its existing TypeScript 6 compatibility warning; generation succeeds.
Checklist
pnpm testsuite, which includes the PR checks.Release impact
Recorders now default to
recordBy: 'code'; choose'key'for logical recording. Clear operations call onlyonClear.RawHotkeyandParsedHotkeyare exclusive key/code unions, so consumers extending them with interfaces should use type intersections. See the changeset for the full public API list.