Repository navigation
chore(deps): move TanStack hotkeys to 0.27 - #1423
Conversation
|
Code review (GPT 6.1 Sol, xhigh) at Checked and held: upstream's input-method handling covers every case the old patch did (chords and sequences, Escape, Enter, arrows, modified keys, keyCode 229); the re-created sequence and One nit, fixed in Not checked by the review or the author: Safari itself. Its keyCode 229 keydown is replayed through Chromium, as the existing spec does. |
b870998 to
4410ac9
Compare
patchy/hotkeys bundles @tanstack/hotkeys 0.27.1 and @tanstack/preact-hotkeys 0.21.1, up from 0.19.0 and 0.17.1, and behaves as before. Upstream now leaves keys to an input method while it composes, Safari's keyCode 229 commit included, so the patch drops that part; a unit case pins it. The patch is re-created on 0.27.1 for what upstream lacks: sequence allowStep and onStep, a sequence on an element taking its keys first, and Element targets. It also keeps a live Escape hotkey's key while a modal dialog or popover is open, which upstream gave to the browser in 0.24 and the hotkeys skill documents otherwise; a browser test covers the skill's Escape-closes-the-dialog path. TanStack Store left the bundle, so the release carries one TanStack notice. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…tack 0.21 TanStack's Preact useHotkeys and provider use layout effects since 0.19.2, so the comments above useBindings and inside HotkeyScope no longer describe it. They now say what our own code does that upstream's hook doesn't, and that the provider would activate the same scope. Co-Authored-By: Claude Opus 5.5 <[email protected]>
4410ac9 to
d215c2e
Compare
Acceptance: PASS with notesChecked Done means
Golden journeys
Evidence
Rollback answers Both match the diff. The change has no migration, persisted data shape, server contract, or infrastructure change. Publications keep their bundled dependencies at their existing version, including pages published with the new SDK if the release is reverted. No Not run
Notes
|
What changed
patchy/hotkeysnow bundles TanStack Hotkeys 0.27.1 (core) and 0.21.1 (Preact adapter), up from 0.19.0 and 0.17.1. Shortcuts behave for patch authors and viewers as they did. Patches pick it up at their next publish. 0.29.0 / 0.23.0 came out yesterday, so pnpm's 24-hour release-age rule holds them back.Supersedes #1391, which fails in typecheck rather than at install. preact-hotkeys 0.17.1 still pulls core 0.19.0, so our 0.19.0 patch keeps applying to that copy. Meanwhile the new core lacks the patch's
Elementtarget type and its sequenceallowStep/onStepoptions, whichhotkeys.tsuses.Look at
The patch on TanStack, part by part. I read every changelog entry from 0.20 to 0.27.1 and diffed the 0.19.0 and 0.27.1 dist:
compositionend(keyCode 229 only) counts as composing._match.jsrefuses any composing key, andnormalizeKeyboardEventcounts keyCode 229.allowStepbefore taking a key and callonStepas they take one. A sequence on an element takes its keys ahead of chords and sequences further out.Element(an SVG chart), not onlyHTMLElement.<dialog>or an auto popover is open. That contradicts the hotkeys skill, which says a live Escape hotkey takes the key, and it breaks the skill's "register Escape inside, and close from itsrun". The browser would close the dialog but leave it mounted, with itsHotkeyScopestill holding the page's keys. The patch keeps today's behaviour. Adopting upstream's rule is a product decision for another PR, along with the skill text.The
pnpm-workspace.yamlcomment says each part and when to drop it.A test for the Escape hunk, red then green.
a native modal dialog's own Escape hotkey takes the key, so its run closes it and the scope goesis new inhotkeys.spec.ts. With upstream's Escape rule put back into the installed copy:With this branch's patch:
A test for composition. The browser spec covers Safari's committing Enter only inside a text field, where
fieldKeepsholds it back whatever TanStack does. A new unit case inhotkeys.test.tspins TanStack's own matching for Escape, Enter, ArrowDown, Mod+Enter and K. Each matches plainly, not withisComposing, and not with keyCode 229 alone. Unpatched 0.19.0 fails it: every one of those matches with keyCode 229, and all but K match while composing.Other upstream changes that reach pages, all matching fixes, none touching our API:
Unidentifiedthat has a usablecodeis no longer treated as composing (0.25.0). Chrome on Wayland sends Ctrl+` this way.fieldKeepsstill keeps everyUnidentifiedkey in text fields. Android's composing keys carry keyCode 229 and are still ignored.Mod+Alt+<letter>(0.26.0).ıis its own key, and Firefox numpad 5 without NumLock no longer fires5(0.27.0).dist/licensesnow carries one TanStack notice, and ADR-0011 says so.Formatting with
formatHotkey/hotkeyKeysis byte-identical between versions for every form we use, modifiers alone included, on Mac and elsewhere.How it was verified
pnpm verify(mise's Node 24 first on PATH): format, lint, typecheck, synth, postgres-concurrency, cli-smoke, install and tier2-smoke pass. The rest failed on the shared machine while sibling worktrees ran their own suites, at a load average of 25 to 50.testandtest (bun)failed with timeouts only.browserfailed when a throwaway instance couldn't bind its port, which stopped the run. Rerun at a load of about 6:test:bunpasses, andtestpasses but for two 5-second timeouts incompany-databaseandpatches. The full Chromium browser suite passed earlier, 188 of 188. CI arbitrates.hotkeys.test.ts,hotkeyRules.test.ts,hotkeySheet.test.ts,pageImports.test.tsand core's switcherkey.test.ts, which uses TanStack's matcher as its oracle, pass.focus.spec.ts, 10 passed.pnpm dev:patchy inita tier 1 repo from the instance's release, which bundles the patched TanStack. I published a page with a sequence beside its first step's chord, a list's own ArrowDown, a field, and a native modal dialog in aHotkeyScopethat closes from its Escape. Then I drove it in desktop Chromium as the dev persona:G Hfired the page's G and G H.ghin the field fired nothing; Mod+K there fired.G Hfired again.?opened and closed the sheet.Release impact
Bundled SDK dependency.
patchy/hotkeyskeeps its API and behaviour; published pages keep their own bundle until they are republished.Claude Opus 5.5, T3 Code via Claude Code.
🤖 Generated with Claude Code