cmux-next: page strings tables become build output
The React pages' strings tables are no longer committed. These are webviews/src/**/generated/strings.json, the diff page's per-locale tables and loader, and the home-channels pane table. Each checkout now generates them from its own xcstrings catalogs and settings schema. Part of #21946.
Committed copies caused two problems. Every PR that touched a catalog or the settings schema conflicted with every other one in these files. And the PR autofix could rebuild a table from a stale schema and silently drop another branch's labels: #21746 lost 14 setting labels in 21 locales that way. A table generated from the tree it sits in can't do either.
Where the tables are written
bun install: apostinstallrunsgen-strings.mjs --best-effort. A half-translated branch, or a sparse checkout without the catalogs, doesn't fail install.- The webviews test preload: it rewrites only pages whose catalogs, schema or generator are newer than their tables. The write goes to a temporary file that is then renamed, because test processes run in parallel.
- Every bundle build, and
bun run build: strict, so a missing translation still fails.build-web-bundles.shused to refuse a stale committed copy. It now generates the tables from the commit's catalogs, which the bundle source key already hashes. A build still ships only what a commit holds (cx-t3e5). regenerate-web-bundles.shremoves the tables from the index when a branch from before this change merges the base. All of these outputs are routed throughcmux-generated-v1and next_batch'sWEB_GENERATED, so the catch-up bot and the batch merger handle the modify/delete instead of stopping on it.request-nightly-next.sh: a commit that no longer tracks the tables passes when they generate. Older commits are still checked with--check.
Measured on real open PRs
I ran git merge-tree --write-tree for each of the 235 open PRs into feat-cmux-next, against base a06abe91 and against this branch.
- Before: 5 PRs conflict in a strings table today. 31 open PRs edit one, so each of them re-conflicts whenever the base's tables move.
- After: a branch can no longer change these paths.
webviews/test/strings-build-output.test.tsfails if any table is tracked or not ignored. - One-time cost: against this branch, those 31 PRs each show a single modify/delete conflict on their old table. 30 of them conflict only there. The generated catch-up bot resolves it, or
scripts/cmux-next/regenerate-web-bundles.shon the branch does.
Verification
- Regression test. It was red on the base: "no strings table gen-strings.mjs writes is tracked" failed and listed the tables. It is green on this branch.
- Generated output. Generated tables are byte-identical to the committed ones on the base (
gen-strings.mjs --checkafter a freshbun install). - Typecheck.
bun run typecheckpasses on 1553 files, with bun 1.4.2. - Full suite.
scripts/ci/run-webviews-tests.shpassed 393 of 396 files:icons/iconPack.test.tsandquestion/model.test.tsfail on the base too.settings/editors.test.tsxtimed out under full-suite load. It passes 19/19 alone, and on the base.
- Other tests.
scripts/cmux-next/tests/web-bundles-readonly-sources.test.shpasses; it now also checks that the build writes fresh, ignored tables.scripts/cmux-next/tests/request-nightly-next.test.sh,tests/test_install_git_hooks.pyandtests/test_cmux_next_generated_catch_up.pypass. - Not run.
tests/test_next_batch.pyneeds git 2.46 or newer, and this host has 2.43. No Swift or app build is needed, because no Swift changed. - Review. A subagent reviewed the change with correctness first. Its three findings are fixed in the last commit: merge rules for the diff/pane outputs, atomic writes, and a best-effort run that tolerates missing inputs.
No workflow files change.
Changelog
none
🤖 Generated with Claude Code
Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
The React pages' strings tables (webviews/src/**/generated/) are no longer committed. Each checkout now generates them from its own xcstrings catalogs and settings schema, so PRs that touch a catalog or schema no longer collide in these files, and an autofix can't rebuild a table from a stale schema and drop another branch's labels (#21746).
Where the tables are written
bun installruns a best-effort postinstall so half-translated or sparse checkouts still install.- The webviews test preload rewrites only stale pages, through temp-file renames because tests run in parallel.
- Every bundle build and
bun run buildregenerate strictly, so a missing translation fails. - A regression test fails whenever any table is tracked or not ignored.
Adoption
- Branches from before this change get a single modify/delete conflict on their old table; the catch-up bot or
scripts/cmux-next/regenerate-web-bundles.shresolves it. - Generated tables match the previously committed ones byte-for-byte, and the webviews suite passes.