Skip to content

Preview harness: find Chromium on Linux and Windows - #154

Merged
juancguerrerodev merged 7 commits into
DojoCodingLabs:mainfrom
Abraham2106:fix/preview-browser-lookup
Nov 28, 2026
Merged

juancguerrerodev merged 7 commits into
DojoCodingLabs:mainfrom
Abraham2106:fix/preview-browser-lookup

Conversation

@Abraham2106

Copy link
Copy Markdown
Contributor

What and why

Closes #18

The preview harness found a browser only on an Apple silicon Mac. shoot.mjs, clips.mjs and words.mjs now share apps/mobile/preview/browser.mjs: HERMIT_PREVIEW_CHROMIUM first, then the newest chromium_headless_shell-* in Playwright's cache for the current system, and otherwise a message that names the variable. It never downloads a browser, and mascot/proof.mjs is unchanged. CONTRIBUTING.md gains "Screenshots for a UI change", and build.mjs points there.

Vision fit

Open development (ROADMAP.md, Now): contributors on Linux and Windows can take the screenshots AGENTS.md asks for.

Non-negotiables

  • This keeps every non-negotiable in AGENTS.md as it is.
  • Or it changes one, and this is the accepted RFC: n/a

Checklist

  • It closes one issue, linked above, or it's a small fix (a typo, a broken link, a wrong comment). A feature has an accepted proposal.
  • I wrote the failing test first. It fails without this change and passes with it. (browser.test.mjs, 17 tests, is the first commit and fails there. Run it with node --test apps/mobile/preview/browser.test.mjs.)
  • These pass: pnpm check:privacy, pnpm typecheck, pnpm lint, pnpm test and node scripts/guard/check.mjs --patterns scripts/guard/patterns.txt. (On Ubuntu; see Tried on for Windows.)
  • No new network call, telemetry, analytics, ads or crash reporting. (A new request in an app adapter is explained below, with its host, skill and risk.)
  • No new dependency, or the reason for each one is below.
  • Every UI string is in packages/copy, in es-419 and en, with matching keys and placeholders, and no em or en dashes. (n/a: no UI strings.)
  • Tests, fixtures and screenshots use made-up data only.

Model path

  • This doesn't touch the model path: packages/model, agent, skills or eval, the prompt, the router, tool descriptions, normalizers, examples or the model file.
  • It does. The eval numbers from before and after are below, run as docs/evals.md says. No held-out case was tuned on.

Screenshots

  • No UI change.
  • UI change. Each changed screen is below, in both themes and both languages, with made-up data.

New dependencies and network calls

n/a

AI agents

  • No AI agent wrote any part of this.
  • An AI agent helped. Which one, and what it did: Claude Code wrote the helper, its tests and the docs with me, and ran the checks on both systems.
  • I read and ran everything in this pull request, and I can explain it.

Tried on

  • Ubuntu 24.04, Node 24: the gates pass, and pnpm build + pnpm shoot about write About's 4 pictures with no errors.
  • Windows 11, Node 24: the same, and the 17 tests pass. pnpm test fails there for reasons already on main (paths from URL().pathname, CRLF checkouts), unrelated to this.
  • macOS: not tried. The Apple silicon path is the same as before, and the tests cover it.
  • With no browser, or a wrong HERMIT_PREVIEW_CHROMIUM, it stops with a message that names the variable.

Install: pnpm install --ignore-workspace in apps/mobile/preview, after pnpm install at the root.

Notes

@Abraham2106
Abraham2106 marked this pull request as ready for review November 27, 2026 22:50
daocuong11 and others added 7 commits November 28, 2026 16:56
browser.test.mjs gives findChromium() a made-up disk and checks each
system's cache folder and executable, PLAYWRIGHT_BROWSERS_PATH,
HERMIT_PREVIEW_CHROMIUM, revisions compared as numbers, the fallback when a
revision is incomplete, and the message when nothing is found.
Run it with: node --test apps/mobile/preview/browser.test.mjs

Signed-off-by: Abraham2106 <165726674+Abraham2106@users.noreply.github.com>
…eenshots

shoot.mjs, clips.mjs and words.mjs looked for a headless Chromium only in the
Apple silicon folder of Playwright's macOS cache, so the harness ran on no
other system. They now share apps/mobile/preview/browser.mjs, which uses
HERMIT_PREVIEW_CHROMIUM first, then the newest chromium_headless_shell in
Playwright's cache for the system it runs on (comparing revision numbers, not
text), and otherwise stops with a message that names the variable. It never
downloads a browser. mascot/proof.mjs keeps its own full Chrome lookup.

CONTRIBUTING.md gains "Screenshots for a UI change": the install command
(pnpm install --ignore-workspace), build, shoot with a filter, where the
pictures land, how to add a shot and how to point the harness at a browser.
build.mjs points there instead of a README that doesn't exist.

Refs DojoCodingLabs#18

Signed-off-by: Abraham2106 <165726674+Abraham2106@users.noreply.github.com>
Without them the build warns that it can't find expo/tsconfig.base, which
the app's tsconfig.json extends.

Refs DojoCodingLabs#18

Signed-off-by: Abraham2106 <165726674+Abraham2106@users.noreply.github.com>
…s again

The app now imports applyBiometricName (_layout.tsx) and
pauseDownloadWhenLeaving (download.tsx), and the preview's stand-in for
src/adapters had neither, so pnpm build stopped with "No matching export".
Both are no-ops in the preview: the copy keeps its default biometric name,
and there is no download to pause.

Signed-off-by: Abraham2106 <165726674+Abraham2106@users.noreply.github.com>
@juancguerrerodev
juancguerrerodev force-pushed the fix/preview-browser-lookup branch from 9ccf1a4 to 5335108 Compare November 28, 2026 22:56
@juancguerrerodev
juancguerrerodev merged commit 5335108 into DojoCodingLabs:main Nov 28, 2026
4 checks passed
@juancguerrerodev

Copy link
Copy Markdown
Contributor

Merged, thanks, Abraham! And good catch on the two missing stubs: main had broken the harness build, and this put it back. Contributors on Linux and Windows can take screenshots now. 🦀

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.

Let the preview harness run on Linux and Windows

4 participants