webviews: table keys test runs as on the Mac; vp check formatting and type errors fixed

Merged
TE
16d ago
+13-4

Every pull request into feat-cmux-next fails web / react-apps-check (2) on webviews/test/markdown-table-keys.test.ts, and vp check in webviews is red on the base too. Both come from the test and formatting side; the editor's table keys are unchanged.

Table keys test. The third Cmd-A in a table should fall through to the editor's own Select All: tableKeyDown returns false once the whole table is selected. ProseMirror's keymaps pick what Mod means from navigator.platform when they load. jsdom's platform is "" and bun's is the host's (Linux x86_64 on the runners), so on Linux Mod was Ctrl, Cmd-A matched nothing, and the CellSelection stayed. The test has failed on Linux since it landed (ade5a7d79a30, fix 8ba372bb52b9: I ran it at that commit and it fails the same way) and passes on a Mac. The editor only runs in a Mac WebView, so the test now sets the jsdom page's platform to MacIntel before ProseMirror loads, and the two ProseMirror value imports moved after that. ProseMirror reads the platform once per process, so the override relies on each file getting its own bun test process, as scripts/ci/run-webviews-tests.sh gives it. In one process after markdown-selection.test.ts the test still fails, and a comment in the test says so.

vp check. Five settings files from the Chiefs-in-Settings and host-sections changes weren't formatted; vp check --fix reformats them with no code change. After the formatting step, the type check failed 10 times with TS2345 on every import.meta.hot.on(...). The cause is the /// <reference types="bun-types" /> that 0f60d169d86f (#22397) added to new-tab-list-motion-render.test.tsx. It pulls in bun's devserver ImportMeta.hot, whose on(event, () => void) clashes with Vite's typed hot.on. tsconfig.json already loads bun's types, so I removed the line. That test still passes (2/2).

Overlap: the reformatted files belong to the settings lane (webviews/src/pages/settings/). The change there is formatter output only (vp check --fix: line breaks, quote style, <R,> to <R>, redundant parentheses).

Verification

Base 0e72c08ae18b:

$ cd webviews && bun test test/markdown-table-keys.test.ts
Expected: false
Received: true
(fail) markdown table keys > Cmd-A selects the cell's text, then the whole table, then lets the document take it
 17 pass
 1 fail

$ bunx vp check
Found formatting issues in 5 files ... Run `vp check --fix` to fix them.
(after formatting: 10 x typescript(TS2345) on import.meta.hot.on)

Head 70ae70939b44:

$ bun test test/markdown-table-keys.test.ts
 18 pass
 0 fail

$ bunx vp check
pass: All 1816 files are correctly formatted
Found 0 errors and 7 warnings in 1753 files
(exit 1)

vp check still exits 1. config/vite-plus/check.ts sets denyWarnings, and there are 7 lint warnings, all already on base: ThreadMinimap.tsx (1, exhaustive-deps), NowPlayingPlayer.tsx (1), ChatDisplaySettings.tsx (4, control labels) and NewTabScreen.tsx (1, role="group"). Fixing them changes hook dependencies or accessible markup, which isn't behavior-neutral, so they're left for their owners. This PR removes the formatting failure and the 10 type errors.

I ran the PR-scoped whole-tree checks (ui-rules, gallery-coverage, tooltip-rules, theme-colors, hairline-rims, check-system-blue) with CMUX_PR_CHANGED_FILES set to this PR's files, and they pass. chiefsCard.test.tsx and new-tab-list-motion-render.test.tsx pass too.

This doesn't make bun run check or the web lint (fast) job green on its own. They still stop earlier, at check:text-focus, on three Swift text fields: WorkspaceTodoPageView.swift:13 and WorkspaceTodoRow.swift:21 from a7a60a35dbb8, and AddressBarView.swift:104. That's an app UI change, so it goes in its own PR. vp check comes after it in that chain and would still fail on the 7 base warnings above.

Risk

risk:medium by path, because it touches webviews/.

Proof

Not UI: one change is test-only and the other is formatter output plus one test file's type reference. No shipped page or editor code changes behavior.

Changelog

none

🤖 Generated with Claude Code