Repository navigation
fix(sdk): hotkeys hold repeat: false across remounts, wait during composition and accept shifted symbols - #1152
Conversation
…position and take shifted symbols - repeat: false skips a keydown the browser marks as a repeat, instead of TanStack's per-registration requireReset, which a component remounting mid-press starts afresh. - TanStack's matcher drops every key while an input method composes, not only printable ones, through a one-line pnpm patch: Patchy's callback runs after TanStack has already prevented and stopped the key, so the match has to stop there. - Key accepts every ASCII symbol, "+" and "Mod++" included, and a doubled space says steps are separated by one space. - The skill states that Alt chords wait in text fields and that whileTyping: true takes a focused control's keys too. Closes #1151 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Safari can send the keydown that commits a composition after compositionend, with isComposing false and keyCode 229. Count keyCode 229 as composing in TanStack's shared normalizer, so neither chords nor sequences match it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Review (GPT 6.1 Sol, xhigh) on 3619a86: request changes, one P2.
|
|
Re-check (GPT 6.1 Sol, xhigh) on 8077b76: PASS, no findings. The keyCode 229 rule reaches chord matching and the manager's sequence guards: 229 keydowns neither start nor complete |
Acceptance: PASS with notesChecked Done means
Golden journeys
Rollback answers: they match the diff. There are no migrations, no Not run
Notes
|
…tals stay exact (#1222) ## What changed This adds release 35's What's new entry, written from `dd0e2ec`. It covers everything merged since release 34's `through` (`e5334ca`), and sets the `patchy` release to `0.35.0` in `packages/patchy/package.json` and `CURRENT_RELEASE`. | Change | PRs | | --- | --- | | Fixed: keyboard shortcuts in patches do what they say (a once-per-press shortcut doesn't fire again while held, shortcuts wait during input-method composition, symbol keys such as `+` work on every keyboard) | #1152 | | Improved: agents keep shared totals exact | #1184 | The rest get no line: - #1147, #1154, #1189, #1155, #1172 and #1153 are `pnpm dev eval` tooling. - #1150 renames a CI check. - #1203 is an internal docs paragraph. - #1221 changes the production spend alerts, which nobody using Patchy sees. - #1149 is release 34's own entry. ## Look at - **The entry**, at the top of `releases` in `packages/core/src/whatsNew.ts`. - **Rollback safety, from the live commit `11dc68b` (release 34) to `dd0e2ec`:** - None of the 11 PRs is labelled `one-way`, and each one's Release impact answers say a revert leaves nothing behind. - #1152 changes `patchy/hotkeys`, which patches bundle when they are built. Published patches keep the copy they bundled. A patch repo that writes `"+"` stops typechecking only if it moves back to an older `patchy` release. - #1184 is skill text. #1147 adds a dev-only personas option that production never reads. - #1221 changes a cost setting on the two budgets in the base stack. Releases don't read budgets. - Nothing else touches code that runs in production. **Rollback line:** If this release misbehaves, roll back to `11dc68b` (release 34). ## How it was verified - **Tests.** `whatsNew.test.ts`, `WhatsNewPages.test.ts` and `schemas.test.ts` pass (21 tests), and `bun fmt` passes on the changed files. - **Deploy state.** I pinned the live commit from `/healthz/deep`: `11dc68b` (release 34). 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.35.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]>
…tch (#1186) ## What changed Refresh named new SDK capabilities, but not the behaviour changes in the releases it skipped. An agent upgrading a patch across several releases wasn't told that pages had moved to Preact 11's stricter types, or that `ctx.members.list()` now returns the patch's guests. One patch counts every member as staff, so a guest would be miscounted. Now a refresh that crosses releases lists each change in them that can make an existing patch build or behave differently. A refresh within one release lists nothing. Closes #1166 ## Look at - **The changes come from What's new.** Each release in `packages/core/src/whatsNew.ts` gains `patchChanges`: sentences for the agent refreshing a patch, naming what to check. It's required, so the agent writing the next release decides each time, and the header says when to write one. Backfilled for releases 22 (TypeScript 7), 24 (tier 1 reaches only its own tables and files), 25 (tier 0 gone), 30 (Preact 11's types), 31 (guests in the member directory), 32 (Pidgeon's recipient cooldown) and 35, which merged after this was written (`patchy/hotkeys`'s `repeat: false`, input-method composition and symbol keys, from #1152). The rest are `[]`. These never reach the What's new page or `/whats-new.json`. - **The installed release lists them, so old CLIs show them too.** As with the TypeScript warning in #1185, which this PR stacks on, an old pinned CLI only relays what the installed release's toolchain inspection reports. The inspection reads the release the repo's last generation names (`patchy/_generated/index.json`, not yet replaced at that point), and adds a `Changed in 0.<id>.0: …` warning for each patch change after it, oldest first (`releaseChanges.ts`). The CLI's import allowlist gains `@patchy/core/whatsNew`. - **A real 0.13 CLI, before and after.** The repo from #1185's transcript, refreshed by its 0.13.0 CLI, then once more by the release it now pins. Today's instance won't let a 0.13 CLI start a repo, so today's CLI starts it and the first line marks its last generation as release 13's: <!-- patchy-dev:transcript:old-cli-crossed-releases --> #### Transcript `old-cli-crossed-releases` Before is `8fea661` (--base) and after is `3d330d1` (lane-d/refresh-release-changes), both on the `team` scenario, from `pnpm dev transcript`. Each line ran in its own `bash -c` from the side's agent workspace, as the scenario's signed-in CLI, with stdin closed. Each side's origin reads `<origin>`, its environment folder `<env>`, its checkout `<checkout>` and the home folder `~`; nothing else is normalized. Nothing in it matched a collected secret (each side's CLI state, machine-token, login-code, API-key and access-token shapes, email addresses outside the scenarios' example domains, secret-named variables, and any accounts the run acts as). 1 of 3 lines changed. ##### A repo last generated by release 13, pinned to its 0.13 CLI and still on TypeScript 6 <details><summary><code>$ patchy init old-notes --purpose "Synthetic notes" --json > /dev/null && cd old-notes && pnpm add --s…</code>: no change, exit 0 in 4.8 s</summary> ```console $ patchy init old-notes --purpose "Synthetic notes" --json > /dev/null && cd old-notes && pnpm add --save-dev --ignore-workspace 'patchy@file:/tmp/patchy-0.13.0.tgz' 'typescript@^6' > /dev/null 2>&1 && node -e 'const fs = require("fs"); const file = "patchy/_generated/index.json"; fs.writeFileSync(file, JSON.stringify({ ...JSON.parse(fs.readFileSync(file, "utf8")), release: "0.13.0" }))' && pnpm -… 0.13.0 ``` _Lines are cut at 400 characters. `--json` has it all._ </details> ##### Its own 0.13 CLI refreshes it to the instance's release **Changed.** Before, exit 0 in 3.4 s; after, exit 0 in 2.4 s. ```console $ cd old-notes && pnpm --silent patchy refresh --json | node -e 'const r = JSON.parse(require("fs").readFileSync(0, "utf8")); console.log(JSON.stringify({ ok: r.ok, release: r.release, warnings: r.warnings }, null, 2))' { "ok": true, "release": { "from": "0.13.0", "to": "0.34.0" }, "warnings": [ "This repo has TypeScript 6.0.3; this release publishes only TypeScript ^7.0.2 (tested against 7.0.2). Run: pnpm add --save-dev 'typescript@^7.0.2'. typescript-eslint doesn't run beside TypeScript 7: if the lint script runs ESLint, move it to Oxlint as .agents/skills/patchy-loop/SKILL.md says.", "Changed in 0.22.0: Publish needs TypeScript 7: it refuses a repo whose installed TypeScript is outside the release's range. typescript-eslint can't run beside TypeScript 7, so a lint script on ESLint moves to Oxlint, as Toolchain in .agents/skills/patchy-loop/SKILL.md says.", "Changed in 0.24.0: A tier 1 page reaches only its own tables and files. Company connections, other patches' shared tables and stores, the member directory and member columns are tier 2's, reached from server handlers; refresh, dev and publish refuse a tier 1 repo that declares any of them with tier_mismatch.", "Changed in 0.25.0: Tier 0 is gone: a repo still at tier 0 is refused until patchy.config.ts says tier: 1 and refresh runs.", "Changed in 0.30.0: Pages build on Preact 11, whose types are stricter, so publish's typecheck can fail where it passed before. Attribute and event types such as HTMLAttributes, TargetedEvent and CSSProperties come from patchy/preact, no longer from its JSX namespace.", "Changed in 0.31.0: The member directory includes the patch's guests, people at another company it's shared with: list, search, get, pickers and member columns can return them, with guest: true and never admin. Code that counts every member as company staff should check guest, and a handler result schema that lists a member's fields needs guest too.", "Changed in 0.32.0: A Pidgeon send held by the recipient cooldown, a new message to someone the address wrote to recently, fails with source_rate_limited and details.limit recipient_cooldown: nothing was sent, and sending again soon is held too, so reply in the conversation instead." ] } ``` ```diff @@ 5 unchanged lines @@ }, "warnings": [ - "This repo has TypeScript 6.0.3; this release publishes only TypeScript ^7.0.2 (tested against 7.0.2). Run: pnpm add --save-dev 'typescript@^7.0.2'. typescript-eslint doesn't run beside TypeScript 7: if the lint script runs ESLint, move it to Oxlint as .agents/skills/patchy-loop/SKILL.md says." + "This repo has TypeScript 6.0.3; this release publishes only TypeScript ^7.0.2 (tested against 7.0.2). Run: pnpm add --save-dev 'typescript@^7.0.2'. typescript-eslint doesn't run beside TypeScript 7: if the lint script runs ESLint, move it to Oxlint as .agents/skills/patchy-loop/SKILL.md says.", + "Changed in 0.22.0: Publish needs TypeScript 7: it refuses a repo whose installed TypeScript is outside the release's range. typescript-eslint can't run beside TypeScript 7, so a lint script on ESLint moves to Oxlint, as Toolchain in .agents/skills/patchy-loop/SKILL.md says.", + "Changed in 0.24.0: A tier 1 page reaches only its own tables and files. Company connections, other patches' shared tables and stores, the member directory and member columns are tier 2's, reached from server handlers; refresh, dev and publish refuse a tier 1 repo that declares any of them with tier_mismatch.", + "Changed in 0.25.0: Tier 0 is gone: a repo still at tier 0 is refused until patchy.config.ts says tier: 1 and refresh runs.", + "Changed in 0.30.0: Pages build on Preact 11, whose types are stricter, so publish's typecheck can fail where it passed before. Attribute and event types such as HTMLAttributes, TargetedEvent and CSSProperties come from patchy/preact, no longer from its JSX namespace.", + "Changed in 0.31.0: The member directory includes the patch's guests, people at another company it's shared with: list, search, get, pickers and member columns can return them, with guest: true and never admin. Code that counts every member as company staff should check guest, and a handler result schema that lists a member's fields needs guest too.", + "Changed in 0.32.0: A Pidgeon send held by the recipient cooldown, a new message to someone the address wrote to recently, fails with source_rate_limited and details.limit recipient_cooldown: nothing was sent, and sending again soon is held too, so reply in the conversation instead." ] } ``` ##### Refreshing again, now within one release <details><summary><code>$ cd old-notes && pnpm --silent patchy refresh --json | node -e 'const r = JSON.parse(require("fs").re…</code>: no change, exit 0 in 2.0 s</summary> ```console $ cd old-notes && pnpm --silent patchy refresh --json | node -e 'const r = JSON.parse(require("fs").readFileSync(0, "utf8")); console.log(JSON.stringify({ ok: r.ok, release: r.release, warnings: r.warnings }, null, 2))' { "ok": true, "release": { "from": "0.34.0", "to": "0.34.0" }, "warnings": [ "This repo has TypeScript 6.0.3; this release publishes only TypeScript ^7.0.2 (tested against 7.0.2). Run: pnpm add --save-dev 'typescript@^7.0.2'. typescript-eslint doesn't run beside TypeScript 7: if the lint script runs ESLint, move it to Oxlint as .agents/skills/patchy-loop/SKILL.md says." ] } ``` </details> <!-- /patchy-dev:transcript:old-cli-crossed-releases --> - **The test, red then green.** In `cliRepo.test.ts`, a repo last generated by release 29 must list exactly what releases 30 onward record, then nothing on a second refresh. With `toolchainChild.ts` restored to the base's, it fails: `AssertionError: expected [] to deeply equal [ …(3) ]`. ## How it was verified Locally, with CI running the full suite: - `pnpm check` on this branch: format, lint and synth pass. Typecheck caught the portal's What's new test fixtures missing `patchChanges`; they have it now, one fixture showing it stays out of `/whats-new.json`, and `turbo run typecheck typecheck:tests` passes. The offline test step's 25 failures were stray-request asserts and 5-second timeouts under load in files this doesn't touch; those files passed on their own, `cliPublish`'s request-counting sharing test on 3 reruns of 3. - `cliRepo.test.ts` (the new test, and #1185's cross-release test, which now also expects a crossed release's line through an installed CLI), `whatsNew.test.ts` and `WhatsNewPages.test.ts` pass. - The red-then-green run above, rebuilding the CLI package each way. - The transcript above: a real 0.13.0 CLI refreshing to this branch's release on throwaway instances. - No full `pnpm verify` locally; CI is the judge for the full suite. ## Release impact - [ ] **Breaking** — requires action from anyone already running this - [x] **Not breaking** — no action required It adds warnings to refresh and a field to the release list. - **What does a revert leave behind?** Nothing stored. - **Does the release before it still work with that?** Yes. The toolchain reply's shape is unchanged. 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]>
What changed
Agents moving six patches onto
patchy/hotkeysfound three places where it didn't do what thepatchy-hotkeysskill says:repeat: false: a held key fired again whenever its component remounted. Holding A approved five records in a row."+","!","*"and the others failed typecheck, so agents wrote"Shift+=", which a numpad or German+key doesn't match.Now:
repeat: falsefires once per physical press."Mod++"included.The skill now also says that Alt chords wait in text fields, and that
whileTyping: truetakes a focused button's Enter too.Closes #1151
Look at
Composition is fixed by a two-line
pnpm patchof TanStack.preventDefaultandstopPropagationon a match before it calls Patchy's callback.compositionend, withisComposingfalse andkeyCode229. The patch also countskeyCode229 as composing in TanStack's shared normalizer, so neither chords nor sequences match it:patchy/hotkeys, so the fix ships in the package.Over the base matcher, with a real composition started through Chrome's DevTools protocol, the new browser case got:
The composing Escape and Ctrl+Enter both fired. On the head, only the Escape pressed after the composition commits fires. Both composing keys reach the window not prevented.
repeat: falsereadsevent.repeatinstead of TanStack'srequireReset.requireResetis tracked per registration, and a component that remounts while the key is held registers afresh.A record that approves itself on A and remounts the next one, with A held through two repeats and then pressed again:
Types.
Keytakes all 32 ASCII symbols. TanStack reads a trailing+as the key, so"+","Mod++"and"G +"parse as written."Mod+"is still refused, and"G H"now says:It used to say
'' isn't a chord.How it was verified
Types:
pnpm exec vitest run packages/patchy/src/hotkeys.test.tspasses. Over the basehotkeys.tsit fails:"+","Mod++"and"G +"are refused with'+' isn't a chord: …;not assignable to type 'Chord';"G H"gets'' isn't a chord.With the
hotkeyRules,hotkeySheet,pageImportsandSdkApitests, that is 61 tests passing.Browser tier:
pnpm exec playwright test -c playwright.tier1.config.ts --project=chromium test/browser-tier1/hotkeys.spec.ts, 4 passed. Over the base matcher and the oldrequireReset, the composition and remount cases fail as quoted above.The layouts step fires
"+"from US Shift+=, the numpad's+and a German+key, and"Mod++"from Ctrl with the numpad's+.pnpm verifyon a shared machine:test,test (bun)andtier2-smokefailed because/tmpran out of space during the run.tier2-smokepasses.testandtest:bunstill fail, for three reasons: CLI stub tests seeing a strayGET /from another local process, vitest workers killed for memory, and Postgres in recovery mode. No failing file touches hotkeys.Not checked:
Input.imeSetCompositionstands in: keys sent during it arrive withisComposingset, as they do under an IME.keyCode229, after the composition commits) through Chromium. Over the matcher without thekeyCode229 rule, it firedMod+Enter; on the head it fires nothing and reaches the window not prevented.Release impact
Tick exactly one.
The SDK fix ships with the next
patchyrelease. The type now accepts more strings, and only the double-space message changed.patchy/hotkeysthey bundled. A patch repo that wrote"+"or"!"stops typechecking if it moves back to an olderpatchyrelease.Built by Claude Opus 5.5 (
claude-opus-5-5) in Claude Code, through T3 Code.