Repository navigation
test(design): read each pass of a design check's elements in one call - #1047
Merged
Merged
Conversation
The coarse-pointer fix (0b678f8) moved one test off a loop of calls per element; the same loops kept others near their minute in CI. "A copied element is as many pixels as its Tailwind classes say" checked 128 elements with five or six traced calls each, and timed out on main at 1041785 (run 46540012615) and on #1043 (run 46540622380). In CI it took 42 to 60s, and the message box took 47 to 49s, re-reading every control's visibility for each control in turn. The icon family test took 39 to 46s. Each such loop now reads all its elements in one evaluateAll and asserts on the result, with the same assertions and the same messages: the element's label, index or classes, and the property. - assistant-ui-geometry: expectClassGeometry checks every element a locator finds in two calls and returns how many it checked; the handoff pills and subagent cards, the message actions, toolbar and reaction pills, the gallery tiles, the message box's controls and icons, and the staged chips are read the same way. - fixture: shown, Playwright's isVisible for an element that is not display: contents, to ask of every element in one call. - emoji (the icon family), touch-targets (rows, their targets and where a finger lands between them), connecting-indicator (the dots) and chat-media (toolbar buttons and the file icons' inks) likewise. Assistant-model: Claude Opus 5.5 Assistant-verification: bun run design:behavior on origin/main and on this change, both in full: 123 passed, 3 skipped; locally the Tailwind classes test went from 21.6s to 11.1s (wide) and 21.6s to 9.6s (narrow), the message box from 20.3s to 4.8s and 20.0s to 4.3s, the icon family from 19.6s to 5.0s and 18.4s to 5.0s, the media colours from 8.9-10.1s to 6.0-6.3s, the message actions from 7.1s to 5.0s and 6.4s to 4.8s; an injected 3px border on a gallery tile fails with its label, classes and "border widths"; bun run fix (its oxlint autofixes to two unrelated connector files reverted), ci and types
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The coarse-pointer fix (0b678f8) took one design check off a loop of Playwright calls per element. Other checks still loop the same way, and the next one has started to time out:
[wide] assistant-ui-geometry.e2e.ts › a copied element is as many pixels as its Tailwind classes sayhit "Test timeout of 60000ms exceeded" on main at 1041785 (run 46540012615) and on #1043 (run 46540622380).Each
locator.nth(i).evaluateis three traced calls over the whole audit page (a strict wait, the evaluate and a dispose). That check made five or six of them for each of its 128 elements, and took 42–60s in CI. In CI the message box check took 47–49s: for each control it re-read every control's visibility. The icon family check took 39–46s.Each loop over a collection now reads all its elements in one
evaluateAllper pass. The assertions are unchanged, and each failure still names the element (its label, index or classes) and the property.assistant-ui-geometry:expectClassGeometrychecks every element a locator finds in two calls. The handoff pills, subagent cards, message actions, toolbar, reaction pills, gallery tiles, the message box's controls and icons, and the staged chips are read the same way.fixture:shownmirrors Playwright'sisVisible(for elements that are notdisplay: contents) so visibility is asked of every element in one call.emoji(icon family),touch-targets,connecting-indicator(dots) andchat-media(toolbar buttons, file-icon inks) are batched the same way.Not changed, on purpose:
diagram-contrast'sdrawEachscrolls each diagram into view because that is what draws it, and its tests allow 240s.cursorsandassistant-ui-themestep through different controls and states rather than looping over a collection.Local times (full
bun run design:behavior, before → after):The other changed checks were already at about the 4s that loading the page costs, and stayed there.
Verification:
bun run design:behaviorin full on origin/main and on this branch: 123 passed, 3 skipped on both. With a 3px border injected on a gallery tile, the Tailwind check fails and the message names the tile's selector, its classes and "border widths".bun run fix,bun run ciandbun run typespass.