Skip to content

fix(app): press the settings shortcut the modifier the page expects - #190

Merged
quickbeard merged 1 commit into
mainfrom
fix-remote-session-settings
Aug 11, 2026
Merged

quickbeard merged 1 commit into
mainfrom
fix-remote-session-settings

Conversation

@quickbeard

Copy link
Copy Markdown
Owner

The two remote-session-settings.spec.ts failures that every recent PR has been reporting as "pre-existing". After this the app e2e suite is 123 passed, 0 failed.

What was happening

Both tests open the settings dialog with a keyboard shortcut, and chose the modifier from the Node-side process.platform:

await page.keyboard.press(process.platform === "darwin" ? "Meta+," : "Control+,")

The app resolves mod from the browser's navigator.platform (IS_MAC in src/context/command.tsx), and Playwright's devices["Desktop Chrome"] profile ships a Windows user agent — so the page reports Win32 on every host, macOS included.

On a macOS machine the suite therefore pressed Meta while the app was listening for Control. Instrumenting the keydown handler showed it exactly:

[dbg] comma {"sig":"comma:2","hasSig":false,"settingsRegistered":true,
             "settingsKeybind":"mod+comma","sigs":["comma:1"],
             "isMac":false,"platform":"Win32"}

The command was registered and enabled; the keymap simply held comma:1 (ctrl) while the event produced comma:2 (meta). No match, no dialog, and both tests died at the first toBeVisible — with a screenshot of a perfectly healthy session page and no dialog on it, which is what made this look like an app bug rather than a test bug.

Linux CI stayed green because there the host branch happens to pick Control too. So it was invisible in CI and broken for every macOS developer.

The fix

Ask the page the same question the app asks:

async function openSettingsDialog(page: Page) {
  const mac = await page.evaluate(() => /(Mac|iPod|iPhone|iPad)/.test(navigator.platform))
  await page.keyboard.press(mac ? "Meta+," : "Control+,")
}

Nothing in src changes. A real macOS browser reports MacIntel, so mod → ⌘ is correct for actual users; only the test was reading the wrong platform. Hardcoding Control would also have worked today but would silently rot if the device profile ever changes.

I checked the rest of the suite — this spec was the only place branching on process.platform for input.

Divergences

packages/app/e2e/regression/remote-session-settings.spec.ts is an upstream file, so it gets a DIVERGENCES.md row. No CHANGELOG entry: this is test-only and not user-facing.

Worth submitting upstream — it breaks the suite for every macOS developer there too.

Verification

  • bun test:e2e:local — 123 passed, 0 failed (was 121 passed, 2 failed)
  • bun test (packages/app) — 630 pass
  • bun typecheck (packages/app) — clean
  • bun lint — 4746 warnings + 1 error, identical to main

🤖 Generated with Claude Code

Both tests in remote-session-settings.spec.ts chose Meta or Control from
the Node-side `process.platform`, but the app resolves `mod` from
`navigator.platform` (IS_MAC in context/command.tsx) and Playwright's
`devices["Desktop Chrome"]` profile ships a Windows user agent, so the
page reports Win32 on every host.

On macOS that meant the suite pressed Meta while the app was listening
for Control: the keymap had `comma:1`, the event produced `comma:2`, no
match, the settings dialog never opened and both tests failed at the
first `toBeVisible`. Linux CI stayed green because there the host branch
happened to pick Control anyway — so this was invisible in CI and broken
for every macOS developer.

Ask the page the same question the app asks. A real macOS browser reports
MacIntel, so the app was right and only the test was wrong; nothing in
src changes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@quickbeard
quickbeard merged commit ba60e94 into main Aug 11, 2026
0 of 5 checks passed
@quickbeard
quickbeard deleted the fix-remote-session-settings branch August 11, 2026 09:07
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