Skip to content

Commit b431db8

Browse files
authored
chore(desktop): preserve appearance during CDP diagnostics (#59681)
1 parent caebbcc commit b431db8

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

‎AGENTS.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
- The script discovers the server with `opencode service status`, injects its private local credential from `opencode service get password`, and uses the `dev` TUI storage channel so tabs and other client-local state match the installed client.
1111
- Prefer `dev:live` over plain `bun run dev` for this workflow. An implicit managed-service connection may replace the live server when the worktree client version differs; explicit `--server` warns and continues without replacing it.
1212

13+
## Live Desktop Diagnostics
14+
15+
- When attaching Playwright to a running desktop app, use `chromium.connectOverCDP(endpoint, { noDefaults: true })`.
16+
- Without `noDefaults`, Playwright applies light-mode media emulation during attachment. An app following the system theme then flashes light until the connection closes. The option also preserves the existing focus and other media preferences.
17+
- Do not emulate a color scheme or reduced-motion preference on the user's live window unless explicitly requested; use an isolated test context for those scenarios.
18+
1319
## TUI Stories
1420

1521
- When a user asks for a TUI story, add a fixture-driven story under `packages/tui/src/feature-plugins/system/storybook` and register it in `index.tsx`.

‎packages/app/e2e/performance/devex/desktop-startup.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,8 @@ function startDesktop(profile: Awaited<ReturnType<typeof createColdProfile>>) {
239239
}),
240240
])
241241

242-
browser = await chromium.connectOverCDP(url, { timeout: 120_000 })
242+
// Observe the native appearance and focus instead of applying Playwright's media defaults.
243+
browser = await chromium.connectOverCDP(url, { timeout: 120_000, noDefaults: true })
243244
const context = browser.contexts()[0]
244245

245246
if (!context) throw new Error("Electron did not expose a browser context")

0 commit comments

Comments
 (0)