Repository navigation
test(browser): dialog specs press Escape only once the page's script listens - #1414
Conversation
|
Review (GPT 6.1 Sol), at 2bb2431: nothing blocking.
A Chromium probe with |
Acceptance: PASS with notesChecked Done means (#1377: every spec that presses Escape on a freshly loaded dialog page waits for its script)
Commands and outputThe hold lives in a scratch Playwright config outside the checkout, never committed. It wraps every core._instrumentation.addListener({
runAfterCreateBrowserContext: async (context) => {
const route = context.route.bind(context);
context.route = (url, handler, options) =>
route(url, async (r, q) => {
if (delay > 0 && new URL(q.url()).pathname === "/assets/ui.js")
await new Promise((done) => setTimeout(done, delay));
return handler(r, q);
}, options);
}
});
// the rest mirrors playwright.tier1.config.ts, with maxFailures: 0 and testDir in the checkoutRed, at the base: Green, at the head (the build is identical; only Both browsers, at the head, with no delay: A person's view ( I drove it with a Playwright script and pressed Escape the moment the dialog showed. A page-side capture listener logged each keydown and each DOMContentLoaded into
Leaving the product unchanged seems acceptable to me. The gap opens only when ui.js arrives well after the page. A lost Escape is safe on every dialog, Delete included, which still needs the typed name and a submit. Pressing again works, and Close always works. Golden journeys: none touched. The diff is six files under Rollback answers: they match the diff. Only test files change, so a revert leaves nothing behind, and no Not run
Notes
|
…listens Co-Authored-By: Claude Opus 5.5 <[email protected]>
2bb2431 to
ea131e6
Compare
… its own process (#1302) ## What changed CI's browser tier ran Playwright's `chrome-headless-shell`, which keeps a patch's sandboxed frame in the shell's process. Desktop Chrome gives it its own process. That's how #1299 shipped: in desktop Chrome a patch didn't hear the keyboard until clicked, while CI was green. #1298 fixed #1299 on `main`. This PR moves the tier 1 suite's `chromium` project to desktop Chromium, so a focus or keyboard bug that only Chrome shows fails CI. It no longer holds anything back: every test in the suite runs in desktop Chromium. #1407's `firefox` project still runs `focus.spec.ts` alone. Closes #1299 ## Look at **`playwright.tier1.config.ts`.** The `chromium` project sets `channel: "chromium"`, the full build in new headless mode, and #1407's `firefox` project sits beside it unchanged. The headless-shell hold-out is gone. #1406 fixed the local-hotkeys test's accessibility helper, which couldn't read an out-of-process frame, and the test now passes in desktop Chromium. `pnpm test:browser` runs `chromium`, as on `main`, so `package.json` doesn't change. **What landed first.** In desktop Chromium on CI, `switcher.spec.ts` failed often (#1402). #1412 fixed that on `main`, with one real desktop-Chrome focus race fixed in the shell's broker and switcher tests that acted too early. One of #1412's tests, the tab switch in `switcher.spec.ts`, skips in the headless shell, which keeps every tab focused. It starts running on CI with this PR. **The frame really is out of process.** CDP's `Target.getTargets` lists it as its own `iframe` target in desktop Chromium, and not in the headless shell. ## How it was verified - **On CI at this head, `a92a7f1`:** the `browser` job passed twice in a row. Each time desktop Chromium passed 180 and Firefox 8, with none failed or skipped. The local-hotkeys test and the tab-switch test ran in desktop Chromium. - **Locally:** the local-hotkeys test passed 3 of 3 in desktop Chromium, and the Firefox project 8 of 8. - **Earlier heads, stacked on #1412 before it merged:** - Five passes in a row at its first head, and two or three at each later one. - One failure was the #1377 flake, since fixed on `main` by #1414. - One `test (bun)` failure was a `Fleet.test.ts` clock-step case, which passed on rerun. - The other failures were gaps in #1412's own fix, each fixed in #1412. - **CI cost.** No new download. `playwright install chromium` without `--only-shell` already puts both Chromium builds in Chromium's cache entry, and the action's comment says why it stays that way. - **Not checked:** headed Chrome on a real display. New headless is the same browser build and runs the frame out of process, as the target count shows. Hit every surface: - **Dev loop docs:** `docs/DEVELOPMENT.md` says the browser job runs desktop Chromium with `focus.spec.ts` also in Firefox, and that a script launching its own browser for a focus check passes the same channel. The CI job's and the Playwright action's comments say the same. - **Doesn't apply:** served pages, the wire contract, the CLI, vocabulary, migrations, company resources, reverse states and the repo layout. ## Release impact Tick exactly one. - [ ] **Breaking** — requires action from anyone already running this - [x] **Not breaking** — no action required. Test and CI configuration and doc lines; nothing ships. - **What does a revert leave behind?** Nothing. CI goes back to the headless shell. - **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]>
…ey shortcuts (#1421) ## What changed This adds release 42's What's new entry, written from `1cd6d12`. It covers everything merged since release 41's `through` (`a25a9c5`), and sets the `patchy` release to `0.42.0` in `packages/patchy/package.json` and `CURRENT_RELEASE`. | Change | PRs | | --- | --- | | New: Tell Patchy what it's missing | #1217, #1218, #1219, #1227, #1228 | | New: Turn off single-key shortcuts | #1276, #1279, #1301 | | Fixed: Typing reaches the patch again | #1407, #1412 | | Fixed: Dialogs in patches keep your place | #1420, #1255 | | Behind the scenes: plainer facts for agents building patches | #1249, #1256, #1297, #1418 | | Behind the scenes: Patchy stores teams and audiences ahead of teams | #1416 | | Patch changes: Mod+/ and `client.close()` in patchy/hotkeys; single-key shortcuts can be off; Tab wraps in plain modal dialogs | #1279, #1301, #1420 | #1376 is release 41's own entry. #1400, #1406, #1414, #1415, #1302, #1413 and #1419 are test, CI and dev tooling and need no line. The teams bridge (#1416) ships alone in this release so teams (#1417) can follow in the next one with a release to roll back to that reads its data closed. ## Look at - **The entry**, at the top of `releases` in `packages/core/src/whatsNew.ts`. - **Rollback safety, from the live commit `7f93b91` (release 41) to this PR's merge.** No PR in the range is labelled `one-way`, and every Release impact answer says release 41 still works: - **#1217** adds migration `0037_feedback`, a schema release 41 never reads. **#1227** and **#1228** write into it. - **#1276** adds migration `0038_single_key_shortcuts`, a column with a default that release 41 never selects. - **#1416** adds migrations `0039_company_teams` to `0041_connection_audiences`, which hold tables that stay empty until teams ship, and widens one scope check. Its CI rehearsal ran `7f93b91 → head → 7f93b91 → head` on one set of data, and all four steps passed. - **#1279**, **#1301**, **#1255** and **#1420** change the SDK and the shell. Patches built on this release carry a `shortcutSetting` manifest field that release 41 reads without refusing, and its shell names no frame, so every shortcut stays on. - **#1218** and **#1219** add CLI commands and an optional `feedbackHint` in `--json` failures. A CLI from this release refuses to publish to an older instance before sending anything, as any mismatched release does. - Everything else is skill text, docs, tests and CI. If this release misbehaves, roll back to `7f93b91` (release 41). Written by Claude Opus 5.5 in Claude Code, through T3 Code. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <[email protected]>
What changed
Tier 1 specs pressed Escape on a dialog page once its field took autofocus or its dialog or refusal showed. The dialog's Escape, close link and place in history come from the deferred
/assets/ui.js, which can run after those appear. On a loaded CI runner the Escape did nothing, and the page sat on the dialog's URL for 15 s (#1377:shell.spec.ts,patch-page.spec.ts,sharing.spec.ts).A new helper,
loadDialog(page, act)intest/browser-tier1/dialog.ts, runs the act that loads a dialog page (a link to one, or a submission it refuses). It then waits for that page'sDOMContentLoaded, which a browser fires only after deferred scripts have run. Every spec that acts on a freshly loaded dialog page now goes through it.Closes #1377
Look at
1. The signal is DOMContentLoaded, armed before the act. ui.js loads with
defer, so once DOMContentLoaded fires its listeners are attached, and the served pages need no new marker. The wait is set up before the click, so it catches the new page's event even when the old page looks the same: a second refusal already showsaria-invalid. The signal holds only while ui.js staysdefer, whichServer.test.tsasserts.2. Red, then green, with ui.js held 1.5 s by a scratch route (a
context.routedelay inprepare, not committed).Before the fix, 7 of the 23 tests in the five files fail, each at an Escape, a close link or a Back on a dialog page:
After the fix, with the same delay:
23 passed (2.4m).3. Could a person hit it? Only by pressing Escape between the dialog appearing and ui.js running, about one fetch of ui.js, which is served
no-cache. Pressing Escape again then works. Closing any sooner would take a second inline script admitted by hash, or a ui.js that blocks rendering, which isn't worth it for a gap that short, so this PR doesn't change the product.How it was verified
--repeat-each=5on the five touched files: 115 passed in the headless shell with the repo's config, and 115 passed in desktop Chromium (channel: "chromium", through a throwaway config outside the repo).pnpm typecheck:tests,pnpm lintandbun fmtare clean.test/. In the switcher, shortcut-setting, Tell Patchy, starting and hotkeys specs, it closes a menu or a<dialog>that an already-running script opened, not a freshly loaded dialog page.ui.spec.ts'spage.gotocases already wait forload. Retire submits a form, which needs no script. Reassign passed under the delay only because its refused page leaves focus to the script, so it goes through the helper too.Release impact
Breaking — requires action from anyone already running this
Not breaking — no action required: tests only.
What does a revert leave behind? Nothing; only test files change.
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.