test(markdown): Cmd-A and kept column widths pass in the Linux browser lane (base red)
Two browser tests fail at the feat-cmux-next base on Linux (Chromium and WebKit) and redden web / react-apps-check on every PR. Both are test-harness gaps; no shipped editor code changes.
What was red, and why
markdown-selection-drag.test.ts "Cmd-A selects the document and reveals no syntax": after Meta+a the selection was "". ProseMirror's base keymap binds Select All to Mod-a, and it resolves Mod from navigator.platform when the keymap loads: Cmd on a Mac, Ctrl elsewhere. The page only runs in a Mac WebView, but on a Linux runner Mod was Ctrl, so Cmd-A did nothing. Same cause as the jsdom fix in #22490.
Fix: the test's browser context reports navigator.platform as MacIntel (an addInitScript before the page loads), so Cmd-A is Select All as in the app.
markdown-table-obsidian.test.ts "a column's right edge resizes it; the width stays across a reload; double-click fits it": after the reload the column was 90 px narrower than the resized width (the drag's full 90 px). Since 452cce0e668a the page keeps column widths through the host (cmux.markdown.setTableWidths, saved in the file's xattr and sent back as tableWidths in the config) instead of localStorage. The gallery's mock markdown host (src/gallery/frame/pages.ts) had neither the op nor the config field, so the page's write failed quietly and the reload started from no widths.
Fix: the gallery host answers setTableWidths (null forgets) and returns the saved value as tableWidths from config/open, with the frame's localStorage standing in for the xattr so it outlives page.goto.
Verification
On Huge Blue (Linux), CMUX_BROWSER_TESTS=1 CI=1 bun test test/markdown-table-obsidian.test.ts test/markdown-selection-drag.test.ts:
- Base 83c5aa1a0310: 19 pass, 5 fail. The four above (Cmd-A on both engines,
Expected to contain: "Selection guide",Received: ""; reload width on both engines,Expected: < 2,Received: 90), plus one Chromium page-load timeout on a cold Vite optimizer in the first selection test. - Head 6f1e14757a90: 24 pass, 0 fail, both engines.
bunx vp fmt --check and bunx vp lint are clean on both touched files. bun run typecheck reports no errors in them; its 10 errors (in devBridge.ts, devHost.ts, registry.ts and others) are already on the base.
🤖 Generated with Claude Code
Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
Fixes two browser tests that fail on Linux (Chromium and WebKit) and redden web / react-apps-check on every PR. Both were test-harness gaps; no shipped editor code changes.
- Cmd-A selected nothing on Linux because ProseMirror maps
Mod(Select All isMod-a) fromnavigator.platform; on a Linux runner that is Ctrl, not Cmd. The test's browser context now reportsMacIntel, as the app's Mac WebView does. - The table column width no longer survived a reload, because the gallery's mock markdown host didn't answer
cmux.markdown.setTableWidthsor returntableWidthsin the config. The host now answers the op and stores the value in the frame's localStorage so it outlivespage.goto.