Repository navigation
test(ui): make Control UI E2E captures byte-reproducible - #165353
Conversation
Capture related page and element proofs from one prepared viewport frame. Wait for stable layout, visible targets, fonts, and images without advancing paused fixture clocks; reject hidden crops. Honor reduced motion for ordinary modal dialogs as well as drawers, preventing entrance-animation paint history from changing captures. Disable partial rasterization in the shared browser suite.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed October 5, 2026, 2:01 AM ET / 06:01 UTC (Revision 2). ClawSweeper reviewWhat this changesThe PR stabilizes Control UI browser screenshot preparation, derives related crops from one captured frame, and makes modal dialogs honor reduced motion. Merge readiness✅ Ready for maintainer review The PR remains useful: current main lacks the shared-frame capture preparation and ordinary-dialog reduced-motion fix. This follow-up review found no actionable introduced defect, and the supplied browser results support the changed behavior. Priority: P2 Review scores
Verification
How this fits togetherControl UI browser tests feed rendered pages and selected elements into shared screenshot helpers, producing evidence for visual comparisons. The modal component also translates the operating system’s motion preference into dialog animation behavior. flowchart TD
A[Browser fixtures and selected elements] --> B[Settle layout fonts images and scroll]
B --> C[Capture one viewport frame]
C --> D[Page image and matching crops]
E[Operating system motion preference] --> F[Modal animation durations]
F --> B
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +2, Tests +544, Docs +7. Total +553 across 7 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep one screenshot capture owner with explicit static preparation and preserve normal recording behavior while honoring reduced motion in the modal owner. Do we have a high-confidence way to reproduce the issue? Yes: current source shows ordinary dialogs omit the reduced-motion duration override, and the supplied unchanged-source browser comparisons establish capture variability. This review did not execute a reproduction. Is this the best way to solve the issue? Yes: the change extends the existing capture and modal owners, preserves existing helper entrypoints, and avoids tolerance masks or speculative renderer settings. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ef5f7c199dd7. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
…5353) Capture related page and element proofs from one prepared viewport frame. Wait for stable layout, visible targets, fonts, and images without advancing paused fixture clocks; reject hidden crops. Honor reduced motion for ordinary modal dialogs as well as drawers, preventing entrance-animation paint history from changing captures. Disable partial rasterization in the shared browser suite.
Use CPU tile rasterization while retaining GPU composition and browser capabilities. GPU rasterization kept different fractional-edge pixels after otherwise identical layouts and modal reopen histories. Add --disable-gpu-rasterization in both shared suite launch orders and document the capture contract, retaining caller arguments and full-tile rasterization. The audited A/B sample has 25 fixed launches with zero RGBA or PNG-byte mismatches and 13 interleaved controls that reproduce the noise. Validation: UI production/test typechecks, scoped lint and formatting, 20 lifecycle tests, 31 focused E2E tests, and independent Codex review. Refs #165353.
* test(ui): make screenshot rasterization reproducible Use CPU tile rasterization while retaining GPU composition and browser capabilities. GPU rasterization kept different fractional-edge pixels after otherwise identical layouts and modal reopen histories. Add --disable-gpu-rasterization in both shared suite launch orders and document the capture contract, retaining caller arguments and full-tile rasterization. The audited A/B sample has 25 fixed launches with zero RGBA or PNG-byte mismatches and 13 interleaved controls that reproduce the noise. Validation: UI production/test typechecks, scoped lint and formatting, 20 lifecycle tests, 31 focused E2E tests, and independent Codex review. Refs #165353. * refactor(ui): share the E2E suite browser launch options Both server/browser launch orders now call one helper, so the capture determinism flags cannot drift between them. Behavior is unchanged.
…166414) * test(ui): make screenshot rasterization reproducible Use CPU tile rasterization while retaining GPU composition and browser capabilities. GPU rasterization kept different fractional-edge pixels after otherwise identical layouts and modal reopen histories. Add --disable-gpu-rasterization in both shared suite launch orders and document the capture contract, retaining caller arguments and full-tile rasterization. The audited A/B sample has 25 fixed launches with zero RGBA or PNG-byte mismatches and 13 interleaved controls that reproduce the noise. Validation: UI production/test typechecks, scoped lint and formatting, 20 lifecycle tests, 31 focused E2E tests, and independent Codex review. Refs openclaw#165353. * refactor(ui): share the E2E suite browser launch options Both server/browser launch orders now call one helper, so the capture determinism flags cannot drift between them. Behavior is unchanged.
What Problem This Solves
Control UI screenshot captures were not reproducible, so exact pixel gates could not tell a real visual change from capture noise. In the l357 deslop lane (#164577 evidence), re-capturing unchanged main source matched only 31/52 of its own saved captures, three back-to-back passes of one head matched 138, 134 and 130 of 150 pairs, and several element captures contradicted the matching rectangle of their own full-page capture.
There are no committed reference images (the E2E skill forbids committing generated screenshots). The 150 targets come from four lane-owned parity specs that run through the shared Control UI E2E harness (
createControlUiE2eSuite, the mock Gateway,control-ui-e2e-screenshot.ts). So the fix belongs in that harness, plus one product bug it surfaced.User Impact
Operators who enable the OS reduced-motion preference now get modal dialogs that open and close without entrance or exit animation; previously only drawers honored it. For maintainers, Control UI screenshot captures from the shared E2E harness become reproducible enough for exact pixel gates, so visual-parity checks stop flagging unchanged source.
Why This Change Was Made
Root causes and fixes
takeControlUiScreenshotFrametakes one unclipped viewport frame and derives every element crop from it (integer-enclosed, dimension- and bounds-asserted).takeControlUiElementScreenshotnow uses the same path.Datedoes not pause timerspage.clockand pause it; readiness waits on native layout delivery (IntersectionObserver), not rAF, so it never advances the fixture clock.prefers-reduced-motion(product bug)wa-dialogran 150 ms scale/opacity entrances; the resulting paint history moved dialog text by exactly 1 px between runs (259 px and 1,013 px)modal-dialog.ts: the reduced-motion rule now covers ordinary dialogs (show and hide), not just drawers. Browser regression fails before, passes after.visibilitywere acceptedcheckVisibility({ checkOpacity: true, visibilityProperty: true }).--disable-partial-raster(caller args preserved).Renderer experiments that did not hold up under repeat proof (forced SwiftShader/ANGLE, full-compositor-pipeline, Skia CPU, zero Skia resource cache) were removed rather than kept as cargo.
Evidence
Reproducibility (macOS,
nice -n 10, all 4 parity specs, 32 scenarios, 150 targets, exact decoded RGBA, no tolerance/masks/exclusions)b3eef54c555PNG bytes match wherever RGBA matches. Every after-run completed 32/32 scenarios with complete, equal-dimension inventories.
Remaining residual (not hidden):
plugins-grouped-catalog-desktop.pngdiffered by 13 px in the reference run only. Focused repeats reproduce two sparse raster variants (the catalog card corners, and the top anti-aliased edge row of the Telegram modal's gradient header over a blurred backdrop) at roughly 2–3 in 6. Attribution is blocked by an observer effect: Chromium's LayerTree inspection forces a full repaint, and every instrumented run was exact. This sits below the harness, at the Chromium/Skia raster level, and is a follow-up rather than something to mask.Gates (final head, Linux Testbox)
pnpm tsgo:uipassed (39 s),pnpm tsgo:test:uipassed (279 s)git diff --checkcleanui/src/components/modal-dialog.browser.test.ts: 11/11 (5 s)ui/src/e2e/initial-connect-splash.e2e.test.ts --maxWorkers=1: 13/13 (41 s). The file carries the frame/clock/scroll/hidden-crop regressions and now uses the existingawaitInitialRoster: falsefor the held-chat-module case, which was a proven readiness wait cycle.Notes
docs/web/control-ui/settings.md)..agents/skills/control-ui-e2e/SKILL.mddocuments the single-frame capture contract and the paused-clock rule for transient states.