Brickheart

Handover i18n translation change

: Written by a human with AI assistance.

Done and committed:

  • Sitemap script removed.
  • Build page renamed to bench (bench.ts, render-bench.mjs, /<lang>/bench/).
  • Browse files named for the page (browse.ts, render-browse.mjs).
  • Engine moved to shared/engine/i18n.mjs.
  • shared/project.json, shared/languages.json and shared/engine/project.mjs added.
  • the i18n migration commit.

Layout:

  • shared/i18n/common, site/i18n/ui, site/i18n/content and app/i18n/ui each hold en.json, <lang>.json and todo.<lang>.json.
  • Keys are <scope>.<role>.<name>, and the key test enforces them.
  • <lang>.json is hash-keyed, so an English edit drops its translation and a key rename is free.

Not verified:

  • Whether app/tsconfig.json needs lib ≥ ES2021 for Intl.ListFormat.
  • Whether app/i18n.test.mjs finds the data-act names (needs render-bench.mjs lines 116-118 if it fails).

Audit recommendations still open

  • 2. README for regenerating shared/data, app/test-data and data/agent/bundle.json.gz, plus the Python pipeline. It also needs to say how app/data is copied from shared/data, which no script records.
  • 3. Settings page. The app has no page for language and theme, so they can't be changed there. Site and app should share both.
  • 4. Duplication. build.ts (now bench.ts, 910 lines, about 670 inside start()) is not split. The shared worker-client (db-client and collide-client) and the shared IndexedDB store base (ldraw-store and collide-store) are not extracted either. The BASE = '/bench/ldraw' constant is also duplicated in geometry.ts and ldraw-hook.ts.
  • 7. Git history. Keep the 12 MB DB and the packs out of history with git filter-repo, after the stable release. Tag first, and keep the commit-map to fix the hashes cited in the blog and audit.
  • 8. Type-checking. checkJs for scripts/ and every .mjs file. collide-parity.ts and make-agent-bundle.mjs are still unchecked and have no documented mention.
  • 9. Stale comments. ldraw-store.ts normalise says "Matches ldraw_pack.py", but the script is ldraw_bin_pack.py. The pack docstrings still say JSONL, and the code writes the indexed format.
  • 1. Unused exports. Re-check once the BrickNet and BrickAgent features land. Separately, site/tables.mjs inkFor and parseSpec, and the types PickerHost, PartGeom, PackItem and Paging, have no importers. They are harmless but could be un-exported.

Partly done

  • 5. 25 MiB file limit. The build now fails above 25 MiB and warns within 5%. subject-1_bin.gz is about 23.96 MiB, so that warning should fire today, and there is about 1 MiB of headroom. The pack will need splitting if it grows.
  • 6. CSP. The app build adds 'wasm-unsafe-eval'. The audit also asked for checking in browsers other than yours, which only you can do.

Audit sections 3 to 5 still open

  • Offline fallback page. A page that was never visited or precached still fails offline with the browser error.
  • Python pipeline. It is not in the repo, and the hardcoded /home/chinapal/... paths, shadowed REWRITE_INVENTORY_PARTS and duplicate normalize_part_numbers are unfixed. The plan to port it to a TypeScript tools/data/ pipeline, keeping Python only for fixtures, is not started.
  • Collision parity. 84 of 6,000 fixture cases are outside tolerance, deliberately left uninvestigated.
  • Contributor download page and CI-generated templates for new language files.
  • site-build.md still describes the old layout (languages.json under site/, translations/todo.json, inbox.json).

Open from this session

  • Browse-to-bench links now use data-folder, so they follow the current language.
  • Old /en/build/ URLs now 404. A _redirects line is undecided.
  • Plurals. Strings like {count} choices need Intl.PluralRules later.
  • Hardcoded English outside i18n: the root picker strings (cfg.picker) and cfg.rootNotFound in site/config.mjs, and everything in dev/config.mjs.
  • Still to do: contributor download page and CI-generated templates, split bench.ts (910 lines), shared worker-client, README for data regeneration, checkJs, an offline 404 page, the settings page.
  • Not started: a Python → TS data pipeline, and a shared head() for the app renderers.
  • Shared head() helper for the app renderers, which still duplicate the head markup. The missing manifest link in them is unconfirmed as a bug.
  • Layouts workpack. Separate bench layouts for touch, keyboard, voice, API and command line, which you said follows the audit.
  • Key test. app/i18n.test.mjs covers the app only. Nothing checks that the site's ui keys used in render.mjs, tables.mjs and config.mjs exist.