// Split-view navigation check: the real pane-nav runtime (src/inject/paneNav.ts) over the static // x.com fixtures of the theme matrix, in Chromium, at split-pane widths. Per width it asserts that a // redundant pane parks X's rail off-screen and out of the layout, re-centers the main column, slides // the rail in after resting on the left edge (not while crossing it), and parks it again after the // pointer leaves; a lead pane (redundantNav false) and a disabled feature leave X untouched. // Screenshots go to verification/pane-nav/. The fixtures approximate x.com: not a live X test. // // node scripts/pane-nav-check.mjs import { build } from 'esbuild'; import { mkdir, writeFile } from 'node:fs/promises'; import { fileURLToPath, pathToFileURL } from 'node:url'; import { join } from 'node:path'; import { chromium } from 'playwright'; import { fixtureHtml } from './theme-matrix/fixtures.mjs'; const root = fileURLToPath(new URL('../', import.meta.url)); const out = join(root, '../../verification/pane-nav'); await mkdir(out, { recursive: true }); const bundle = (await build({ stdin: { contents: `export { installPaneNav } from '${process.env.PANE_NAV_SRC ?? './src/inject/paneNav.ts'}';`, resolveDir: root, loader: 'ts' }, bundle: true, format: 'iife', globalName: 'BTPane', write: false, target: 'chrome120', })).outputFiles[0].text; const failures = []; const check = (label, ok, detail = '') => { console.log(`${ok ? 'ok ' : 'FAIL'} ${label}${detail ? ` (${detail})` : ''}`); if (!ok) failures.push(label); }; const browser = await chromium.launch(); // The runtime is installed like the app does it: an init script, before the parser creates . const context = await browser.newContext({ viewport: { width: 800, height: 760 } }); await context.addInitScript({ content: `${bundle};window.pane = BTPane.installPaneNav(window);` }); const page = await context.newPage(); // X's classic rail (header[role=banner]) and a plain-div rail, the fallback path findRail() marks itself. const html = fixtureHtml('home', 'dark'); const VARIANTS = { header: { html, rail: 'header[role="banner"]' }, div: { html: html.replace('