Repository navigation
chore(desktop): preserve appearance during CDP diagnostics - #59681
Conversation
There was a problem hiding this comment.
The change looks sound: the startup harness already fails a run if the desktop theme changes during startup (requireStableTheme). Playwright's default attachment forces light mode, so the attachment itself could trip that check on a dark system. noDefaults: true is supported by the pinned Playwright 1.60.0. The harness doesn't use downloads, so turning off Playwright's other default overrides shouldn't affect it.
I couldn't run it myself, because the benchmark launches the real Electron app and this environment has no display for it. The desktop-startup unit tests pass (4 tests). typecheck:e2e reports 11 errors, none in the changed file, the same count you reported for clean dev.
Public API: unchanged (benchmark harness and AGENTS.md only).
No blocking concerns.
Summary
noDefaults: trueso observing Electron preserves its native media and focus preferences.Cause
Playwright applies light-mode media emulation by default when
connectOverCDPattaches to an existing browser. A desktop app following the system theme immediately follows that override, then returns to dark when the connection closes.The investigation captured a 23 ms dark → light → dark transition with two bright frames, coinciding with another agent's diagnostic attachment. No reload occurred. The fix belongs in the attachment, not in application theme handling; this PR does not change production theme code.
Verification
noDefaults: truepreserved dark mode with zero media-query changes.bun run check— passed (existing lint warnings).bun typecheckinpackages/app— passed.bun test ./e2e/performance/unit/desktop-startup.test.tsinpackages/app— 4 passed.bun run lint:changed— passed.git diff --check— passed.bun run typecheck:e2einpackages/app— reports 11 existing errors in unrelated files; reproduced the identical errors on cleanorigin/devat432d870b02.No investigation probes, screenshots, or other transient artifacts are committed.