Repository navigation
[Maintainer] Land Russian locale (#1284) and raw-byte asset storage (#912) - #1357
Conversation
saveAsset stored the File itself, which some engines (WebKit) reject as an
IndexedDB value. It now stores { assetVersion: 1, bytes, type }, keyed by
main's randomId(). loadAssetUrl rebuilds a Blob from that record, still reads
File/Blob records written before this change, and returns null for an
unreadable record instead of throwing.
Ported from #912 onto current main.
Co-authored-by: Duhan K <157699651+DoudouDoudouk@users.noreply.github.com>
The contributor's ru catalog (3,956 entries, reviewed in context by a native speaker and marked Review: human) and Russian glossary terms for ceiling, floor plan, room, wall and walkthrough, plus a new unit entry. Not wired up yet. Co-authored-by: Aleksandr Betra <69962782+betraalexandr@users.noreply.github.com>
Wired the way Italian was in #1200: ru joins the shared target list as a preview locale, gets a per-locale entry point and package export, and loads on demand through loadBundledLocale, so ru and ru-RU resolve to ru. Re-extracted against current main: 224 new IDs and the three Comment strings whose English changed come in as fuzzy + Review: required AI drafts, so the compiled pack shows them in English until a native speaker reviews them. The retired node.item.panel.info entry is dropped. Ported from #1284 onto current main. Co-authored-by: Aleksandr Betra <69962782+betraalexandr@users.noreply.github.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
These tests commit every real catalog into a throwaway git repository and run release-check against it, so their time grows with each bundled locale. On CI the explicit-base test already took 3-4 s on main and passed 5 s once ru was added. Match the 60 s timeout scripts/i18n.test.ts uses for its catalog-heavy tests. Co-authored-by: Aymeric Rabot <Aymericr@users.noreply.github.com>
Aymericr
left a comment
There was a problem hiding this comment.
[Maintainer] Reviewed at 37cc3a158c2bf3e17991c1a82f8ada4cc9538be0 with Codex (gpt-6.2-astra) in two rounds: a full review, then each finding re-verified against the code (including running the i18n and asset tests and runtime probes). P0/P1: 0. The last commit after the reviewed 5bb6a4c1 only raises six release-check test timeouts to 60 s in scripts/i18n-literals.test.ts; I re-read that diff and there are no other changes. I also ran my local CI replica (lint, i18n, skills, types, tests, build, render-bundle, smoke, mcp, viewer-live) on a merge of this head with current main, and everything passes.
Russian wiring matches #1200.
ruis inBUNDLED_LOCALESwith its lazyimport('./locales/ru/messages')case, inbundledLocalePacks, inlocales/ru/index.ts(registerLocale()), in the./locales/ruexport, and inTARGET_LOCALESandPREVIEW_LOCALES.ruandru-RUboth resolve toru, and the lazy path serves Russian strings and plurals. Main's Italian glossary values are preserved.
Drafts fall back to English.
- Of 4,179 current IDs, exactly 3,952 compile. Every compiled entry is
Review: human, non-fuzzy, with the current source hash. - All 227
fuzzy+Review: requireddrafts are absent from the compiled pack. This includes all threepointAskButton.*IDs, which render the English "Comment" wording. - After
loadBundledLocale('ru-RU'), all 227 draft lookups matched English at runtime. - The repo validator found zero ICU, placeholder or glossary errors. All 38 plural IDs carry
one/few/many/otherbranches. Recompiling gave a byte-identical pack.
Asset storage. saveAsset keeps randomId() and the existing key and URL format, and stores { assetVersion: 1, bytes, type }. With a fake IndexedDB, a legacy File, a legacy Blob and a new v1 record each served the exact bytes and MIME type. Read and write failures reject on the write side and return null on the read side. Existing callers in editor and viewer are unchanged.
Non-blocking follow-ups (P2/P3):
- P2:
asset-storage.ts:50reads the whole file into memory before the IndexedDB write, and the local scan path accepts files up to 200 MiB. Under memory pressure this can fail at the read step. Consider trying the nativeFilewrite first and falling back to bytes (as I suggested on #912). - P3: the asset round-trip tests (
asset-storage.test.ts:45,:65) only assert theblob:prefix. Fetching the URL and asserting its body and content type would catch a broken reconstruction. - P3:
i18n/README.md:104sayscheck --reviewedfails on every draft, but previews such asitandruare exempt.ru/messages.po:51drops the "in the scene graph" navigation hint.
Review-only follow-ups for #1284 (translation fixes suggested earlier, the «Уровень» vs «Этаж» choice for "Level", the README section, a ?lang=ru screenshot) are intentionally left out of this PR. Merge is pending GitHub CI at this head.
Co-authored-by: Aymeric Rabot <Aymericr@users.noreply.github.com>
The Russian locale (#1357) landed just before #1356, so the element inspector labels, the keep-motion setting and the element node names had no Russian entries and i18n:check failed on main. They are added as fuzzy drafts awaiting review, shown in English until approved, like the other locales. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* core: undo and redo keep each build's generated images SceneDocument history replayed recorded patches as they were authored. Two regressions followed from replacing the temporal store (#1356): - Redo after an authored source edit lost the images captured for the new build: the capture is an ignored-history annotation, so the recorded forward patch predated it. Replay now captures matching live images into the return patches before each step and adopts them once the step succeeds, without adding a history step for captures. - Undoing a delete restored images belonging to another build: replayed creates bypassed the build-image rule. History replay now filters created and updated nodes through withSceneNodeBuildImages, which retainSceneAnnotations also uses, so one function owns build matching and live-before-carried precedence. Ordinary patch application is unchanged. Tests cover both scenarios, repeated traversal, exact emitted patches and inverses, captures while undone, creation restore, and grouped and multi-step history. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * i18n: Russian drafts for the general-core strings The Russian locale (#1357) landed just before #1356, so the element inspector labels, the keep-motion setting and the element node names had no Russian entries and i18n:check failed on main. They are added as fuzzy drafts awaiting review, shown in English until approved, like the other locales. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * core: explicit image removals apply; load-time store writes are queued - applySceneOperationPatch forwards explicit source.images writes and removals to the document transaction, so a host journal rollback that removes generated images applies instead of being turned into an authored source write that keeps same-build images. Ordinary authored same-build source edits still keep their images, and explicit replacement of existing images now works too. - Store writes requested from a load notification were silently dropped. They are now queued and applied in order, after the load and its history reset, in one published ignored-history transaction; functional setState updaters see the preceding queued changes, and a failed initialization rolls back and throws to the load caller. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
What does this PR do?
Lands two approved contributor PRs on current
main, with credit to their authors inCo-authored-bytrailers. When this merges, #1284 and #912 will be closed as landed, with credit. Their fork branches were not touched.Russian locale, from #1284 by @betraalexandr. Russian is wired in the same way Italian was in #1200 (
edb4ba2f):ruis added toTARGET_LOCALESinscripts/i18n-locales.tsand, likeit, toPREVIEW_LOCALES.packages/editor/src/i18n/locales/ru/index.ts, and the./locales/rupackage export.bundledLocalePacks(locales.ts) and added toBUNDLED_LOCALES, with a lazyimport('./locales/ru/messages')case inlazy-locales.ts.ruandru-RUboth resolve toru, and the app loads the catalog on demand throughloadBundledLocale.unitentry). Main's Italian glossary values are kept.The catalog was re-extracted against current
mainwithi18n:extractand compiled withi18n:compile. 3,952 of the contributor's entries keep theirReview: humanstatus. 227 entries are new AI drafts, markedfuzzy+Review: requiredwithAI-Provider/AI-Model, the same way #1200 marks drafts. They are:editor.actionMenu.pointAskButton.*strings, whose English changed from "Point and ask" to "Comment".None of the drafts is shipped as approved. The compiled pack shows them in English until a native speaker reviews them. The retired
node.item.panel.infoentry is dropped.The drafts went through the repo's own
translatecommand, using a temporary local provider that served my translations (not committed;scripts/i18n.tsis unchanged). That command validates ICU syntax, placeholders, plural branches and glossary terms before writing.Raw-byte asset storage, from #912 by @DoudouDoudouk.
saveAssetnow stores{ assetVersion: 1, bytes, type }in IndexedDB instead of theFileobject, which WebKit rejects. The only conflict was thesaveAssethunk: it keeps main'srandomId()with the PR's raw-bytes record.loadAssetUrlstill reads existingFile/Blobrecords, and it returnsnullfor a record it can't read instead of throwing.Test timeout. The release-check tests in
scripts/i18n-literals.test.tscopy every real catalog into a throwaway git repo, so they slow down with each bundled locale. On CI, one of them already took 3–4 s on main, and withruit went over bun's 5 s default. Those six tests now use the 60 s timeout thatscripts/i18n.test.tsalready uses for its catalog-heavy tests.Not changed here: the translation fixes suggested in review on #1284 (ID/OD, joists, dishwasher card, gate hint), the «Уровень»/«Этаж» consistency question, and the README "bundle another language" section.
How to test
bun run i18n:checkpasses and reportsru 227awaiting review.bun scripts/i18n.ts check --reviewedreports nothing forru, which is a preview locale likeit.cd packages/editor && bun test src/i18n. The new tests check thatru/ru-RUresolve toru, that theruentry point registers only Russian, and thatloadBundledLocale('ru-RU')loads only Russian. They also check that reviewed strings come out in Russian, that plurals render correctly (1 инструмент,2 инструмента,5 инструментов,21 инструмент), and that a draft (node.hedge.label) falls back to English.cd packages/core && bun test src/lib/asset-storage.test.ts. A saved asset is stored as raw bytes plus its type, a legacyBlobrecord still loads, and an unreadable record returnsnull.?lang=ru: reviewed copy shows in Russian, and the new garden/lawn/robot strings show in English.Run locally:
bun run check,bun run lint,bun run check-types,bun run i18n:check,bun run testandbun run build, all passing on5bb6a4c1. After the timeout change,bun run test:i18n-scriptsand Biome on the changed test file also pass.Screenshots / screen recording
Not added yet.
Checklist
bun devbun checkto verify)mainbranchPorts #1284 and #912.
Note
Medium Risk
Asset load/save behavior changes affect local uploads across browsers; Russian ships as a preview locale so unreviewed strings fall back to English rather than blocking release.
Reviewed by Cursor Bugbot for commit d6c3c78. Bugbot is set up for automated code reviews on this repo. Configure here.