Skip to content

test(design): read each pass of a design check's elements in one call - #1047

Merged
lavaman131 merged 1 commit into
mainfrom
fix/design-geometry-batch
Dec 1, 2026
Merged

lavaman131 merged 1 commit into
mainfrom
fix/design-geometry-batch

Conversation

@lavaman131

Copy link
Copy Markdown
Collaborator

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 say hit "Test timeout of 60000ms exceeded" on main at 1041785 (run 46540012615) and on #1043 (run 46540622380).

Each locator.nth(i).evaluate is 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 evaluateAll per pass. The assertions are unchanged, and each failure still names the element (its label, index or classes) and the property.

  • assistant-ui-geometry: expectClassGeometry checks 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: shown mirrors Playwright's isVisible (for elements that are not display: contents) so visibility is asked of every element in one call.
  • emoji (icon family), touch-targets, connecting-indicator (dots) and chat-media (toolbar buttons, file-icon inks) are batched the same way.

Not changed, on purpose: diagram-contrast's drawEach scrolls each diagram into view because that is what draws it, and its tests allow 240s. cursors and assistant-ui-theme step through different controls and states rather than looping over a collection.

Local times (full bun run design:behavior, before → after):

check wide narrow
copied element is as many pixels as its Tailwind classes say 21.6s → 11.1s 21.6s → 9.6s
message box (8px box, 28px controls) 20.3s → 4.8s 20.0s → 4.3s
Chat's icons are one family 19.6s → 5.0s 18.4s → 5.0s
Chat's media colours (light, dark) 8.9–10.1s → 6.0–6.3s 8.2–9.1s → 6.2s
message-actions and dropdown-menu 7.1s → 5.0s 6.4s → 4.8s
handoff and subagent list 5.4s → 4.1s 4.9s → 4.1s
touch targets 5.4s → 4.4s 5.6s → 4.2s

The other changed checks were already at about the 4s that loading the page costs, and stayed there.

Verification: bun run design:behavior in 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 ci and bun run types pass.

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
@lavaman131
lavaman131 merged commit 0c270a1 into main Dec 1, 2026
26 checks passed
@lavaman131
lavaman131 deleted the fix/design-geometry-batch branch December 1, 2026 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant