Repository navigation
feat(sdk): HotkeySheet's own row takes a group, and openHotkeySheet opens it from a page's control - #1181
Conversation
|
The hotkeys browser spec ran at this head: The sheet case covers the own row last in its |
6509a1f to
eb86790
Compare
38bbf17 to
fb25e86
Compare
|
Re-check (GPT 6.1 Sol, xhigh) on fb25e86: PASS for this PR's change. The own-row normalisation matches TanStack's registration across 958 supported chords plus sequences, in Chromium and Firefox with Linux, macOS and Windows detection. That's 2,876 cases per combination, covering lowercase letters, modifiers, sequences, |
fb25e86 to
465c8df
Compare
465c8df to
b9ed80a
Compare
b9ed80a to
09e9a6e
Compare
Acceptance: PASS with notesChecked I built a tier 1 patch from the environment's CLI to exercise this:
I opened both as Ada in Chromium. Done means
Golden journeys
Rollback answers: they match the diff. This adds SDK API without changing the server. Published bundles keep working after a revert, and repos that adopted the new API stop building until production rolls forward again, as with any new helper. Not run
Notes
|
5f05bf1 to
4fd1683
Compare
…t finishes without a look (#1180) ## What changed A page's ordinary element rules restyled the shortcuts sheet by accident. One page's `kbd { … }` shrank every keycap, another's hid them, and a `button { … }` rule redrew the `?` and close buttons. On a page without the company look, the sheet drew in the system font with an ink frame and an offset shadow that matched nothing, and the `?` button had no hover. Now the page's rules made only of element names, however long, such as `kbd`, `html body kbd` or `body dialog`, don't reach the sheet or its button. Rules aimed at the `hotkey-*` classes still restyle them. Without a look, the sheet and button take the page's font and text colour, with hairlines and no shadow. With a look, the `?` is one of the look's buttons, square, with the look's height and hover. Closes #1158 ## Look at **A page without the company look**, with its own `kbd` and `button` rules. Before, the page's green button rule and dark keycap rule reach the sheet, and it draws in the system font with a black frame and an offset shadow. After, it draws in the page's serif and text colour, with hairlines: | Before | After | | --- | --- | |  |  | |  |  | The button row is hovered: before, it was the page's green button with no hover feedback; after, it has a hover tint. **With the Patchy look**, the sheet itself is unchanged, and the `?` becomes one of the look's buttons. This is the call to check: "follows the look's control size and hover" read literally makes it the look's plain button, which in the Patchy look is the blue primary. The look's hover only makes sense on the look's own resting colours, so the colours come with it. | Before | After | | --- | --- | |  |  |  These screenshots render the real `HotkeySheet` from each commit's source, bundled into one page in Chromium, without the Patchy frame. The base is #1157's head. **How the stylesheet is built** (`packages/patchy/src/hotkeySheet.ts`): two `<style>` elements. ``` first in <head>, unlayered, moved back first each time the sheet opens: .hotkey-opener, .hotkey-sheet-dialog, .hotkey-sheet-dialog *, .hotkey-sheet-dialog::backdrop { all: revert-layer } .hotkey-sheet-dialog, .hotkey-sheet-dialog * { direction: inherit; unicode-bidi: normal } one class outranks any number of element names; every page stylesheet comes after it, so a page's one-class rule such as `.hotkey-key` wins the tie; `all` leaves out direction and bidi after the page's styles, once: @layer look.patchy-hotkeys { .hotkey-opener … } inside the look's layer, beneath the look's own rules: the page's layered button styles make it one of its buttons @layer patchy-hotkeys { declared after the page's existing layers: .hotkey-sheet-dialog, … * { all: revert } past every author layer, so e.g. Tailwind's preflight in … :focus-visible { outline: revert-layer } `@layer base` doesn't reach the parts; focus rings come back the sheet's defaults … then drawn from the look's tokens } ``` **The contract:** element rules in the page's stylesheets, layered or not, don't reach the sheet. Its unlayered rules with a class, attribute or pseudo-class can, `button:hover` included, and so can layers declared after the sheet first mounts. The `?` button also takes the page's layered styles, as the page's own buttons do, which is how it follows the look. - Blocked: element rules of any length, wherever they sit, such as `kbd`, `html body kbd` inside `@media`, `html body dialog div div section ul li span kbd`, and a Tailwind-style `@layer base { kbd { … } button { … } }`, including rules added to that layer later. `direction` and `unicode-bidi` on `kbd` or on the `dialog` are blocked too: on a right-to-left page, the sheet stays right to left. - Not blocked: unlayered rules with a class, attribute or pseudo-class, such as `button:hover` or `.dark kbd`. - Always wins: the patch's unlayered rules aimed at the `hotkey-*` classes, a single class included, as in `.hotkey-key { … }`. That holds even for one prepended to `<head>` after the sheet mounted, since the sheet moves its reset back first as it opens. A hover restyle names the state with the class: `.hotkey-opener:hover`. - Documented limits: layers the page declares after the sheet first mounts; class rules inside the page's earlier layers, which the layered reset wipes like element rules; and a page that replaces `<head>` wholesale, which loses the reset until the sheet next opens. The `button:hover` choice was deliberate: a patch's deliberate `.hotkey-opener` restyle matters more than blocking an accidental hover rule. The page's unlayered class rules and element rules differ only in specificity and source order. Blocking `button:hover` (0,1,1) would also outweigh `.hotkey-opener` (0,1,0). On a page without a look, tokens used without a fallback drop out: `color: var(--look-fg)` inherits the page's colour, the card's shadow disappears, and each line falls back to a hairline. A `max-content` width with `aspect-ratio: 1` keeps the `?` square at whatever height the look gives its buttons, even in a stretching flex column. ## How it was verified - A new browser case, `a page's element rules don't reach the sheet…`, publishes a page with unlayered `kbd`, `button` and `dialog` rules, longer ones such as `html body main button`, `body dialog` and `@media (min-width: 0px) { html body kbd { display: none } }`, a `body *` rule, a Tailwind-style `@layer base` preflight on `kbd` and `button`, `direction: rtl` on `kbd`, plus a one-class `.hotkey-key` rule, all in `<head>` before the sheet mounts. After it mounts, the page prepends a `.hotkey-key` rule ahead of the reset; opening the sheet moves the reset back first, and that rule wins. The page then adds `html body dialog div div section ul li span kbd`, one weighing twenty element names, and a rule in the existing `base` layer. The keycaps stay visible, opaque, in the page's font and left-to-right, and the close button isn't uppercased. No element of the sheet or its button takes the `body *` rule, while `main` does. A one-class rule for every rendered `hotkey-*` class, added after the reset, reaches every part. Without a look it checks that the keycaps keep their size, the close button its padding and the dialog its border, and that the class rule still colours the keycaps. It also checks the page's font and colour, the 1px frame, no shadow, and a hover on the `?`. It then adds a look and checks that the `?` is 48×48, takes the look's resting and hover backgrounds, and that the sheet takes the look's 2px frame and offset shadow. - `pnpm exec playwright test -c playwright.tier1.config.ts --project=chromium test/browser-tier1/hotkeys.spec.ts`: 5 passed at the stack's head (`09e9a6e`, #1181), which carries this PR's case unchanged. The screenshots above were re-shot at this head and came out byte-identical. - Locally: format, lint, `pnpm typecheck`, `pnpm typecheck:tests`, and the hotkeys and SDK skill tests (`hotkeys.test.ts`, `hotkeySheet.test.ts`, `hotkeyRules.test.ts`, `SdkApi.test.ts`), all passing. No full `pnpm verify` ran locally: the machine is shared and heavily loaded, so CI's full suite is the judge. - The `?` measured square in a flex column, a flex row and a block, with no look (36px), the Patchy look (44px) and a look whose buttons are 32px high. The README's sheet paragraph, the `HotkeySheet` doc comment and the `patchy-hotkeys` skill now describe the styling. ## Release impact - [ ] **Breaking** — requires action from anyone already running this - [x] **Not breaking** — no action required Patch-side SDK styling. A patch picks it up when it is rebuilt against a release that carries it, and its `?` button then looks like the look's buttons. Its own rules aimed at `hotkey-*` classes keep working. - **What does a revert leave behind?** Nothing on the server. Patches built with this release keep these styles in their bundle until they are rebuilt. - **Does the release before it still work with that?** Yes. No schema, API or server change. 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]>
…pens it from a page's control Co-Authored-By: Claude Opus 5.5 <[email protected]>
391fec5 to
9e62e67
Compare
…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]>


What changed
The shortcuts sheet's own "Show shortcuts" row always listed under General, which forced a one-row General column on a patch that groups its keys. With no groups, it listed before the page's keys, because a child's hotkeys register before its parent's. Patches worked around it by registering their keys in a separate child ahead of the sheet. Nothing but the sheet's own
?button and key could open it, so a patch whose narrow layout reaches shortcuts from a menu item kept a hand-built sheet. Now<HotkeySheet group="…" />puts its row in one of the page's groups, and the row lists after the page's keys wherever it sits.openHotkeySheet()opens the mounted sheet from a control of the page's own.Closes #1159
Look at
sections(list, own)inpackages/patchy/src/hotkeySheet.tsmoves the sheet's own row after the page's hotkeys before grouping, so it lists last in its section. A group made only of that row comes after the page's groups. It recognises the row through TanStack's normalisation on both sides, so<HotkeySheet hotkey="j" />, registered asJ, is still its own row.openHotkeySheet()inpackages/patchy/src/hotkeys.tsopens the mounted sheet through the same state as its?button. It warns in the console when no sheet is mounted. Focus is the dialog's own: it moves to the close button and goes back to the control that opened it.The browser case's page registers its keys in the parent and mounts
<HotkeySheet group="Navigation" />in a child, so the sheet's row registers first. On the head:Before, the row would have listed first, under a General column of its own. A new step clicks a page button that calls
openHotkeySheet()with the sheet's button hidden. It expects the sheet visible with its close button focused, then Escape returns focus to that button.How it was verified
pnpm exec vitest run packages/patchy/src/hotkeySheet.test.ts packages/patchy/src/hotkeys.test.ts: the newsectionscases cover the row last in its group and last in an ungrouped list, and a lowercasehotkeyprop against its registered capital. Each was red before its change. The published types acceptgroupandopenHotkeySheet().pnpm exec playwright test -c playwright.tier1.config.ts --project=chromium test/browser-tier1/hotkeys.spec.ts: 5 passed at09e9a6e.pnpm typecheck,pnpm typecheck:tests, and the hotkeys and SDK skill tests (hotkeys.test.ts,hotkeySheet.test.ts,hotkeyRules.test.ts,SdkApi.test.ts), all passing. No fullpnpm verifyran locally: the machine is shared and heavily loaded, so CI's full suite is the judge.The
patchy-hotkeysskill states both, as do the README's sheet paragraph and the glossary's shortcuts sheet entry.Release impact
Additive SDK API: a
groupprop and anopenHotkeySheetexport. A sheet withoutgroupstill lists its row under General, now after the page's keys.grouporopenHotkeySheet()would fail its typecheck when rebuilt against a release without them.Built by Claude Opus 5.5 (
claude-opus-5-5) in Claude Code, through T3 Code.