Repository navigation
feat(core): the app runs on Geist, and running patches keep their own styles - #1332
Conversation
|
Sol review round 1 (GPT 6.1 Sol, xhigh): one Should fix, no Must fix. Fixed in 33142d3: a refusal at a content URL (404, sign-in door, needs-rebuild) is drawn under the frame's sandbox policy, which admits no font of ours, so it logged CSP refusals; |
33142d3 to
bcb6d06
Compare
bcb6d06 to
cd908ee
Compare
… styles First-party pages drew in each OS's system font, and a running patch's shell imported the same stylesheet, so any restyle of the app would leak into every patch. - Today's `shellStyles` becomes `servedStyles`, byte for byte, pinned by a digest test; only the patch shell imports it. First-party pages use `appStyles`. - Geist and Geist Mono (Vercel's variable woff2 from geist 1.9.2, unmodified, SIL OFL 1.1 with OFL.txt) are committed in packages/core/fonts and listed in its package files, so the server image stages them. - The portal serves them outside the viewer gate at digest URLs under /assets/fonts/: font/woff2, immutable, GET and HEAD, no cookie. Pages preload the text face and fall back to metric-matched Arial. - pageResponse's policy gains font-src 'self'. Stopping and needs-rebuild notices and the global 404 share a first-party notice policy in place of the old patch-content one. Running-shell and patch-content policies are unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Refusals at a content URL (the 404, the sign-in door, needs-rebuild) are first-party documents drawn under the frame's sandbox policy, which admits no font of ours, so they logged a refusal for every font. The serving headers already pick that policy for them; they now also drop the app's font preload and faces from the document. Its status, headers and the rest of its body are unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
cd908ee to
d05d4c8
Compare
Acceptance: PASS with notesChecked Done means
Golden journeys
Rollback answers: match the diff. No migration, persisted-data shape, API/CLI contract or infrastructure change. Cached font URLs are harmless after revert; no Local test evidenceNot run
Notes
|
|
Ok. Basically what I understand is that we change our style to Geist so the app looks consistent on everyone’s computer and that we separate the style from the tools so that they would never change each other (hence Geist for regular and Geist Mono for patches). |
…1336) Stacked on #1332; part of #1315. Merge the stack together, not alone. ## What changed Every first-party page drew from one stylesheet with 27 font sizes, weights from 450 to 900, capitals in labels and hard shadows on things that don't float, so pages looked assembled rather than designed. Now every page reads in the overhaul's tokens and seven type roles, without any page's markup changing. This is the first of two PRs for #1317: this one is the tokens and the restyle; the next adds the typed helpers, five templates, the enhancer and the `/~ui` gallery. Part of #1317 ## Look at - **One token block, named chunks.** `packages/core/src/styles/` holds `appStyles` as named chunks composed from one list in `index.ts`: `fonts`, `tokens`, `base`, `type`, then one chunk per family (`marks`, `buttons`, `fields`, `status`, `notices`, `containers`, `tables`, `navigation`, `menus`, `dialogs`, `steps`, `tiles`, `appShell`, `doors`, `whatsNew`, `switcher`). The switcher (#1304) draws on app pages from its own chunk in the app's tokens, and over a running patch from `servedStyles` as before; `command-list.test.ts` checks both carry its anatomy. A later lane adds a family as a new file and one line in the list. `tokens.ts` holds colour, the seven type roles in four weights, spacing, control heights (36/32, and 44 with 16px field text on a coarse pointer), radii 6/10/12 and the lift/float/modal shadows. Legacy token names (`--white`, `--line-strong`, `--paper-blue` …) map onto the new values for page CSS that still names them. - **Native anatomy kept** (plan review finding 12). Inputs, textareas and selects stay native at button height with 1px ink edges; `.field-prefix` stays a label fused into its group; menus stay top-layer popovers with their anchor positioning; the Final step's modal panel and its phone sheet keep their geometry. The prototype's drawn fields and absolutely positioned menus are not copied. - **Rules the spec sets**: ink focus ring everywhere (never blue); hover only under `(hover: hover)`; the hard shadow only on the primary button, the glyph, hero marks, menus, dialogs and doors; badges in sentence case (no `text-transform` anywhere, tested); flat paper in the app, the grid and gradient only behind doors. - **Deliberately unchanged here**: markup, classes and page CSS (each page lane rebuilds its page on the templates and deletes its CSS); the sidebar's 900px fold, because Home's own CSS relies on it (the sidebar lane moves both to the spec's 1024px together); titles in Geist 800, as Cabinet Grotesk waits on ticket X. - **Dropped:** legacy classes with no caller (`panel`, `grid`, `task`, `num`, `foot` and the old `flow` diagram). <!-- patchy-dev:compare:allison --> #### Before and after, as Allison Mahmood (admin) Before is `cd908ee` (where this branch left ui/f1-fonts) and after is `67e5911` (ui/f2-tokens), both on the `brightline` scenario, from `pnpm dev compare`. Every page answered 200 with no browser errors. ##### `/` **1280px, after**  <details><summary>1280px, before</summary>  </details> | Width | Before | After | | --- | --- | --- | | 390px |  |  | ##### `/patches/new-business/delete` **1280px, after**  <details><summary>1280px, before</summary>  </details> | Width | Before | After | | --- | --- | --- | | 390px |  |  | ##### `/company` **1280px, after**  <details><summary>1280px, before</summary>  </details> | Width | Before | After | | --- | --- | --- | | 390px |  |  | ##### `/company/connections/connect/postgres` **1280px, after**  <details><summary>1280px, before</summary>  </details> | Width | Before | After | | --- | --- | --- | | 390px |  |  | <!-- /patchy-dev:compare:allison --> <!-- patchy-dev:compare:priya --> #### Before and after, as Priya Shah (member) Before is `cd908ee` (where this branch left ui/f1-fonts) and after is `67e5911` (ui/f2-tokens), both on the `brightline` scenario, from `pnpm dev compare`. Every page answered 200 with no browser errors. ##### `/company/agent-access` **1280px, after**  <details><summary>1280px, before</summary>  </details> | Width | Before | After | | --- | --- | --- | | 390px |  |  | ##### `/company` **1280px, after**  <details><summary>1280px, before</summary>  </details> | Width | Before | After | | --- | --- | --- | | 390px |  |  | <!-- /patchy-dev:compare:priya --> ## How it was verified - `styles.test.ts`: `appStyles` is its chunks in order, every `var(--…)` it uses is defined in the token block, and nothing is set in capitals. The served-styles pin from #1332 still holds. - Typecheck, lint, and the core, serving, portal, auth, companies, integrations and server suites (1285 tests) pass locally. - Looked at every first-party surface on `pnpm dev up brightline` at 1280px and 390px (touch): Home, All patches, a patch's Overview, Log, Versions and Settings, Retire and Delete, the Share dialog, Your agents, People, Integrations and the catalogue, Postgres and Pidgeon connect, Agent access, What's new, Priya's Final step (desktop and the phone sheet), the switcher open over All patches, the persona picker, sign-in door, 404 and a stopping notice. One fix came out of it (a list link holding a line break stays a block). ## Release impact - [ ] **Breaking** — requires action from anyone already running this - [x] **Not breaking** — no action required Styles only; no schema, API, CLI or configuration change. - **What does a revert leave behind?** Nothing. - **Does the release before it still work with that?** Yes. Built by Claude Opus 5.5 (xhigh) in Claude Code, orchestrated by Fermy. Co-authored-by: Claude Opus 5.5 <[email protected]>
Stacked on #1336; part of #1315. Merge the stack together, not alone. ## What changed Pages share one stylesheet but no anatomy: headings, steps, notices, settings rows, confirmations and receipts are assembled by hand, differently on every page, so they drift. Now core has the component set and the five page templates every page lane will build on, a small enhancer that adds keyboard and dialog behaviour without making script necessary, and a development gallery at `/~ui` that shows the whole system. This is the second of two PRs for #1317; #1336 put every existing page on the tokens. Closes #1317 ## Look at - **Helpers** (`packages/core/src/ui/`), typed functions returning HTML, text escaped, trusted slots named as such: - `controls.ts`: `button`, `linkButton`, `iconButton` (primary, secondary, quiet, danger, danger-solid; md/sm; static `pending`). The field family: `field` draws label, hint, control, error in that order and hands its control the ids, so the hint and error describe it and a refusal sets `aria-invalid`; controls `input`, `textarea`, `select`, `prefixInput`, `secretInput`, `checkbox`, `radio`, `choiceGroup`, `switchForm` (core's `choiceCards`, `tileOptions` and `copyLine` stay as they are). - `feedback.ts`: `notice` (info/warning/danger, danger is an alert), `receipt` (text only, Undo dropped per the plan), `badge`, `dot`, `emptyState`. - `structure.ts`: `pageHeader`, `section`, `card`, `settingRow`, `facts`, `row`/`rows` (stretched-row links that leave buttons and menus operable), `table`, `tabs`, `segmented`, `chip`, `menu` (native popover of links and buttons, not an ARIA menu, on core's existing `rowMenu`), `dialog`, `steps`, and `idFor` for repeated rows' ids. - **Templates** (`ui/templates.ts`): `indexPage`, `detailPage`, `settingsPage`, `flowPage`, `doorPage`. No CSS parameter; each returns the `heading` and `body` `pageResponse` already takes, so a page writes `pageResponse({ title, app, ...indexPage({ … }) })`. Their frames are one new chunk, `styles/templates.ts`, registered with one line in the chunk list. - **Enhancer** `/assets/ui.js` (`ui/enhancer.ts`), served session-free beside `copy.js` and loaded by every `pageResponse` page, so a door with no session scripts now admits `script-src 'self'` (CSP can't name one same-origin file without the origin, and Clerk-mode doors already admit `'self'`). Focus starts on a dialog's `autofocus` control, else its first field. A dialog reached by a link on this site closes with history back to that page, whichever it was, past any refused submission it was drawn again for (its chain lives in history state), so neither closing nor Back revisits a POST; loaded any other way, it closes to its own page; one without a close (the Final step) closes only by its own actions. Escape is left to an open menu or the switcher first. Focus returns to the very link that opened it, or its menu's button; Show toggles a secret's mask; a fragment opens its `<details>`. Without script a dialog is the page (`@media (scripting: none)` leaves out the inert page behind it and the scrim), its Close is a link, and Show stays hidden. A locked Flow section is a disabled fieldset. A refusal at a content URL drops the enhancer with the fonts (`withoutAppAssets`, renamed from #1332's `withoutAppFonts`). - **Gallery** `/~ui`: the type roles and the token block's colours, every helper in its states, a state table per component (spec §10 item 21, checked by a test), and `/~ui/index`, `/detail`, `/settings`, `/flow`, `/door`, `/dialog` (its form always refuses, to show the refusal and the way out of it) and `/final` (a dialog only its actions close) built from the templates with sample data. Where it departs from the prototype's System page, it is because the gallery composes only the shared helpers, as every page must: colours are a table of the token block's own values instead of a bespoke swatch grid, fields stack as they do in a real form, spec rows are state tables, and the five template diagrams are live template pages one click away, which show more than a diagram. Adding gallery-only CSS to match the prototype's documentation layout would be the page CSS the system forbids. `portal/src/Gallery.ts` is mounted in `Server.ts` only where `DevPersonas.enabled`, beside the persona picker; production answers 404 (tested). - **Governance, report only:** `pnpm ui:report` (`scripts/ui-report.ts`) lists raw visual values in the app's chunks (type, colour, radius, shadow, control height; geometry exempt), page modules that pass `styles`, write `<style>` or inline `style`, and hand-drawn button, badge, notice and field markup outside core (hidden inputs exempt). Today: 102 values, 27 modules; it never fails. G turns these into checks. - **Standards:** `.agents/skills/ui-consistency/SKILL.md` rewritten for first-party pages against the system (tokens, templates, helpers, rules, dialogs, the enhancer, the gallery, the legacy classes and what the served shell shares); its served-patch sections are unchanged. `docs/DEVELOPMENT.md` mentions `/~ui` and the report. - **One look change:** the copy line's Copy button is secondary and compact, as spec principle 4 and the prototype draw it. The gallery and its template pages as Allison; before is the base, where `/~ui` doesn't exist yet. <!-- patchy-dev:compare:allison --> #### Before and after, as Allison Mahmood (admin) Before is `67e5911` (where this branch left ui/f2-tokens) and after is `0134803` (ui/f2-components), both on the `brightline` scenario, from `pnpm dev compare`. ##### `/~ui` **1280px, after**  <details><summary>1280px, before</summary>  </details> | Width | Before | After | | --- | --- | --- | | 390px |  |  | - Before at 1280px answered 404; 1 browser error(s): `Failed to load resource: the server responded with a status of 404 (Not Found)`. - Before at 390px answered 404; 1 browser error(s): `Failed to load resource: the server responded with a status of 404 (Not Found)`. ##### `/~ui/detail` **1280px, after**  <details><summary>1280px, before</summary>  </details> | Width | Before | After | | --- | --- | --- | | 390px |  |  | - Before at 1280px answered 404; 1 browser error(s): `Failed to load resource: the server responded with a status of 404 (Not Found)`. - Before at 390px answered 404; 1 browser error(s): `Failed to load resource: the server responded with a status of 404 (Not Found)`. ##### `/~ui/settings` **1280px, after**  <details><summary>1280px, before</summary>  </details> | Width | Before | After | | --- | --- | --- | | 390px |  |  | - Before at 1280px answered 404; 1 browser error(s): `Failed to load resource: the server responded with a status of 404 (Not Found)`. - Before at 390px answered 404; 1 browser error(s): `Failed to load resource: the server responded with a status of 404 (Not Found)`. ##### `/~ui/flow` **1280px, after**  <details><summary>1280px, before</summary>  </details> | Width | Before | After | | --- | --- | --- | | 390px |  |  | - Before at 1280px answered 404; 1 browser error(s): `Failed to load resource: the server responded with a status of 404 (Not Found)`. - Before at 390px answered 404; 1 browser error(s): `Failed to load resource: the server responded with a status of 404 (Not Found)`. ##### `/~ui/door` **1280px, after**  <details><summary>1280px, before</summary>  </details> | Width | Before | After | | --- | --- | --- | | 390px |  |  | - Before at 1280px answered 404; 1 browser error(s): `Failed to load resource: the server responded with a status of 404 (Not Found)`. - Before at 390px answered 404; 1 browser error(s): `Failed to load resource: the server responded with a status of 404 (Not Found)`. ##### `/~ui/dialog` **1280px, after**  <details><summary>1280px, before</summary>  </details> | Width | Before | After | | --- | --- | --- | | 390px |  |  | - Before at 1280px answered 404; 1 browser error(s): `Failed to load resource: the server responded with a status of 404 (Not Found)`. - Before at 390px answered 404; 1 browser error(s): `Failed to load resource: the server responded with a status of 404 (Not Found)`. <!-- /patchy-dev:compare:allison --> ## How it was verified - `ui/ui.test.ts`: field order and ids, escaping, a refused choice group marked invalid with its choices, the secret's hidden Show, button kinds and pending, the switch form, `idFor`, menus as popovers, tabs, tables, dialog close rules, steps, notice roles, template widths and the door's heading, and that the gallery uses only classes the stylesheet draws and no inline style. `auth/page.test.ts`: every page loads the enhancer and admits it. `server/Server.test.ts`: `/assets/ui.js` serves signed out with no cookie; every `/~ui` page 404s without personas and answers 200 with them. `scripts/ui-report.test.ts` pins the report's rules. - `test/browser-tier1/ui.spec.ts`, run locally 3 times over (15 passed): a refused submission draws the dialog again with its field invalid and focused, Escape returns to `/~ui/index?page=2` with focus on New patch, and Back goes on to the page before, never the POST; keyboard opens and closes a row menu with focus returning; a dialog starts on its field, goes back on Escape to the page that opened it (the gallery or the Index page), with focus on the second of two links to it; loaded directly, even with a malformed fragment, it closes to its own page; the Final-step-like dialog ignores Escape; Show unmasks; a locked section's radio is disabled; a fragment opens a disclosure; Copy appears; without script the dialog is static in the flow with the app hidden, its Close link works and Show stays hidden; on a 320px touch screen buttons, icon buttons and tabs are 44px, field text is 16px, and the two long labels from #1336's review (a person's name sentence and a 32-letter patch name) don't overflow. `fonts.spec.ts` still passes with the enhancer on doors. - `pnpm check`: format, lint, typecheck and synth pass; the only test failures are the known local ones (stray `GET /` on CLI stub servers, execution timeouts under load), none in what this touches. ## Release impact - [ ] **Breaking** — requires action from anyone already running this - [x] **Not breaking** — no action required Core helpers, a static script route and a development-only route; doors gain `script-src 'self'`. No schema, API, CLI or configuration change. - **What does a revert leave behind?** Nothing. - **Does the release before it still work with that?** Yes. Built by Claude Opus 5.5 (xhigh) in Claude Code, orchestrated by Fermy. Co-authored-by: Claude Opus 5.5 <[email protected]>
…d once (#1376) ## What changed This adds release 41's What's new entry, written from `a25a9c5`. It covers everything merged since release 40's `through` (`08e1fd9`), and sets the `patchy` release to `0.41.0` in `packages/patchy/package.json` and `CURRENT_RELEASE`. It ships the UI overhaul together with #1204, the terms prompt, as one release, at Allison's word. | Change | PRs | | --- | --- | | Improved: Patchy has a new look | #1332, #1336, #1338, #1343, #1353, #1354, #1369, #1372 | | New: Accept updated terms once | #1204 | | Improved: Settings holds People, Integrations and Agent access | #1334, #1341 | | Improved: Home starts with what needs you | #1344, #1353 | | New: A blue dot marks patches you haven't opened | #1370 | | Improved: A patch's page has one header and tabs | #1345 | | Improved: Search lands on All patches | #1346, #1353 | | Improved: Inviting and deactivating people is clearer | #1349 | | Improved: Your agents shows what's connected | #1352 | | Improved: Integrations use plain words | #1347, #1351 | | Improved: Agents and integrations show their own logos | #1371 | | Improved: What's new goes by month | #1350 | | Fixed: ⌘⇧K works on your company's public patches | #1339 | | Fixed: Saving works after a patch stops being public | #1339, #1375 | | Behind the scenes: every page built from one set of parts, with a check | #1338, #1354 | | Behind the scenes: agents know a once-public page's refusals mean reload, and retries wait and stop | #1374 | | Patch changes: a kept public page reloads into the company page; check retries wait and stop | #1375, #1374 | #1337 is release 40's own entry. #1340 (routes split, plus the call summary Home and All patches show) and #1342 (the `dense` dev scenario) need no line of their own: the call summary is part of the Home and All patches changes, and the scenario is tooling. The overhaul makes no patch changes. Running patches keep their own styles, which #1332 pins, and the only SDK change is the wording of two error messages' admin addresses. ## Look at - **The entry**, at the top of `releases` in `packages/core/src/whatsNew.ts`. - **Rollback safety, from the live commit `d3d32da` (release 40) to this PR's merge:** - **#1334 is `one-way`.** Your agents and Settings moved to `/agents` and `/settings/…`. Old addresses redirect forward, but release 40 serves none of the new ones. This release's CLI hints, the `patchy` skill on `main`, and the API, MCP and publish hints all name the new addresses, so on release 40 they'd answer 404. - **#1372 needs the private font bucket**, and that's done. Its deploy step fetches the pinned Cabinet Grotesk file and checks it before recording anything. The bucket was created on 2026-11-10 and holds the pinned bytes. A rollback to a commit from before #1372 pins no font and builds as before. - **#1204** adds migration `0036_terms_acceptances`, an additive table that release 40 never reads. Release 40 doesn't prompt, and coming forward again asks only people who hadn't accepted. Not `one-way`. - **#1375** changes only the public shell's script, and #1374 is skill text. Release 40 renders its own shell and serves its own skills. - **#1370 and #1339** add rows to the existing `patch_opens` table (a guest's opens, and members' opens of public patches). Release 40 reads them like any other open. - **Everything else** is pages, styles, copy and docs: no migrations, and no API, `--json` or configuration changes. - **patchy-web #53**, the website line #1371's logos needed, is merged (771e6d9). **Rollback line:** Rolling back past #1334 would break every `/agents` and `/settings/…` link that this release's CLI, skill and hints hand out, because release 40 answers them with 404. Fix forward instead. ## How it was verified - **Tests:** the `packages/core` What's new test passes (5), the `packages/api` suites pass (64), and the three files are formatted. - **The range.** Each of the 22 overhaul PRs was: - reviewed by GPT 6.1 Sol at xhigh, with every finding fixed or declined in writing on the PR; - accepted on its final head by an agent that didn't write it; - merged green, by a merge train that rebuilt each PR's accepted tree on main's tip and checked that main's tree matched it after every merge. - **#1339, #1375, #1374 and #1204** were each Sol-reviewed and accepted, and merged on their own: #1339 before the train, the other three after it. #1204's acceptance was rerun on the new sign-in pages. ## Release impact - [ ] **Breaking** — requires action from anyone already running this - [x] **Not breaking** — no action required The changelog entry and the release version only. - **What does a revert leave behind?** Nothing. CLIs installed from this release report `0.41.0` and are told to match the server, as at every release. - **Does the release before it still work with that?** Yes. Changes made by Claude Opus 5.5 in Claude Code, running in T3 Code. Co-authored-by: Claude Opus 5.5 <[email protected]>
#1227) ## What changed People had no way to tell Patchy what it lacks or got wrong without a terminal, and nowhere to see or take back what their agents sent. The only path was a `mailto:` on the integrations page. Now **Tell Patchy** sits in the sidebar's foot between What's new and the account, and opens a panel in What's new's frame: Request or Feedback, one field, Send. A request's receipt is followed by its similar requests, each with its status and public note, and **Same need** links one in a click. **What you sent** at `/feedback` lists everything the person and their agents sent, with Unlink and Withdraw… in each row's menu. Integrations' **Ask** and **Ask for an integration** open the same panel with Request picked. This is Direction A from the mocks (post.patchyhq.com/d/irl2myfbmdgk), ported onto the new component set. Part of #1210, closes #1215 **Ported onto the new component set.** While this waited, main replaced the first-party UI: the overhaul (#1332–#1354, #1371), the component set and five templates (#1338), the new sidebar (#1341), What's new's foot menu (#1350), and a check that fails a page that styles itself (#1354). The classes the first version used are gone. This version keeps the same concept, flows and behaviour, and draws everything from core's helpers with no page CSS. The look follows the system rather than the mock, and the departures it forces are listed under **Look at**. **How it works** - **The panel** lives in the shell (`packages/core/src/html.ts`), so every app page has it. It is a `menu app-foot-menu` popover, like What's new's, anchored to whichever button opened it. It sits outside the folding Menu, because a popover inside a hidden menu can't show, so any page's button with `popovertarget="tell-patchy"` opens it; its `data-kind` picks the kind. The form is `choiceGroup`, `field` and `textarea`, with no `maxlength`, plus a primary Send. Its styles are a few lines in core's `app-shell` chunk. - **Sending** goes through `/feedback/tell.js`. It posts the panel's forms with a `patchy-panel` header, and the server answers with markup drawn by helpers: - a sent request: a `receipt` naming its title, then `rows` of matches, each with a `badge`, its note, Same need and Unlink; - a refusal: the form drawn again with the field's `error`. The script only moves server-drawn markup and toggles `hidden`, so it draws no component. - **Without the script**, the composer has its own address, `/feedback/new?kind=request` (or `feedback`; anything else is a request), a `dialog` over What you sent with the panel's fields. A refused send from it draws it again with the field's error and an empty field. Integrations' Ask buttons are links to it: the panel's script opens the panel beside them instead, with the kind taken from the link. A sent request lands at its own address, `/feedback/<id>/sent`. It is a `dialog` over What you sent, drawn by the same renderer as the panel's answer, where Same need and Unlink post and come back to it. Done and Close go to What you sent. Only the request's sender sees it, and another person's id or a feedback id answers 404. Feedback lands on What you sent with a receipt, and a refusal on What you sent with a `refusal` above its table. - **Behaviour carried over unchanged:** - the routes and the `patchy-panel` contract; - the long-request split (`requestOf`: the first line, or the opening words cut with "…", becomes the title, and the whole text the why); - no automatic resend after an ambiguous failure; - one change in flight across the panel, with a counter that drops stale answers. Every close settles what was in flight: the panel opens again with the draft kept and the "couldn't confirm" note; - closing gives focus back to the button that opened it, or to Menu once that is folded away, after the switcher's chord and after a tap outside too; - `Feedback.get`, and surface `dashboard` with no agent. - **What you sent** is `indexPage` over the shared `table` (Sent, What, From, Status, a `menu` per row), paged by the store's cursor with Older. It lights no place. **Withdraw…** opens a `dialog` over it at `/feedback/:id/withdraw`, with Cancel first and focused and **Withdraw request** in `danger-solid`, as Your agents' Disconnect does. - **Small core additions:** - `button` takes `popovertarget` and `popovertargetaction`; - `field` takes `hideLabel` and `choiceGroup` takes `hideLegend`, keeping the mock's label-free composer while readers still get the names; - a speech-bubble `message` icon. Each comes with its gallery entry. Feedback joins the portal's services, and FeedbackPages is registered with the other portal surfaces. - **`dense`** now shows both: five general requests, one of each status and two with notes, plus Allison's own requests and feedback beside her agents' (Claude Code and Codex through the CLI, ChatGPT through Patchy MCP, and one unnamed agent), three of them linked. These are seeded through two new scenario fields, `generalRequests` and per-person `sent`. The ids are stable and in the store's shape, so a resumed `up` writes the same rows and the cursor pages them. - **Store changes**, each in its own commit with a test: - `Feedback.get({ person, id })`, which the withdraw dialog, the Unlink receipt and the sent address read; - `Feedback.similarTo({ person, id })`, which matches one of the person's own requests again with the query filing used, ranked now, for the sent address. ## Look at <!-- patchy-dev:film:tell-patchy --> #### Flow `tell-patchy`, as Allison Mahmood (admin) After is `857cc17` (feedback/portal), on the `dense` scenario, from `pnpm dev film`. - After: finished in 17.2s https://github.com/user-attachments/assets/9e6604b0-c0b1-4d1f-8c5e-c11fcb061fbe <!-- /patchy-dev:film:tell-patchy --> <!-- patchy-dev:compare:ada --> #### Before and after, as Allison Mahmood (admin) Before is `6a5a29c` (where this branch left main) and after is `857cc17` (feedback/portal), both on the `dense` scenario, from `pnpm dev compare`. ##### `/settings/integrations/connect` **1280px, after**  <details><summary>1280px, before</summary>  </details> | Width | Before | After | | --- | --- | --- | | 390px | No visible change |  | ##### `/feedback` **1280px, after**  <details><summary>1280px, before</summary>  </details> | Width | Before | After | | --- | --- | --- | | 390px |  |  | - Before at 1280px answered 404; 1 browser error(s): `Failed to load resource: the server responded with a status of 404 (Not Found)`. - Before at 390px answered 404; 1 browser error(s): `Failed to load resource: the server responded with a status of 404 (Not Found)`. <!-- /patchy-dev:compare:ada --> **With Patchy's general requests**, on a local `dense` instance as Allison. Fresh evidence instances run the same scenario. **1. Send a request from the foot, see similar requests, link one and unlink it**   <details><summary>Composing, and after Unlink</summary>   </details> **2. A key is refused on the field, and Ask for an integration opens the panel with Request picked**   **3. What you sent, a row's menu, Withdraw**     **4. When a send's answer is lost** (the server stored it and the browser never heard back): nothing is sent again, the draft stays, and the note points to What you sent.  **5. Without script: the sent request's own address, then linked from it**    <details><summary>Phone, without script</summary>   </details> **6. Phones: the panel opens above the foot inside Menu, the table scrolls sideways, Withdraw is a bottom sheet**  <details><summary>Phone: from Integrations, What you sent, a row's menu, Withdraw</summary>  </details> **Departures from Direction A that the new system forces** - **Receipts, not green boxes.** Success is quiet, so a sent request leaves a `receipt`, "Request sent: <title>", and a link leaves "Linked to <match>". The mock showed a bordered "Request sent" note. - **Statuses are `badge`s** with the mapping main's overhaul gave the old pills: Shipped green, Planned blue, Declined red, Open plain. - **A match stacks** its title, note, then badge and Same need, as a `row` in a 360px panel does. The mock put the badge beside the title. - **A refusal is the field's error**, one red sentence under the field that the field is marked against ("Your request has a Google API key in it. Nothing was saved. Take it out, or write <token> where it was, and send again."), rather than the mock's callout box. - **No bottom sheet on a phone.** Foot menus open above their button now, so Tell Patchy does too, as What's new does. Withdraw's dialog is the system's bottom sheet on a phone. - **Withdraw is a dialog over What you sent**, as confirmations on list pages are now, rather than a page of its own. Its URL is unchanged. - **Main's copy on Integrations.** The page now says **Ask** in the catalogue's "Something else" row and **Ask for an integration** in a member's header. Both open the panel; I kept those words rather than "Request an integration". - **An icon in the foot.** Every foot place wears one now, so Tell Patchy has a speech bubble. Its panel heading is the menu's head, as What's new's is. - **One notice a page.** The note for a send it can't confirm waits inert in a `<template>`, so no page carries a hidden second notice. The card's one-notice test now counts the page's own notices, inside `<main>`. - **The From column** is drawn the way All patches' Owner column is, a mark then the name over its surface. A grid cell there let the table squeeze it to nothing. Still standing from the first version: - Sent reads "just now" or "2 days ago", because the server doesn't know the reader's time zone. - The panel opens beside whichever button opened it. - Feedback's receipt doesn't repeat the note. - Done also closes the Menu it was opened from. - A long request is split into a title and its whole text as the why, never refused. ## How it was verified - **Tests.** `packages/portal/src/FeedbackPages.test.ts` is ported to the new markup without dropping what it asserts: - a send from the panel is stored as `dashboard` with no agent. The answer is a receipt, the shipped general request with its badge and note, and Done; - link, then unlink from the row menu without the script; - a pasted paragraph is filed as a title and a why. Exactly 4,000 characters ending in an emoji is accepted as a request and as feedback, and 4,001 is refused, as is too-short text; - a Google key is refused with 422 and nothing stored, and never echoed. In the panel, the answer is the form with the field's error and an empty field. Without the script, it is What you sent with a danger notice; - the list shows the person's own entries beside Claude Code · CLI, ChatGPT · Patchy MCP and Unknown agent · CLI, without notes; - another person's GET and POST withdraw, link and unlink all answer 404 on a live submission. The owner then withdraws it through the dialog, and the withdrawn id answers 404; - `requestOf`'s edges; - the composer at `/feedback/new`: Request picked for `?kind=request`, a bogus kind or none, and Feedback for `?kind=feedback`, under its own ids beside the panel's form. A request sent from it lands at its own address. A refused send from it is drawn again with the field's error, the kind as sent and an empty field, and never echoes the key; - without script, a send redirects to `/feedback/<id>/sent`. The dialog there shows the receipt, the shipped match and Same need, over the table. Same need and Unlink (with `from=sent`) each post and come back to it, linked and then unlinked. Another person, and a feedback id, get 404. `Feedback.test.ts` covers `similarTo`: three matches ranked now, never itself or another company's, and missing for another person, for feedback and for an unstorable id. `test/browser-tier1/tell-patchy.spec.ts`, in the browser suite, runs the panel's script: - a send held until the panel closed and opened again leaves the new draft alone, with the note; - Escape gives focus back to Tell Patchy, and so do the switcher's chord and Escape; - on a phone, a tap above the panel gives focus back to Tell Patchy, and Done closes Menu and gives focus to it; - after Feedback was picked, Ask for an integration opens the panel in place with Request picked and the field focused. Without script, it opens `/feedback/new?kind=request` with Request picked. The shell's tests (`html.test.ts`) cover the foot order, the panel outside the menu, the label-free field without `maxlength`, the inert note, the script on every app page and What you sent lighting no place. `ConnectionsView.test.ts` covers both Ask buttons. Dense's history test covers the seeded submissions, their id shape, and that a resumed `up` writes the same rows. - **`pnpm check`** at this tree: - format, lint (including `patchy/no-page-styles` and `patchy/no-hand-drawn-components`), typecheck and synth pass; - tests: 3,475 of 3,476. The one failure was a 5-second timeout in `PgliteCompanyDatabases.test.ts`, which this change doesn't touch; it passes run alone. - Focused suites pass: portal, core (including the stylesheet rules and the gallery inventory), feedback and the integrations view, 552 tests, plus the dev history and scenario tests, 12. - **In a browser.** Playwright Chromium drove the walkthrough on a local `dense` instance at 1280 and 390 wide: - focus starts in the field, and moves to Unlink after Same need; - the panel reopens fresh after Done, the draft and the invalid mark survive a refusal, and Ask picks Request; - Withdraw's Cancel takes focus; - the only console error was the expected 422 from the refused key. The review's three cases still hold on the ported markup. A send whose answer was cut after the server stored it is stored once and keeps its draft. A second Same need pressed while the first is held for 1.5 s sends nothing, and the panel's "Linked to" matches the database. Closing the panel during a held Unlink and reopening it shows a fresh form. - **Not checked.** - Firefox and Safari. Anchoring relies on the browser's implicit popover anchor, as the row menus' does. - Clerk sign-in mode. - A real Patchy MCP client: the MCP row is covered by a test, and `tell_patchy` is #1214. - `pnpm verify`'s browser and packed suites weren't re-run for this port. ## Review GPT 6.1 Sol reviewed the first version. Its findings were fixed then, and each fix is carried through the port with its test: 1. **P2: an automatic retry duplicated a submission.** The script never resends on its own; it keeps the draft and shows the note that links What you sent. 2. **P2: overlapping links could show the wrong saved state.** One flag covers the whole panel, and a counter drops answers for a panel reset since they were sent. There is no committed test for the ordering, since the script is a string served to the browser and the repo has no DOM test library. It was checked in Chromium, as above. 3. **P3: the ownership test checked an already-deleted id.** Another person tries a live submission first, and the deleted id is checked separately. 4. **P2: the textarea silently cut valid input.** There is still no `maxlength`; the server's 4,000-character refusal is the one bound. Sol reviewed the port at 857cc17. The four findings above still held, and it raised three more, fixed in ea0eb68 with the store method in c33ceb1: 5. **P2: a late Send reply could discard a new draft.** A close while composing didn't bump the counter, so a held reply landed after a new draft: its receipt covered the draft, and Done cleared it. Now every close settles what was in flight. If a send was on its way, the panel opens again with the draft kept and the note pointing to What you sent. 6. **P2: Same need was gone without script.** A send without script now redirects to the request's own address, `/feedback/<id>/sent`: a dialog over What you sent with the receipt, the matches and native Same need and Unlink forms. Both post and come back to it, so it reads "Linked to …". Only its sender sees it. The matches come from `Feedback.similarTo`, the matching query run again. 7. **P3: dismissal lost focus.** The panel records the button that opened it and gives focus back on close, or to Menu when that button is folded away. Two cases needed more than a check at close: - the switcher's chord closes the panel, and its Escape returns focus to the now-hidden field, so the panel waits for `patchy:switcher-closed`; - a tap moves focus for itself after the panel closed, so the panel checks again on that tap's click. The panel's script now runs in a committed test, `test/browser-tier1/tell-patchy.spec.ts` in the browser suite, which covers finding 5's ordering and finding 7's focus on a desktop and on a phone. Finding 2, two links racing, is still checked by hand in Chromium only. Acceptance on bda5bd3 (GPT 6.1 Sol) passed everything but one gap, fixed in 124ed0c: 8. **Ask for an integration kept Feedback without script.** Only the panel's script applied the Ask buttons' `data-kind`, so with JavaScript off, choosing Feedback in the panel and then pressing Ask sent an integration request as feedback. The composer now has its own address, `/feedback/new?kind=request`: a dialog over What you sent with the panel's fields, Request picked. Both Ask buttons are links to it, through `linkButton` and core's `tellPatchyHref`. With script, the panel opens in place beside the link with Request picked, and a modified click still opens the address. A route test covers the kinds and the fallback, and the browser spec covers Ask after Feedback, with and without script. ## Release impact - [ ] **Breaking** — requires action from anyone already running this - [x] **Not breaking** — no action required Additive: new pages and routes, a panel in the sidebar, an option on `button`, `field` and `choiceGroup`, an icon, one read method on the store and two dev scenario fields. No schema change. - **What does a revert leave behind?** Rows sent from the dashboard stay in `feedback.submissions` with surface `dashboard`, which the store already accepts. Nothing else. - **Does the release before it still work with that?** Yes. Built by Claude Opus 5.5 (xhigh) in Claude Code, orchestrated from T3 Code. --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
Stacked on #1227, the dashboard's `/feedback` page, so Patchy MCP never ships ahead of the page every answer links. ## What changed People's own agents reach Patchy only through Patchy MCP, and never load the `patchy` skill. The door could send a patch's missing tool to its owner, but a missing Patchy capability, or a Patchy fault, had nowhere to go. The door gains a fifth fixed tool, `tell_patchy { kind: "request" | "feedback", text, why? }`. It sends Patchy's team a request or feedback as the connection's person, through #1211's `Feedback` service, with surface `mcp` and the client name the person approved as the agent. Every answer links the person's page at `<instance>/feedback`, where they see or withdraw what their agent sent. The door's instructions name the tool, and the consent page says an agent can do this. Closes #1214 Part of #1210 **How it works** - **One tool, not two.** A request is something Patchy can't do; feedback is something it does wrongly or confusingly. The description says "feature request" and "feedback" in those words, because clients that load tools on demand search by text. It says a patch's own missing tool still goes to the patch's owner. It lists what to leave out: keys and tokens, connection strings, rows, file contents, other people's personal details and pasted logs. - **Results.** A request answers `{ id, similar, next, url }`, with up to three `{ id, title, status, note? }`. Feedback answers `{ id, next, url }`. `next` names no CLI command and no linking. When a match has shipped, it says to tell the person using its note. It always says they can see or withdraw what was sent at `url`. `url` is the public origin the door already reads (`PATCHY_PUBLIC_BASE_URL`) plus `/feedback`. - **`why` on feedback is refused, not ignored.** The store keeps exactly what was sent, so dropping a reason the agent wrote would quietly lose it. A blank `why` counts as none, as the service treats it. - **Admission.** It passes the same door gates as the other four: the `work` bearer, the person's requests a minute, and the `agent_access_off` refusal while access is off. It reads no patch, passes no patch's admission and mints no token. The service spends its own `feedback.sends.perMinute`. - **Refusals** are tool results with the store's codes, each saying what to rewrite: `invalid_text` with `details: { field }`, `contains_secret` with `details: { secrets: [{ field, kind }] }` (never the value), and `rate_limited` with `retryAfterSeconds`. A `text` too long for a request's title says a request's text is one line and the rest goes in `why`. - **Annotations:** not read-only, not idempotent and not destructive, since sending only adds a submission. With `destructiveHint` left out, the MCP default would mark it destructive. - **Instructions** now end "Send what Patchy itself lacks or gets wrong to tell_patchy." The earlier sentences were trimmed so that, with the person and company each cut at 64 characters, the worst case is 505 characters. A test holds that bound below 512. ## Look at **A worker agent on a local instance** (`pnpm dev up brightline`, Jordan via a Claude Code connection from `pnpm dev mcp-token`, a shipped general request written with psql as OPERATIONS.md shows): ``` $ modern server/discover → instructions You act for Jordan Lee at Brightline Studio through Patchy, where company tools are patches. find_patches lists those they can open, open_patch shows one's tools, read_patch runs a read and change_patch a change. You reach only tools builders added for agents; if one is missing, name the patch's owner. Every change is logged as them, via you. Send what Patchy itself lacks or gets wrong to tell_patchy. $ tools/call tell_patchy {"kind":"request","text":"Attio integration for our deal tracker","why":"Sales keeps every deal in Attio"} { "id": "req_sia8s0buut22bzb0hryx1qij", "similar": [ { "id": "gen_e82078e3d2c0479a8b9a1d38", "title": "Attio CRM integration", "status": "shipped", "note": "Connect Attio on Integrations; a patch reads its records through uses." } ], "next": "Patchy's team has this request, sent as the person you act for. A similar request has shipped: tell the person, using its note. They can see or withdraw it at http://<instance>/feedback.", "url": "http://<instance>/feedback" } $ tools/call tell_patchy {"kind":"feedback","text":"open_patch said New Business changed, but nobody had published since my last call."} { "id": "fbk_ajxhjme90jvae7aaqj5fvtxb", "next": "Patchy's team has this feedback, sent as the person you act for. They can see or withdraw it at http://<instance>/feedback.", "url": "http://<instance>/feedback" } $ legacy (2025-06-18) tools/call tell_patchy, with a GitHub token in the text {"content":[{"type":"text","text":"Nothing was stored: `text` holds a GitHub token. Remove it, or replace it with <token>, and send it again."}], "structuredContent":{"error":{"code":"contains_secret","from":"patchy","message":"Nothing was stored: `text` holds a GitHub token. Remove it, or replace it with <token>, and send it again.","details":{"secrets":[{"field":"text","kind":"github_token"}]}}},"isError":true} ``` Both submissions were stored as Jordan, via the connection's client. The door's request events carry the submission's id and the two limits it spent. A grep of the dev log for the why, the feedback text and the token finds none of them. ``` id | kind | person | surface | agent | why ------------------------------+----------+------------+---------+-------------+--------------------------------- req_sia8s0buut22bzb0hryx1qij | request | Jordan Lee | mcp | Claude Code | Sales keeps every deal in Attio fbk_ajxhjme90jvae7aaqj5fvtxb | feedback | Jordan Lee | mcp | Claude Code | {"route":"/mcp","status":200,"outcome":"success","mcpTool":"tell_patchy","submissionId":"req_sia8s0buut22bzb0hryx1qij","protocolEra":"modern","clientName":"Claude Code","limits":["mcp.requests.perMinute peak 3","feedback.sends.perMinute peak 1"]} {"route":"/mcp","status":200,"outcome":"refused","code":"contains_secret","mcpTool":"tell_patchy","protocolEra":"legacy","clientName":"Claude Code"} ``` <details><summary>The tool as <code>tools/list</code> shows it</summary> ```json { "name": "tell_patchy", "title": "Tell Patchy", "description": "Send Patchy's team a feature request or feedback about Patchy itself, as the person you act for: a request when Patchy can't do something, such as an integration or capability they need; feedback when it does, but wrongly or confusingly, such as a refusal that made no sense. A patch's own missing tool goes to the patch's owner, not here. Send each once. Leave out keys and tokens, connection strings, rows, file contents, other people's personal details and pasted logs; a credential is refused. A request answers similar ones with their status, and a shipped one's note says how to use it.", "inputSchema": { "type": "object", "properties": { "kind": { "type": "string", "enum": ["request", "feedback"], "description": "request: Patchy can't do it. feedback: it does, but wrongly or confusingly." }, "text": { "type": "string", "minLength": 1, "maxLength": 4000, "description": "For a request, its title: one line saying what Patchy should do, 3–200 characters. For feedback, what happened and what you expected, up to 4,000." }, "why": { "type": "string", "maxLength": 4000, "description": "A request's reason: what the person is trying to do and why it matters. Requests only: feedback with a why is refused, so put everything in its text." } }, "required": ["kind", "text"], "additionalProperties": false }, "annotations": { "readOnlyHint": false, "destructiveHint": false, "idempotentHint": false } } ``` </details> **The consent page** gains one line in what the agent can do: "It can send requests and feedback to Patchy’s team". The screenshots this PR carried showed the consent page before the UI overhaul (#1332–#1354); the line now sits in the overhauled page's `canList`, and here it is at this head, from the acceptance run:  ## How it was verified - **Tests** (`packages/mcp`, 77 pass; `packages/auth`'s consent test): ``` ✓ Tell.test.ts > tell_patchy > sends a request as the person via the connection's client, answering its matches and their page ✓ Tell.test.ts > tell_patchy > sends feedback as the person, answering its id and their page, where both show ✓ Tell.test.ts > tell_patchy > refuses with the service's codes, saying what to rewrite, and stores nothing ✓ Tell.test.ts > tell_patchy > is listed and called on every revision the door serves ✓ Door.test.ts > the door > lists the same five tools for everyone, read_patch read-only and change_patch destructive ✓ Door.test.ts > the door > keeps the instructions under 512 characters with the longest name and company ✓ Door.test.ts > the door > refuses every tool call while agent access is off, naming the admins and nothing else ✓ OAuthEndpoints.test.ts > asks who meets whom, what the agent can and can't do, and where the answer goes ``` The revisions test lists and calls `tell_patchy` on 2026-07-28's per-request envelope, then on 2025-11-25 and 2025-06-18. The access-off test now includes `tell_patchy` and checks that nothing was stored. "Both show" reads the person's own list through `Feedback.list`, the list the dashboard's page shows. - **`pnpm verify`** (Node 24, as CI runs it): format, lint, typecheck, synth, postgres-concurrency, cli-smoke, install, tier2-smoke and browser passed. `test` and `test (bun)` failed only in files this PR doesn't touch, under load from other worktrees. The CLI's stub-server files failed on a stray local `GET /` in their request logs; `cliLook.test.ts` passes alone. The PGlite files (`Tables`, `PgliteCompanyDatabases`, the Postgres dev fixture), `LocalTaskProvider` and `RequestEvents` timed out or counted a stray request, and pass alone, `RequestEvents` 12/12 in the bun lane's config as well. After rebasing onto #1227 (one conflict, the status sentence in `docs/product.md` › Requests and feedback, which now names the store, the dashboard and this door as built), `packages/mcp` passed again (77). - **Rebased 2026-11-11** onto #1227 after the store and the CLI merged and main took the UI overhaul. Two conflicts: the consent line moved into the new consent page's list, and `docs/product.md`'s status line now names every door as built. One new commit reads `tell_patchy`'s bounds from `@patchy/api`, where #1218 moved them. After it: `packages/mcp` 77, the consent test 21 and `packages/api` 64 pass, with lint and typecheck. - **Not checked:** a real worker agent choosing the tool on its own. The local Codex worker couldn't run because this machine's Codex login had expired, and the Claude worker signs in through a person's browser. The `/feedback` link is the dashboard's page from #1227, which this stacks on. **Hit every surface.** These applied: - **The wire contract**: the door's tool list, results and refusals, with `docs/API.md` › Agent tools re-rendered from `packages/api/src/markdown.ts`. The MCP protocol dates are unchanged. - **Vocabulary and product shape**: `packages/mcp/GLOSSARY.md` (five fixed tools, sends through Feedback), the Patchy MCP lines in `GLOSSARY-MAP.md` (its context and its relationship, which gains Feedback), `docs/product.md` › Patchy MCP (what an agent reaches, confirmation, what a client learns first, the tools, bounds, consent) and › Requests and feedback, and ADR-0014, which named four tools. Also the count in the README, Analytics' glossary and the wide event's comment, and Publishing's glossary. - **Served pages**: the consent page's one new row in an existing list. - **Reverse states**: whatever an agent sends, the person withdraws on the dashboard's page, which is why this ships after it. These did not apply: the CLI and its skills, since worker agents load none; migrations, since the store's schema already allows surface `mcp`; the dev loop; company resources. ## Release impact - [ ] **Breaking** — requires action from anyone already running this - [x] **Not breaking** — no action required Additive: a new tool in a list clients cache for up to 24 hours. A client that cached the old list sees `tell_patchy` the next time it lists. Nothing existing changes shape, and the protocol dates stay the same. - **What does a revert leave behind?** Submissions with surface `mcp` in the `feedback` schema, which the store from #1211 already accepts and lists. - **Does the release before it still work with that?** Yes. Clients that cached a list with `tell_patchy` get `-32602 unknown_tool` from it until they list again, as for any tool name the door doesn't have. Built by Claude Opus 5.5 (xhigh) in Claude Code, orchestrated from T3 Code. --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
…h's sheet or the account menu (#1301) ## What changed Speech input can type a letter that fires a patch's single-key shortcut. #1224 lets each person turn those off. #1276 stores the choice and #1279 taught `patchy/hotkeys` to obey it, but nothing passed the choice to a patch yet. Now Patchy's shell does: - it names a viewer's patch frame with their setting; - the shortcuts sheet's row opens Patchy's own dialog to change it; - the account menu gets the same switch; - a version built before the setting tells a viewer who turned shortcuts off that its shortcuts still work. This is the top of the stack `main ← #1297 ← #1255 ← #1256 ← #1279 ← #1276 ← this`, and the six land together. #1302, CI's move to desktop Chromium, waits on #1402 and lands later. It's restacked onto `main` after the UI overhaul (#1332–#1354) and the switcher (#1298, #1304), and ported to both. The restack comment says what changed beyond conflict resolution. Closes #1275 Closes #1224 ## Look at **1. The frame is named in the shell's static markup, not by a script that creates it.** A parser-created iframe gets its `name` attribute before its browsing context exists. So the server renders `name="patchy:shortcuts=on|off"` on the existing static iframe, after `main`'s `data-waiting`, and only for a company or local shell rendered for its viewer (`shell.ts`, `Pages.ts`). A public shell is everyone's document, a member's included since #1339, so it never carries one, and `renderPatchWrapper` throws if asked to. Probed before choosing, in Chromium and Firefox: | Probe, a sandboxed frame whose `src` a deferred script sets | Chromium | Firefox | | --- | --- | --- | | Static markup with `name`: first load, a reload after the value changed, back after it changed | `off`, `on`, `on` | `off`, `on`, `on` | | A `<template>` cloned by script, as the ticket's creator would | same | same | In desktop Chromium, where the frame runs in its own process, the patch reads `window.name === "patchy:shortcuts=off"` on first load and after a new version's Reload re-creates the frame. Static markup keeps three things: - **No inline script and no CSP change.** The shell still admits only the switcher relay's hash. - **Both mixed-release pairings work.** The markup is `main`'s plus one attribute (and `data-shortcuts-note`), so an older broker mounts it unchanged, and this broker mounts an older unnamed shell as before. `render.test.ts` pins that the frame differs from the unnamed one only by its name. - **Every re-creation renders again.** A new-version reload is a fresh server render. **2. Patchy's dialog** (`packages/serving/src/shortcuts.ts`), from the mock's direction C. A running patch's shell keeps its own pinned style subset on `main` (`servedStyles`; the overhaul left patch shells alone). So the dialog stays a `shell-scrim` over one `note-info` `note-float`, with `glyph-sm`, the primary button and a quiet Cancel. The setting's On or Off is a served `tag` after the question. The old `pill` isn't in that subset, and `main`'s pin test would refuse it, so it's gone. | | Desktop | Phone | | --- | --- | --- | | The sheet's row |  |  | | Patchy's dialog |  |  | | A failed save |  |  | The sheet is the SDK's, drawn in the patch's own frame by #1279, and `main` hasn't touched it. The copy and the failure pattern are as reviewed: - The title says what the switch covers: "Turn off single-key shortcuts in every patch except public ones?", or "Turn on …". The buttons are **Turn off**, **Turn on** and **Cancel**. - A refused save, a 200 without `{ value }` and an empty 200 all turn the note `note-warn`, with the alert line "Couldn't save. Nothing changed." and **Try again**. The abuse rules, each a step of the browser spec: - One dialog at a time. - A question needs `navigator.userActivation.isActive` in the shell. - However the dialog closes, it arms a flag: Turn off or Turn on, Cancel, Escape, or the browser closing it, mid-save or not. The flag holds new dialogs off until a 250 ms poll reads the old activation as lapsed. So a request on the press that answered the last dialog gets the value with no dialog, and only a fresh press opens another. - Only an `isTrusted` click saves. - Dismissing never waits. Cancel or Escape mid-save closes the dialog at once and returns focus to the frame. The save keeps the one-dialog slot until the route answers, and the operation then resolves with what the route stored, or with the setting as it was if the save failed or timed out after 35 s. - While tier 2's tools are starting, a question gets the setting as it is. - **New with the switcher:** while Patchy's switcher is open, a question also gets the setting as it is, as the starting cover waits for it. If the switcher is open over the dialog when it closes, the dialog leaves focus with the switcher, which hands it back. **3. The account menu's switch**, a no-script form in `main`'s personal menu: name, Your agents, the switch, Sign out. It posts the value it switches to, with `return` set to the page. On the overhaul's component set, the item is the switch: a `menu-item` with `role="switch"` and `aria-checked`, the `keyboard` icon, and core's `switch` drawn at its end in the item's state. Core's `fields` and `menus` chunks gained the two selectors that draw it. The account menu is 248px wide, up from 220, so the label stays on one line beside the switch. | Before | Off | After the press: the receipt, and On | | --- | --- | --- | |  |  |  | |  |  |  | "Before" is this branch's page with the switch's form removed in the browser, which is exactly `main`'s account menu. `ViewerApi.ts` reads the form before the session, so a signed-out post that names `return` goes back to that page, whose own door signs in there. **4. D1's note.** The note shows to a viewer whose setting is Off, on a version from 0.33.0 on that doesn't claim `shortcutSetting`, unless its recorded imports leave out `patchy/hotkeys`. - **Only a repo build claims `shortcutSetting: 1`** (`MANIFEST_CAPABILITIES` in `@patchy/api`). A single HTML file may carry an older SDK bundled inline, so it claims nothing. - **Recorded imports refine D1's release rule.** A repo build without `patchy/hotkeys` in `sdkImports` gets no note. A single file records no imports, so the release rule decides: from 0.33.0 on, the note shows. - The note reuses the new-version bar in the shared bottom stack: "This patch's single-key shortcuts still work until it's updated." with a quiet **Dismiss**, kept per patch in the shell's `localStorage`. | Desktop | Phone | | --- | --- | |  |  | **5. The flow**, desktop then phone. The sheet's row leads to Patchy's dialog, Turn off brings the sheet back on its row reading Off, then the account menu turns them back on. https://github.com/user-attachments/assets/d604fe56-04cd-416c-83fa-42e4beebc2f0 https://github.com/user-attachments/assets/17f547e2-472b-4c2d-90ac-98884108c875 ## How it was verified - **Unit (vitest)**, with the rest of the stack's touched files: 35 files, 330 tests, plus core's style rules, gallery and served-style pin (358 with `render.test.ts`): - `render.test.ts`: the frame's name after `data-waiting` in static markup, and that it is the only difference from an unnamed frame. A public shell refuses a viewer's setting. `ignoresShortcutSetting`'s cases. - `html.test.ts`: the account menu's switch, its value, its `return`, and escaping. - `ViewerApi.test.ts`: a signed-out form post goes back to its page. - `devServer.test.ts`: each dev person's own setting, and the route, which writes the file before it changes what shells read. - `executeConfig.test.ts`: a repo build's manifest records `shortcutSetting`. - `served-styles.test.ts`: the served styles' digest moved on purpose, for the one rule that keeps the dialog's tag whole. - **The browser tier** (`test/browser-tier1/shortcut-setting.spec.ts`): thirteen tests on published patches through the real shell and broker, as reviewed. That includes the committed 0.38 bundle (`hotkeys-0.38.html`), whose shortcuts still fire under this shell with Off stored, with no row and with the note. | Engine | Result | | --- | --- | | Desktop Chromium, `channel: "chromium"`, frame isolated, from a local config | 13 passed | | Chromium headless shell, as CI runs it | 13 passed | `hotkeys.spec.ts` and `focus.spec.ts` pass in both as well. Company patches put the setting's row first in the sheet's Tab order. The unnamed-frame test opens a public patch. - **The whole tier 1 suite** at this stack's top (`06476fe`), as `pnpm verify` runs it in CI's headless shell: 168 of 168. At the previous push, with #1302's desktop project as well, it also passed 168 of 168. - **The rollback rehearsal**, against the live release 41 (`7f93b91`): `7f93b91 → 06476fe → 7f93b91 → 06476fe`, all four steps passed in 116 s. It covers #1276's migration, and the live release serving a repo build that this head's CLI wrote with `shortcutSetting`. - `pnpm verify` at this head: format, lint, typecheck, synth, postgres-concurrency, cli-smoke, install, tier2-smoke and browser pass. `test` and `test (bun)` had 15 timeouts while the machine's load average was near 30. All 11 files rerun alone pass (216 tests), as does Bun's `PatchesApi` (63). The previous push's `pnpm verify` passed every step. The served shell's page state is exempt from the page-markup rules in `.oxlintrc.json`, and `shortcuts.ts` joins `stream-status.ts` and `downloads.ts` there for the same reason. - **Hit every surface.** - Wire contract: `docs/API.md` is regenerated and current. - CLI: README, the `patchy-hotkeys` project skill and the capability catalogue. No command, flag or exit code changed. - Dev loop: `docs/DEVELOPMENT.md` and the `patchy-dev-loop` skill. - Vocabulary: the Companies and patchy glossaries, and `docs/product.md`. - Served pages: the `ui-consistency` spec names the menu's switch, the dialog and note in the shell's exception, and `shortcuts.ts` in the lint exemption. - Reverse states: the switch turns it back on from both places. - Not applicable: migrations (#1276's), company resources and the repo layout. - **Not run on this head:** Firefox and WebKit. Firefox passed 12 of 13 before the port, the tier 2 test being Chromium-only. WebKit can't launch here, and CI has no WebKit. ## Release impact - [ ] **Breaking** — requires action from anyone already running this - [x] **Not breaking** — no action required The release that carries this carries the whole stack. Nothing needs action. A viewer's shortcuts stay on until they turn them off, and patches published before it behave as they did until rebuilt. Suggested `patchChanges` line for the release, beside #1279's: > patchy/hotkeys: a viewer can now turn single-key shortcuts off. Then a page-wide hotkey whose every step types a character, such as `A`, `G H` or `?`, fires nothing, while chords, named keys and hotkeys `within` an element still fire. Label those commands so the sheet keeps them as buttons, and write a key that belongs to one part of the page `within` it. `window.name` carries the setting and is Patchy's: don't set it. Landing note: #1276's migration is `0038_single_key_shortcuts`, above #1217's `0037_feedback`. If another migration lands first, it renumbers. - **What does a revert leave behind?** - `shortcutSetting: 1` in the manifests of repo builds published meanwhile. The release before reads stored manifests without refusing extra keys, and in the rehearsal it served a version that carried the field. - People's stored settings, from #1276. - Dismissed-note keys in browsers' `localStorage`. - A CLI of this release refuses to publish to an older instance before sending anything, as any mismatched release does. - **Does the release before it still work with that?** Yes. Its shell names no frame, so every shortcut is on, the sheet hides its row, and no note shows. 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]>
Bottom of the UI overhaul stack; part of #1315. Merge the stack together, not alone.
What changed
First-party pages drew in each computer's system font, so Patchy looked different on every OS and unlike patchyhq.com. And a running patch's shell imported the same stylesheet as the app, so any restyle of the app would have leaked into every patch. Now the app runs on Geist and Geist Mono, and a running patch's shell keeps exactly the styles it has today.
Closes #1316
Look at
shellStylesis nowservedStylesinpackages/core/src/served-styles.ts, byte for byte; onlyserving/src/shell.tsimports it, andserved-styles.test.tspins its sha256 (94a5f1db…, main'sshellStylesat this branch's base, switcher classes included). First-party pages useappStylesinhtml.ts. A browser test checks a running patch's shell fetches none of the app's fonts.packages/core/fonts/holdsGeist-Variable.woff2andGeistMono-Variable.woff2from thegeistnpm package 1.9.2 (Vercel's release, tarball integrity checked against the registry), unmodified, with its licence asOFL.txt. Core'sfileslistsfonts, so the server image stages them, ascompaniesdoes with its look. A test checks each file's sha256 againstfonts.ts.portal/src/Fonts.tsreads them once on the way up and serves them outside the viewer gate at/assets/fonts/<file>-<sha256 prefix>.woff2:font/woff2,public, max-age=31536000, immutable, GET and HEAD, noSet-Cookie. Every page preloads the text face; until it arrives text falls back to Arial (or Liberation Sans) at Geist's metrics.pageResponse(portal, integrations, auth doors) gainsfont-src 'self'. Stopping and needs-rebuild notices getfont-src 'self'in serving'snoticePolicy, both the anonymousNOTICE_SECURITY_POLICY(renamed fromPATCH_CONTENT_SECURITY_POLICY, which only notices used) and the signed-in viewer'snoticeContentSecurityPolicy; the global 404 now carriesNOTICE_SECURITY_POLICY(it had none of its own and got the shell's). A content URL's 404 still gets the frame's sandbox policy. Running-shell and patch-content policies are unchanged. A refusal at a content URL (404, sign-in door, needs-rebuild) is drawn under the frame's sandbox, which admits no font of ours, soservingHeaders, which already gives it that policy, also drops the app's font preload and faces from its document (withoutAppFontsincore/fonts.ts).Before and after, as Allison Mahmood (admin)
Before is
092a450(where this branch left main) and after is9a51d56(ui/f1-fonts), both on thebrightlinescenario, frompnpm dev compare.Every page answered 200 with no browser errors.
/1280px, after
1280px, before
/patches1280px, after
1280px, before
/company/connections1280px, after
1280px, before
How it was verified
pnpm check: format, lint, typecheck and synth pass. 12 offline tests failed locally, all outside this change: the known strayGET /on CLI stub servers (cliLifecycle,cliLook,cliPublish,cliRepo,cli) and one Supervisor timeout under load. CI runs them clean.core/fonts.test.ts(digests, woff2 signature, licence, package files),core/served-styles.test.ts(the byte pin, no fonts in the served styles),serving/render.test.ts(the wrapper carriesservedStylesand noappStyles, preload or@font-face),serving/Pages.test.ts(404s and stopping notices carry the notice policy; a content URL's 404 and sign-in door keep the sandbox and carry no font),server/Server.test.ts(a signed-out page preloads and may load the font; GET and HEAD answer as above with no cookie; another digest 404s),auth/AuthPages.test.ts(font-src 'self').test/browser-tier1/fonts.spec.ts, run locally on its own: Home signed in, the 404 and a stopping notice signed out all draw in a loaded Geist with no CSP violation; a running patch's shell requests nothing under/assets/fonts/; a 404 at a content URL keeps the sandbox policy and requests no font (red before the fix, green after).node scripts/build-server-image.mjs --stageputs the fonts andOFL.txtundernode_modules/@patchy/core/fonts, andscripts/server-image-smoke.mjsnow loads the 404 signed out from the built image, follows its preload link, and checks GET and HEAD (status, type, cache, no cookie, woff2 bytes). CI's Server image job runs it.Release impact
Styles, two committed font files and response headers; no schema, API, CLI or configuration change.
Built by Claude Opus 5.5 (xhigh) in Claude Code, orchestrated by Fermy.