Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
e5fe0ae
Add RAC migration status doc
microbit-matt-hillsdon Jul 24, 2026
8838d58
Add AI agent notes pointing at the migration doc
microbit-matt-hillsdon Jul 24, 2026
976849c
Converge OSS theme onto shared structure + semantic tokens
microbit-matt-hillsdon Jul 27, 2026
9428283
Update RAC migration doc: pre-work done, findings, verification
microbit-matt-hillsdon Jul 27, 2026
69b9bd8
Update RAC migration doc: live fidelity confirmed
microbit-matt-hillsdon Jul 27, 2026
ef63df3
Add Panda + preset stack foundation (Chakra coexistence)
microbit-matt-hillsdon Jul 27, 2026
85198b4
Update RAC migration doc: step 2 Panda foundation done
microbit-matt-hillsdon Jul 27, 2026
5dd5f2a
Port ConfirmDialog to @microbit/ui (first coexistence port)
microbit-matt-hillsdon Jul 27, 2026
d4ae21c
Update RAC migration doc: step 3 started, ConfirmDialog pilot
microbit-matt-hillsdon Jul 27, 2026
2a58f9c
Port GenericDialog shell + footer to @microbit/ui Modal
microbit-matt-hillsdon Jul 27, 2026
9297b23
Update RAC migration doc: GenericDialog ported
microbit-matt-hillsdon Jul 27, 2026
1354af9
Port common dialog contents to @microbit/ui + Panda
microbit-matt-hillsdon Jul 27, 2026
4e9581c
Update RAC migration doc: common dialog contents ported
microbit-matt-hillsdon Jul 27, 2026
4168bc5
Port connect-dialogs family to @microbit/ui + Panda
microbit-matt-hillsdon Jul 27, 2026
bf0cf05
Update RAC migration doc: connect-dialogs ported
microbit-matt-hillsdon Jul 27, 2026
763e094
Port workbench dialogs to @microbit/ui; retire ModalCloseButton
microbit-matt-hillsdon Jul 27, 2026
5840c59
Update RAC migration doc: workbench dialogs ported
microbit-matt-hillsdon Jul 27, 2026
7724666
Port toast infra + remaining simple common/ components to @microbit/ui
microbit-matt-hillsdon Jul 27, 2026
82c1d3d
Update RAC migration doc: toast infra + common/ leaves ported
microbit-matt-hillsdon Jul 27, 2026
4c74923
Recompile message catalogs: @microbit/ui de/ga-ie/zh-cn close-action
microbit-matt-hillsdon Jul 27, 2026
2623b01
Update RAC migration doc: ui catalogs for de/ga-ie/zh-cn
microbit-matt-hillsdon Jul 27, 2026
0aa466b
Port CollapsibleButton/FileInputButton to @microbit/ui; add z-index t…
microbit-matt-hillsdon Jul 27, 2026
bc38b90
Update RAC migration doc: CollapsibleButton family + z-index tokens
microbit-matt-hillsdon Jul 27, 2026
6c313d0
Port src/project to @microbit/ui; retire its Chakra menus and forms
microbit-matt-hillsdon Jul 27, 2026
d8ba8a5
Update RAC migration doc: src/project ported
microbit-matt-hillsdon Jul 27, 2026
9d8164d
Port src/settings to @microbit/ui
microbit-matt-hillsdon Jul 29, 2026
0934f57
Update RAC migration doc: src/settings ported
microbit-matt-hillsdon Jul 29, 2026
83c27d7
Port src/serial to @microbit/ui
microbit-matt-hillsdon Jul 29, 2026
de85d26
Update RAC migration doc: src/serial ported
microbit-matt-hillsdon Jul 29, 2026
510bbc6
Port SplitView to Panda (app-side)
microbit-matt-hillsdon Jul 29, 2026
7369461
Update RAC migration doc: SplitView ported; Tabs/SplitView placement …
microbit-matt-hillsdon Jul 29, 2026
d7a4b5d
Doc typo
microbit-matt-hillsdon Jul 29, 2026
f4bea52
Port src/editor to @microbit/ui
microbit-matt-hillsdon Jul 29, 2026
14a03f4
Update RAC migration doc: src/editor ported
microbit-matt-hillsdon Jul 29, 2026
6a3b74d
Port src/workbench to @microbit/ui; sidebar Tabs onto react-aria
microbit-matt-hillsdon Jul 29, 2026
f5425a8
Update RAC migration doc: src/workbench ported
microbit-matt-hillsdon Jul 29, 2026
2cfd667
Fix sidebar tab corners and focus underline (visual review)
microbit-matt-hillsdon Jul 29, 2026
fd921f6
Doc: lesson count
microbit-matt-hillsdon Jul 29, 2026
3462fab
Restore focus-follows-navigation for keyboard tab selection
microbit-matt-hillsdon Jul 29, 2026
18533ba
Keep focus on the tab for direct activation (owner decision)
microbit-matt-hillsdon Jul 29, 2026
35ad461
Revert "Keep focus on the tab for direct activation (owner decision)"
microbit-matt-hillsdon Jul 29, 2026
73d7bdd
Note: sidebar tab focus behaviour parked for discussion
microbit-matt-hillsdon Jul 29, 2026
bfe5f30
Port src/documentation to @microbit/ui
microbit-matt-hillsdon Jul 29, 2026
96ec19c
Replicate the late-v3 density shrink in the Panda presets
microbit-matt-hillsdon Jul 29, 2026
ce0f049
Update RAC migration doc: documentation ported; density shrink found …
microbit-matt-hillsdon Jul 29, 2026
90df183
Doc: density scale lives only in the app preset (private stacks on it)
microbit-matt-hillsdon Jul 29, 2026
6ad0620
Port src/simulator to @microbit/ui
microbit-matt-hillsdon Jul 29, 2026
1b4003c
Update RAC migration doc: src/simulator ported; app components Chakra…
microbit-matt-hillsdon Jul 29, 2026
03148ba
Doc: thumb-tooltip arrow fix (gotcha #20)
microbit-matt-hillsdon Jul 29, 2026
b19ca40
Fix docs top-level item arrow button (owner review)
microbit-matt-hillsdon Jul 29, 2026
63689f2
Fix More/Less font weight in docs entries (owner review)
microbit-matt-hillsdon Jul 29, 2026
b471070
Restore Chakra drag-handle glyph (owner review)
microbit-matt-hillsdon Jul 29, 2026
37f03d5
Fix dialog footer gap and search auto-focus (owner review)
microbit-matt-hillsdon Jul 29, 2026
724b60f
Require both focus-visible heuristics for the tab underline
microbit-matt-hillsdon Jul 29, 2026
38c3d64
The kill-switch: remove Chakra
microbit-matt-hillsdon Jul 29, 2026
e8099a8
Update RAC migration doc: kill-switch done
microbit-matt-hillsdon Jul 29, 2026
d2f8a6d
Restore hover/active on split-view and search-clear buttons
microbit-matt-hillsdon Jul 29, 2026
4569371
Move CodeMirror/xterm/svg styling onto Panda CSS variables
microbit-matt-hillsdon Jul 29, 2026
0d7cde1
Restore autofocus in the name-entry dialogs (owner review)
microbit-matt-hillsdon Jul 29, 2026
7ebfb2b
Switch to published @microbit/ui 0.1.0-alpha.5 for CI
microbit-matt-hillsdon Jul 29, 2026
bd08c6d
Add pre-merge TODO list to the migration doc
microbit-matt-hillsdon Jul 29, 2026
690529f
Park density and sidebar-tabs-focus decisions until post-merge
microbit-matt-hillsdon Jul 29, 2026
186326e
Add the visual fidelity harness (npm run fidelity)
microbit-matt-hillsdon Jul 30, 2026
e8283dd
Restore list-style-position: inside on docs content lists
microbit-matt-hillsdon Jul 30, 2026
bd25ca7
Doc: fidelity dual-run green on both sides (29 states)
microbit-matt-hillsdon Jul 30, 2026
6381f80
Doc: brand ramp nits - casing fixed, 600/700 parked, 50/900 gap analysed
microbit-matt-hillsdon Jul 30, 2026
e6c543e
Doc: brand vs purple ramp analysis - grades not aligned
microbit-matt-hillsdon Jul 30, 2026
6034243
Doc: private purple/teal ramps confirmed fully unused
microbit-matt-hillsdon Jul 30, 2026
e568229
Doc: unused purple/teal ramps dropped from private preset; values pre…
microbit-matt-hillsdon Jul 30, 2026
0175c67
Doc: why blimpTeal stays a separate ramp (no action)
microbit-matt-hillsdon Jul 30, 2026
8663ca3
Doc: sync TODO with today's ramp work
microbit-matt-hillsdon Jul 30, 2026
255a830
Doc: ../ui follow-ups done on its python-editor-followups branch
microbit-matt-hillsdon Jul 30, 2026
58e17cb
Upgrade @microbit/ui to 0.1.0-alpha.6; adopt LinkButton
microbit-matt-hillsdon Jul 30, 2026
5d3f909
Doc: alpha.6 shipped and adopted in both apps
microbit-matt-hillsdon Jul 30, 2026
d7a7eda
Bump theme package
microbit-matt-hillsdon Jul 30, 2026
b271149
Remove dead returnFocus plumbing and unused MoreButton
microbit-matt-hillsdon Jul 30, 2026
32ba5ac
Doc: small cleanups done; slider formatOptions awaits owner call
microbit-matt-hillsdon Jul 30, 2026
ead613b
Announce units on sensor sliders where Intl can express them
microbit-matt-hillsdon Jul 30, 2026
cf08b6b
Doc: slider SR units done (celsius + degree, gated)
microbit-matt-hillsdon Jul 30, 2026
6f5a15d
Slider units in the accessible name, not per-value announcements
microbit-matt-hillsdon Jul 30, 2026
919f938
Doc: slider units final approach (accessible name)
microbit-matt-hillsdon Jul 30, 2026
45ce966
Repoint migration references ahead of retiring RAC-MIGRATION.md
microbit-matt-hillsdon Jul 30, 2026
d1e2d9a
Retire RAC-MIGRATION.md - the migration is complete
microbit-matt-hillsdon Jul 30, 2026
7e02fff
Fix faint caret and washed-out CM borders in production builds
microbit-matt-hillsdon Jul 30, 2026
5348115
Upgrade @microbit/ui to 0.1.0-alpha.7: the reset-layer fix
microbit-matt-hillsdon Jul 30, 2026
49af1cd
Restore ShowMoreButton's link form (left-aligned, content height)
microbit-matt-hillsdon Jul 30, 2026
69c5d55
Rename DocumentationContent's content prop to blocks
microbit-matt-hillsdon Jul 30, 2026
d31e985
Upgrade @microbit/ui to 0.1.0-alpha.8
microbit-matt-hillsdon Jul 30, 2026
e933d1a
Hide sidebar tab panels when collapsed
microbit-matt-hillsdon Jul 30, 2026
ac74e1b
Match sidebar search clear button hover to the search dialog's
microbit-matt-hillsdon Jul 30, 2026
8f3bee8
Upgrade @microbit/ui to 0.1.0-alpha.9; restore reference select's sm …
microbit-matt-hillsdon Jul 30, 2026
d4517c1
Restore semibold on the pre-release notice More/Feedback links
microbit-matt-hillsdon Jul 31, 2026
14cf4d7
Restore 2px top-level documentation dividers
microbit-matt-hillsdon Jul 31, 2026
3b0339a
Default Text to size md, restoring the Chakra theme's body text size
microbit-matt-hillsdon Jul 31, 2026
41185ef
Move select width constraints to NativeSelect's wrapperCss
microbit-matt-hillsdon Jul 31, 2026
d9093e2
Upgrade @microbit/ui to 0.1.0-alpha.10
microbit-matt-hillsdon Jul 31, 2026
bd2e790
Upgrade @microbit/ui to 0.1.0-alpha.11
microbit-matt-hillsdon Jul 31, 2026
874a321
Restore 2px dividers under doc-tab headers and search results
microbit-matt-hillsdon Jul 31, 2026
4bdce37
Restore 16px 'Don't show this again' dialog links
microbit-matt-hillsdon Jul 31, 2026
aced7a9
Don't render the flash-complete progress event as 0%
microbit-matt-hillsdon Jul 31, 2026
794be00
Upgrade @microbit/ui to 0.1.0-alpha.12
microbit-matt-hillsdon Jul 31, 2026
340c16e
Upgrade @microbit/ui to 0.1.0-alpha.13
microbit-matt-hillsdon Jul 31, 2026
1b9d20b
Upgrade @microbit/ui to 0.1.0-alpha.14
microbit-matt-hillsdon Jul 31, 2026
831b113
Remove timeout that matches the default
microbit-matt-hillsdon Jul 31, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module.exports = {
],
ignorePatterns: [
"dist",
"styled-system",
".eslintrc.cjs",
"deployment.cjs",
"bin/**/*.js",
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- run: npm ci
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: npm install --no-save @microbit-foundation/python-editor-v3-microbit@0.2.0-dev.48 @microbit-foundation/website-deploy-aws@0.6.0 @microbit-foundation/website-deploy-aws-config@0.9.0 @microbit-foundation/circleci-npm-package-versioner@1
- run: npm install --no-save @microbit-foundation/python-editor-v3-microbit@0.2.0-experiment.rai.62 @microbit-foundation/website-deploy-aws@0.6.0 @microbit-foundation/website-deploy-aws-config@0.9.0 @microbit-foundation/circleci-npm-package-versioner@1
if: github.repository_owner == 'microbit-foundation'
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
# production
/build

# Panda CSS generated output
/styled-system

# misc
.DS_Store
.env.local
Expand All @@ -30,3 +33,4 @@ __pycache__
/playwright-report/
/blob-report/
/playwright/.cache/
/.fidelity/
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
src/editor/codemirror/lint/lint.ts
styled-system
src/styled-system.css
20 changes: 20 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# AI agent notes

## Styling/theming

This app uses react-aria-components + Panda CSS via `@microbit/ui`
(migrated from Chakra UI, July 2026). **Read the gotcha catalog in
`../ui/docs/migration-playbook.md` before styling/theming/UI work** —
Panda's static extraction rules and RAC behaviours catalogued there still
apply to new code. The private theme package is the sibling repo
`../python-editor-v3-microbit` (consumed via a manual `node_modules`
symlink locally — re-create it after `npm install`). The visual fidelity
harness is `npm run fidelity` (see `bin/fidelity.mjs`).

## Commands

- Unit tests: `npm test` (vitest). E2e: run headlessly via
`npm run test:e2e:headless`.
- `npm run typecheck`, `npm run lint`.
- Format with Prettier: `npx prettier --write` (no npm script).
- New source files need the licensing header — `npm run fix-licensing-headers` applies it.
51 changes: 51 additions & 0 deletions bin/compile-lang.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/**
* (c) 2026, Micro:bit Educational Foundation and contributors
*
* SPDX-License-Identifier: MIT
*/

/**
* Compiles lang/ui.<locale>.json into the formatjs AST catalogs in
* src/messages/, merging in the source catalogs shipped by packages
* (currently @microbit/ui) so their strings ride in the app's lazily
* loaded per-locale chunks rather than being bundled eagerly for every
* locale. Package message ids are namespaced (`ui.`), so a collision with
* an app id fails the compile.
*/
import { execFileSync } from "node:child_process";
import fs from "node:fs";
import { createRequire } from "node:module";
import path from "node:path";
import { fileURLToPath } from "node:url";

const require = createRequire(import.meta.url);
const root = path.join(path.dirname(fileURLToPath(import.meta.url)), "..");
const formatjs = require.resolve("@formatjs/cli/bin/formatjs");
const packageLangDirs = ["@microbit/ui"].map((name) => ({
name,
dir: path.dirname(require.resolve(`${name}/lang/ui.en.json`)),
}));

for (const file of fs.readdirSync(path.join(root, "lang")).sort()) {
const inputs = [path.join(root, "lang", file)];
for (const { name, dir } of packageLangDirs) {
const packageFile = path.join(dir, file);
if (fs.existsSync(packageFile)) {
inputs.push(packageFile);
} else {
console.warn(`${name} has no ${file}; its English text will be used`);
}
}
execFileSync(
process.execPath,
[
formatjs,
"compile",
...inputs,
"--ast",
"--out-file",
path.join(root, "src", "messages", file),
],
{ stdio: "inherit" }
);
}
266 changes: 266 additions & 0 deletions bin/fidelity.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,266 @@
/**
* (c) 2026, Micro:bit Educational Foundation and contributors
*
* SPDX-License-Identifier: MIT
*/
// Visual fidelity harness. Compares the working tree against a baseline git
// ref by running src/e2e/fidelity.spec.ts twice:
//
// 1. The ref is checked out into a temporary detached worktree (with this
// repo's node_modules symlinked in), its dev server is started on
// :5199, and the spec runs with --update-snapshots to record baselines
// into .fidelity/ (git-ignored, per-run artefacts).
// 2. The working tree's dev server is started on the same port and the
// spec runs in compare mode. Playwright's HTML report shows the
// side-by-side diffs.
//
// The spec itself always runs from the working tree, so both sides capture
// the same states; only the app under test differs. Usage:
//
// npm run fidelity # baseline = HEAD
// npm run fidelity -- <ref> # baseline = any commit-ish
// npm run fidelity -- --baseline-only <ref>
// npm run fidelity -- --compare-only
//
// The split flags support cross-boundary runs that need paired
// sibling-package versions (see ../ui/docs/migration-playbook.md §6,
// "Fidelity, both sides"): rebuild the private
// package at the old commit, record the baseline half, restore everything,
// then run the compare half.
//
// Each dev server run regenerates Panda output for its own tree (via
// `prestart`); the worktree starts empty so it gets a full, non-stale gen.
// Coexistence-era baselines' panda script shells out to ../ui/bin/*, so the
// worktree gets a sibling `ui` symlink pointing at this checkout's ../ui.
import { spawn, execFileSync } from "node:child_process";
import { existsSync, mkdtempSync, rmSync, symlinkSync } from "node:fs";
import { tmpdir } from "node:os";
import path from "node:path";
import { fileURLToPath } from "node:url";

const repoRoot = path.dirname(
path.dirname(fileURLToPath(new URL(import.meta.url)))
);
// Must be the regular dev port: the Sanity project's CORS allowlist
// permits localhost:3000 but not arbitrary ports, and the docs sidebar
// fetches content from the browser. The two servers run sequentially so
// they never clash — but a separately running dev server will (strictPort).
const port = "3000";
const appUrl = `http://localhost:${port}/`;

const args = process.argv.slice(2);
const baselineOnly = args.includes("--baseline-only");
const compareOnly = args.includes("--compare-only");
const refArg = args.filter((a) => !a.startsWith("--"))[0];
const ref = refArg ?? "HEAD";

const log = (message) => console.log(`\nfidelity: ${message}`);

// Branded (private theme installed) and OSS sides must not share dep
// optimiser caches or snapshots-by-accident; make it visible in the logs.
const branded = existsSync(
path.join(
repoRoot,
"node_modules",
"@microbit-foundation",
"python-editor-v3-microbit"
)
);
log(`side: ${branded ? "branded" : "OSS"}`);

const playwrightEnv = {
...process.env,
E2E_PORT: port,
// Enables the fidelity project in playwright.config.ts.
FIDELITY: "1",
FIDELITY_NO_WEBSERVER: "1",
// Don't auto-open the HTML report mid-harness; we print how to at the end.
PLAYWRIGHT_HTML_OPEN: "never",
PW_TEST_HTML_REPORT_OPEN: "never",
};

/**
* Run a command to completion, inheriting stdio. Resolves with the exit
* code rather than rejecting so the harness can treat compare-mode test
* failures (expected when there are visual diffs) as a result, not an error.
*/
const run = (command, args, options = {}) =>
new Promise((resolve, reject) => {
const child = spawn(command, args, { stdio: "inherit", ...options });
child.on("error", reject);
child.on("exit", (code) => resolve(code ?? 1));
});

/**
* Start `npm run start` on :5199 in the given tree and wait until it serves.
* Detached so stop() can signal the whole npm → vite process group.
* VITE_CACHE_DIR keeps each side's dep-optimizer cache away from the
* node_modules/.vite dir a concurrently running dev server may be using
* (the worktree shares node_modules via the symlink); caches persist
* across fidelity runs.
*/
const startDevServer = async (cwd, cacheName) => {
const child = spawn(
"npm",
["run", "start", "--", "--port", port, "--strictPort"],
{
cwd,
stdio: "inherit",
detached: true,
env: {
...process.env,
// The deployed app (branded and OSS) always includes the
// foundation scripts (consent framework etc.); without them the
// welcome dialog can never open (cookie consent never initialises).
VITE_FOUNDATION_BUILD: "true",
VITE_CACHE_DIR: path.join(
repoRoot,
".fidelity",
"vite-cache",
`${branded ? "branded" : "oss"}-${cacheName}`
),
},
}
);
let exited = false;
child.on("exit", () => {
exited = true;
});
const deadline = Date.now() + 240_000;
while (Date.now() < deadline) {
if (exited) {
throw new Error(`Dev server in ${cwd} exited before serving`);
}
try {
const response = await fetch(appUrl);
if (response.ok) {
return {
stop: () => {
if (!exited) {
process.kill(-child.pid, "SIGTERM");
}
},
};
}
} catch {
// Not up yet.
}
await new Promise((resolve) => setTimeout(resolve, 500));
}
process.kill(-child.pid, "SIGTERM");
throw new Error(`Timed out waiting for dev server at ${appUrl}`);
};

const runSpec = (updateSnapshots) =>
run(
"npx",
[
"playwright",
"test",
"--project=fidelity",
// Each page load boots the whole app (incl. its language-server
// worker) against a cold-compiling dev server and fetches docs
// content over the network; at full parallelism the Sanity fetches
// time out and the sidebar renders its error state. Keep it modest.
"--workers=4",
...(updateSnapshots ? ["--update-snapshots"] : []),
],
{ cwd: repoRoot, env: playwrightEnv }
);

const recordBaseline = async () => {
const sha = execFileSync(
"git",
["rev-parse", "--verify", `${ref}^{commit}`],
{ cwd: repoRoot, encoding: "utf8" }
).trim();
const tempDir = mkdtempSync(path.join(tmpdir(), "python-editor-fidelity-"));
const worktree = path.join(tempDir, "baseline");
let cleanedUp = false;
const cleanup = () => {
if (cleanedUp) {
return;
}
cleanedUp = true;
try {
execFileSync("git", ["worktree", "remove", "--force", worktree], {
cwd: repoRoot,
stdio: "ignore",
});
} catch {
// Not created yet, or already removed.
}
rmSync(tempDir, { recursive: true, force: true });
};
process.on("SIGINT", () => {
cleanup();
process.exit(130);
});
try {
log(`baseline ${ref} (${sha.slice(0, 10)}) → ${worktree}`);
execFileSync("git", ["worktree", "add", "--detach", worktree, sha], {
cwd: repoRoot,
stdio: "inherit",
});
symlinkSync(
path.join(repoRoot, "node_modules"),
path.join(worktree, "node_modules"),
"dir"
);
// Coexistence-era panda scripts reference ../ui relative to the tree.
symlinkSync(
path.resolve(repoRoot, "..", "ui"),
path.join(tempDir, "ui"),
"dir"
);

rmSync(path.join(repoRoot, ".fidelity", "snapshots"), {
recursive: true,
force: true,
});

log("starting baseline dev server (includes Panda codegen)");
const baselineServer = await startDevServer(worktree, "baseline");
try {
log("recording baseline snapshots");
const baselineExit = await runSpec(true);
if (baselineExit !== 0) {
throw new Error(
"Baseline run failed — snapshots are incomplete; see output above"
);
}
} finally {
baselineServer.stop();
}
} finally {
cleanup();
}
};

const compare = async () => {
log("starting working-tree dev server");
const workingServer = await startDevServer(repoRoot, "working");
let compareExit;
try {
log("comparing working tree against baseline");
compareExit = await runSpec(false);
} finally {
workingServer.stop();
}

if (compareExit === 0) {
log("no visual differences ✔");
} else {
log(
"visual differences found — open the report with: npx playwright show-report"
);
}
process.exitCode = compareExit;
};

if (!compareOnly) {
await recordBaseline();
}
if (!baselineOnly) {
await compare();
}
16 changes: 16 additions & 0 deletions lang/ui.ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -1042,6 +1042,22 @@
"defaultMessage": "Logotip tàctil",
"description": "Name for the touch logo pin on the V2 micro:bit board. Used in the simulator."
},
"simulator-unit-celsius": {
"defaultMessage": "degrees Celsius",
"description": "Unit for the temperature slider, used in its accessible name"
},
"simulator-unit-degrees": {
"defaultMessage": "degrees",
"description": "Unit for the compass heading slider, used in its accessible name"
},
"simulator-unit-milli-g": {
"defaultMessage": "milli-g",
"description": "Unit for the accelerometer axis sliders (thousandths of g-force), used in their accessible names"
},
"simulator-unit-nanotesla": {
"defaultMessage": "nanotesla",
"description": "Unit for the compass axis sliders, used in their accessible names"
},
"simulator-unmute": {
"defaultMessage": "Deixar de silenciar",
"description": "Aria label for the unmute simulator button"
Expand Down
Loading