chore(desktop): preserve appearance during CDP diagnostics (#59681)

This commit is contained in:
usrnk1
2026-10-27 20:46:13 +01:00
committed by GitHub
Unverified
parent caebbcc080
commit b431db8de0
2 changed files with 8 additions and 1 deletions
+6
View File
@@ -10,6 +10,12 @@
- 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.
- 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.
## Live Desktop Diagnostics
- When attaching Playwright to a running desktop app, use `chromium.connectOverCDP(endpoint, { noDefaults: true })`.
- 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.
- 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.
## TUI Stories
- 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`.
@@ -239,7 +239,8 @@ function startDesktop(profile: Awaited<ReturnType<typeof createColdProfile>>) {
}),
])
browser = await chromium.connectOverCDP(url, { timeout: 120_000 })
// Observe the native appearance and focus instead of applying Playwright's media defaults.
browser = await chromium.connectOverCDP(url, { timeout: 120_000, noDefaults: true })
const context = browser.contexts()[0]
if (!context) throw new Error("Electron did not expose a browser context")