Repository navigation
feat(sdk): hotkey labels say Enter, not ↵, off a Mac, and refuse misspelt keys - #1177
Merged
Merged
Conversation
1 of 2 tasks
Owner
Author
|
Review (GPT 6.1 Sol, xhigh) on ec6593d: approve, no findings.
|
Owner
Author
…pelt keys Co-Authored-By: Claude Opus 5.5 <[email protected]>
allisonmahmood
force-pushed
the
hotkeys/format-words-1160
branch
from
November 4, 2026 02:31
f5b9c73 to
e896b12
Compare
allisonmahmood
added a commit
that referenced
this pull request
Nov 4, 2026
…1182) ## What changed Agents moving patches onto `patchy/hotkeys` read the compiled bundle to answer questions the skill should answer: what counts as a text field, whether an extra modifier still matches, where propagation stops, why Ctrl+K reaches the address bar with a dialog open, why a native `<dialog>` stops closing on Escape, and how to type a table of bindings. The `patchy-hotkeys` skill now answers each of these, the package README mirrors the parts it covers, and the Preact skill's imports name `patchy/hotkeys`. Closes #1161 Stacked on #1177 (#1160), which also edits the skill's "Showing hotkeys" section. ## Look at Each item in the issue, and where it now lives. Every claim was checked against the pinned TanStack 0.19.0 code (`_event-target.js`, `_match.js`, `hotkey-manager.js`, `_registration.js`): | Issue item | Skill | README | |---|---|---| | Fields | When it fires: a text `<input>` or `<textarea>` that isn't read-only, `<select>`, contenteditable, `role="textbox"` / `role="searchbox"` | points to the skill | | Strict modifiers | Writing a hotkey: an extra modifier stops a match; a symbol's own Shift (`"?"`) isn't extra | "match exactly, so `"J"` doesn't fire on Shift+J" | | Propagation | When it fires: bubble-phase listener on the document; `window` never sees a fired key; earlier listeners and other document listeners do; a field that stops propagation hides the key from every hotkey | points to the skill | | Held keys reach the browser | Dialogs and scopes: a held hotkey doesn't block its keys (Ctrl+K reaches the address bar); one registered inside the scope does | "A held hotkey doesn't block its keys" | | Native `<dialog>` | Dialogs and scopes › Native `<dialog>`: a live Escape hotkey prevents `cancel`; wrap the dialog in a `HotkeyScope` and close one way, from `onCancel` with no Escape inside, as `HotkeySheet` does, or from an Escape hotkey's `run`; worked example | points to the skill | | Tables of bindings | Writing a hotkey: `HotkeyBinding<Chord>[]`, and `HotkeyBinding<Chord \| "G H" \| "G T">[]` for sequences | same | | `enabled` and the sheet | When it fires, beside `enabled`: tying it to a button's state makes the row come and go; check in `run` to keep it listed | — | | Preact skill imports | `patchy-preact` › Imports and rendering names `patchy/hotkeys` and its skill | — | The table types are the one claim a compiler can hold the skill to, so the typecheck test now declares a `HotkeyBinding<Chord | "G H">[]` table and passes it to `useHotkeys`. A table typed `HotkeyBinding<Chord>[]` with `"G H"` in it is refused with `Type '"G H"' is not assignable to type 'Chord'`, as the skill says. ## How it was verified Locally, with CI on this PR as the judge for the full suite: - `pnpm check`: format, lint, typecheck and synth pass. Its offline tests failed only in suites this change doesn't touch: stray `GET /` requests to the CLI's local stub servers and timeouts on a heavily loaded shared machine. - Re-run on their own: `SdkApi.test.ts`, which packs and serves the project skills, `initProject.test.ts`, which reads the Preact skill's lint block, and `hotkeys.test.ts`, with the new table line. 42 of 42 pass. - Not run locally: `pnpm verify`, which the machine's load ruled out. - Not run: a `pnpm dev trial` asking a fresh agent these questions. One trial run is a smell test, and acceptance is run separately. ## Release impact - [ ] **Breaking** — requires action from anyone already running this - [x] **Not breaking** — no action required Docs and one typecheck line. Patches receive the skill text through a release and `patchy refresh`. - **What does a revert leave behind?** Nothing. - **Does the release before it still work with that?** Yes. Built by Claude Opus 5.5 (`claude-opus-5-5`) in Claude Code, through T3 Code. Co-authored-by: Claude Opus 5.5 <[email protected]>
1 of 2 tasks
allisonmahmood
added a commit
that referenced
this pull request
Nov 4, 2026
…ges publish (#1241) ## What changed This adds release 36's What's new entry, written from `1acc968`. It covers everything merged since release 35's `through` (`dd0e2ec`), and sets the `patchy` release to `0.36.0` in `packages/patchy/package.json` and `CURRENT_RELEASE`. | Change | PRs | | --- | --- | | Improved: shortcuts work where you use them (keys for one part of a patch, the closest wins, text boxes keep their typing keys) | #1231 | | Improved: the shortcuts sheet shows what works where you are (Ctrl+/ and ⌘/ open it, its commands run, it opens from a patch's menu and in view on a narrow screen, keeps the look, spells keys out away from a Mac) | #1231, #1181, #1178, #1180, #1177 | | Fixed: keys pressed while a patch opens reach it | #1183 | | Fixed: pages styled with Tailwind 4 publish, and a look with the same rule saves | #1191 | | Fixed: an old copy of a patch no longer replaces newer work (**Breaking** for such a copy: it needs `patchy pull` or one `--allow-behind` publish) | #1179 | | Improved: your agent can check a publish before sending it | #1188 | | Improved: your agent hears what changed when it updates a patch | #1186, #1185 | | Fixed: your agent stops chasing false alarms (`pnpm install` exit codes, `manifest.json` bytes, the description notice, a copied dev record) | #1176, #1174, #1175 | | Behind the scenes: fuller hotkeys instructions for agents; fewer redraw costs for patches with many shortcuts | #1182, #1187 | `patchChanges` has three sentences for the agent refreshing a patch across this release: - #1231's, from its PR: text fields keep their keys, `preventDefault()`, and the sheet's Mod+/ and `.hotkey-row` buttons. - The sheet's dialog renders in `document.body`, and element-only page rules don't reach it (#1178, #1180). Its own row lists last (#1181). The hotkey label helpers take only valid literals (#1177). - Publish's `unknown_base_version` (#1179). It also rewords release 33's "Press ? to see every shortcut a patch has". That was true only for a patch that mounts the shortcuts sheet, so it now says a patch *can* list its shortcuts. The rest get no line: - #1206, #1207, #1209 and #1220 are `pnpm dev eval` tooling. - #1222 is release 35's own entry. ## Look at - **The entry**, at the top of `releases` in `packages/core/src/whatsNew.ts`, and release 33's reworded line. - **Rollback safety, from the live commit `d28fdd0` (release 35) to `1acc968`:** - #1191 is labelled `one-way`. Its Release impact: a company look published after this release with a nested `@supports` condition stays stored after a revert. Release 35 refuses any bundle carrying it, so repo publishes in that company would fail until an admin runs `patchy look restore` to an earlier revision. Pages and Tailwind 4 repos already published stay published. - #1183 is the only change to what the server serves browsers: the shell's script, under a digest-named URL. Its revert leaves nothing behind. - The hotkeys PRs change `patchy/hotkeys`, which patches bundle when they are built. Published patches keep their copy. - The CLI PRs change what a CLI writes and refuses. Release 35 reads everything they leave behind: #1176's `allowBuilds` entry, #1174's indented `manifest.json`, and the `version` recorded by an `--allow-behind` publish. **Rollback line:** If this release misbehaves, roll back to `d28fdd0` (release 35). First check that no company's look has a nested `@supports` condition, and `patchy look restore` an earlier revision where one does (#1191). ## How it was verified - **Tests.** `whatsNew.test.ts`, `WhatsNewPages.test.ts` and `schemas.test.ts` pass (22 tests), and `bun fmt` passes on the changed files. - **Facts.** The sheet's new `document.body` home and its element-rule reset were checked against `hotkeys.ts` and `hotkeySheet.ts` on main. - **Deploy state.** I pinned the live commit from `/healthz/deep`: `d28fdd0` (release 35). The Deploy run updated last succeeded, and none is unfinished. ## Release impact - [ ] **Breaking** — requires action from anyone already running this - [x] **Not breaking** — no action required Text and version numbers only. Like every release, the `0.36.0` bump tells CLIs and patch repos installed before this deploy to upgrade. - **What does a revert leave behind?** Nothing. - **Does the release before it still work with that?** Yes. Built by Claude Opus 5.5 (`claude-opus-5-5`) in Claude Code, through T3 Code. Co-authored-by: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What changed
On Windows and Linux,
formatHotkeyandhotkeyKeysdrew Delete, Backspace, Enter and Space as ⌦ ⌫ ↵ ␣, which are Mac conventions: a hint read "Ctrl+↵" where "Ctrl+Enter" is clearer. Both helpers also took anystring, soformatHotkey("Mod+Entr")typechecked. Now those four keys are words off a Mac, while a Mac keeps its symbols. A misspelt literal fails typecheck the way it does foruseHotkey, and modifier-only labels such as"Mod"and"Mod+Shift"still work.Closes #1160
Look at
Words off a Mac. TanStack's display
keyLabelsoverride supplies the four words whenever the platform isn't a Mac. A new runtime test fakes the navigator for Windows, Linux and a Mac. Onmainit fails at the first assertion:On this branch it passes:
formatHotkey("Mod+Enter")hotkeyKeys("Space Shift+Backspace Delete")Ctrl+Enter[["Space"], ["Shift", "Backspace"], ["Delete"]]⌘ ↵[["␣"], ["⇧", "⌫"], ["⌦"]]The input is checked. Both helpers take
Shown<S>: a hotkey checked likeuseHotkey's, modifiers alone, or astringthat isn't a literal. That last case keepshotkeyKeys(row.hotkey)working for rows fromuseHotkeyList, as custom sheets andHotkeySheetitself use it. Onmainthe new typecheck test reports no errors. On this branch it reports exactly these two:"Mod","Mod+Shift","Mod+Alt+Shift", sequences,Chordvalues anduseHotkeyListrows all still typecheck in the same file.How it was verified
pnpm exec vitest run src/hotkeys.test.tsinpackages/patchy: the two new tests fail onmainand pass here.pnpm verify: format, lint, typecheck, synth, postgres-concurrency, cli-smoke, install, tier2-smoke and browser pass. The browser suite includesformatHotkey("Mod+K")in the published frame on Linux and on an emulated Mac.testandtest (bun)failed only in suites this change doesn't touch: strayGET /requests to the CLI's local stub servers, timeouts and Vitest worker crashes on a heavily loaded shared machine.LocalTaskProvider.test.tsfails the same way on cleanmainhere. No hotkeys test failed.Release impact
Patch-side SDK display only. A patch that passes a misspelt literal to
formatHotkeyorhotkeyKeysfails typecheck afterpatchy refresh, which is the point; astringvariable is still accepted.Built by Claude Opus 5.5 (
claude-opus-5-5) in Claude Code, through T3 Code.