Files
archify/scripts/run-browser-tests.mjs
tt-a1iandDevin <158243242+devin-ai-integration[bot]@users.noreply.github.com> fca0dc2f91 feat(viewer)!: refined reader shell, Viewer-style figures, and no guided views
UI/UX only, re-cut from dev so no renderer or authoring-rule changes ride
along (those made diagrams noisier in real use and were dropped).

- Reader shell: system UI type, grouped toolbar that scrolls with the page,
  refined style/export menus and navigation dock (Guide on "?", Map only
  when zoomed), plain-language Path copy and compact picking panel.
- Summary rail with node index for every diagram: right by default,
  collapsible, movable to the bottom, remembered per browser, and
  collapsed when docking would shrink primary text below 12px.
- Raster exports reproduce the Viewer page without controls (title row,
  canvas card, margins); background now covers non-zero viewBox origins.
- Canvas keeps dev's diagram colors and strokes; classic adds only a quiet
  dot field and lifted nodes.
- Remove guided views and story playback (breaking): meta.views is no
  longer accepted and fails with "remove unsupported property views".
- Skill: each diagram request goes into .archify/<type>-<slug>-<timestamp>/.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-25 17:20:44 +08:00

60 lines
2.2 KiB
JavaScript

#!/usr/bin/env node
import { spawnSync } from 'node:child_process';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import { findChrome } from '../archify/bin/visual-check.mjs';
const skillRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..', 'archify');
// Shared by PR CI and tag releases. WebM decoding stays in test:webm.
const testFiles = [
'finalize-browser.test.mjs',
'desktop-reader-browser.test.mjs',
'reader-readability-maintained-browser.test.mjs',
'reader-layout-browser.test.mjs',
'reader-layout-settle-browser.test.mjs',
'joint-layout-browser.test.mjs',
'sequence-header-clearance.test.mjs',
'compact-header-clearance.test.mjs',
'architecture-reading-size-browser.test.mjs',
'lifecycle-rail-browser.test.mjs',
'lifecycle-band-title.test.mjs',
'export-cleanup-browser.test.mjs',
'offline-font-browser.test.mjs',
'i18n.test.mjs',
'semantic-radar.test.mjs',
'viewer-chrome-layout.test.mjs',
'viewer-camera-browser.test.mjs',
'motion-governor-browser.test.mjs',
'finder-browser.test.mjs',
'intent-trace-browser.test.mjs',
'semantic-lens-browser.test.mjs',
'route-probe-browser.test.mjs',
'focus-browser.test.mjs',
'crossover-state-browser.test.mjs',
'semantic-passport-move-browser.test.mjs',
'export-browser.test.mjs',
'viewer-identifiers-browser.test.mjs',
'repository-evidence.test.mjs',
'repository-evidence-types-browser.test.mjs',
];
const chrome = findChrome();
if (!chrome) {
console.error('Browser tests require an executable Chrome/Chromium. Set ARCHIFY_CHROME to its path; this gate cannot skip browser coverage.');
process.exit(1);
}
const args = ['--test'];
const [major, minor] = process.versions.node.split('.').map(Number);
if (major > 18 || (major === 18 && minor >= 19)) args.push('--test-concurrency=2');
args.push(...testFiles.map((file) => path.join('test', file)));
const result = spawnSync(process.execPath, args, {
cwd: skillRoot,
env: { ...process.env, ARCHIFY_CHROME: chrome },
stdio: 'inherit',
});
if (result.error) throw result.error;
if (result.signal) console.error(`browser test runner terminated by ${result.signal}`);
process.exitCode = result.status ?? 1;