Skip to content

[Maintainer] i18n: editor-side inspector panels and 3D overlay scope - #1180

Merged
Aymericr merged 6 commits into
mainfrom
cursor/i18n-inspector-editor-panels-8160
Oct 27, 2026
Merged

Aymericr merged 6 commits into
mainfrom
cursor/i18n-inspector-editor-panels-8160

Conversation

@Aymericr

@Aymericr Aymericr commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

What does this PR do?

This is the first of the remaining inspector PRs: the editor-side panels, plus one editor fix the node inspectors depend on. Part of #621. main (with #1179) is merged in with a normal merge commit. Stored scene data is unchanged.

  • i18n scope inside 3D overlays (fix). drei's <Html> renders its children in a separate React root, which sees none of the surrounding context. Any component inside it that called usePascalI18n() got the default English scope instead of the ?lang= or <Editor locale> scope. That affected the node action menu, the 3D room pills, the selection summary and the cursor HUDs.

    • New components/editor/localized-html.tsx is a drop-in Html that re-provides the caller's scope. The editor's 23 drei Html imports switch to it; the usages themselves don't change.
    • It's exported as LocalizedHtml. The node packages' own Html labels (cabinet, dormer, fence, MEP) switch to it in their inspector PRs.
    • The three nodes tests and one editor test that drop Html labels by element type now match LocalizedHtml.
  • Node action menu. All buttons: Move, Duplicate, Delete, Group/Ungroup, Rotate, Curve, Cut out, Find in catalog, Edit mesh. The door and window Open/Close and the Play/Stop button are one ICU select. Shortcut key names in its tooltips ("Backspace") use the existing key messages.

  • Riser diagram. Title, legend, empty state, and the close button, which now has an accessible name. Core's marker labels (2" P-trap, 2" VTR, raw fitting types) stay English in core, where MCP reads them. The panel words them at display time, and fittings use the shared editor.inspector.option.* names ("Sanitary tee" rather than sanitary-tee).

  • Procedural item inspector. Header, back, parts, position, and the fallback error copy. Recipe and part labels are authored data and stay as written.

  • MEP run HUD. "Length: {field} m" is one message around the input (messageWithSlot), plus the placeholder and the Tab hint.

  • Tooling P3 from [Maintainer] i18n: room-name and count follow-ups #1179: ungrouped counts. The remaining [Maintainer] i18n: migrate properties and inspector panels #1174 counts now use a plain {…Count} value inside the plural, as [Maintainer] i18n: room-name and count follow-ups #1179 did, so they read 1234 like main rather than 1,234:

    • door and window counts;
    • stair risers;
    • surveyed lines;
    • "shared with # room(s)";
    • "The floor's # roofs".

    The existing drafts were rewritten with the same substitution.

  • Audit. New node-action-menu surface: a door's action menu with the Delete tooltip. The riser diagram has no surface, because the standalone app's toolbar doesn't include its toggle (hosts that use ViewToggles do).

  • Catalogs. 35 new messages, 5 changed. zh-CN, fr, es and ja drafts are fuzzy with Review: required, so they show English until reviewed.

How to test

  1. bun run i18n:check passes, with 2,561 entries per locale awaiting review.
  2. Run bun dev, open a project with ?lang=en-XA, and select a door. The floating action menu, its tooltips (including the key name) and the door's Open button are bracketed and accented. Before this PR they were English.
  3. bun run i18n:pseudo-audit over every migrated surface (all except home, settings and the whole-editor sweep): all 30 pass, including the new node-action-menu. I ran this.
  4. Tests I ran:
    • packages/editor bun test src: 2,704 pass.
    • packages/nodes: 5,025 pass, 1 skip.
    • bun test scripts/: 131 pass.
    • Editor and nodes type checks are clean, and bun run check reports no errors.

Still English after this PR

  • Node inspectors: cabinets, column, chimney, elevator, vents, dormer, skylight, solar panel, fences and MEP. These come next, split by kind so each PR stays reviewable.
  • Also still English: construction dimension and block, external plugin copy, command messages, material names and unit suffixes.

Screenshots / screen recording

en-XA, captured by i18n:pseudo-audit (UTC, metric). The images are served from the image-only branch cursor/i18n-audit-screenshots-8160, which is never merged.

Node action menu on a door, with the Delete tooltip and its key name:
Node action menu en-XA

Room panel (door and window counts, action menu inside the 3D overlay):
Room panel en-XA

Roof panel:
Roof panel en-XA

Stair panel (riser counts):
Stair panel en-XA

Checklist

  • I've tested this locally with bun dev
  • My code follows the existing code style (run bun check to verify)
  • I've updated relevant documentation (if applicable)
  • This PR targets the main branch
Open in Web Open in Cursor 

Html renders its children in a separate React root, so components inside it
(the node action menu, room pills, the selection summary) translated with the
default English scope. Html from localized-html re-provides the caller's scope.
Door and window counts, stair risers, surveyed lines, 'shared with # room(s)'
and 'The floor's # roofs' render 1234, not 1,234.
@Aymericr Aymericr added the bot:maintainer label Oct 27, 2026 — with Cursor
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T15:49:15.381173Z 913961e PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copy link
Copy Markdown
Member Author

Tooling cross-review at 913961e: APPROVE

No P0/P1/P2.

  • Stored data: display only. Node action menu, mechanism button, riser diagram, procedural inspector and run HUD copy are translated where they render; nothing translated reaches updateNode or MCP. The procedural inspector still shows core/zod error messages as-is.
  • LocalizedHtml: drei Html with one PascalI18nProvider around its children. That adds a context provider and an i18n.retain() ref-count on mount. There is no useFrame and no extra state. drei still re-renders its root only when the children change, as before, and props and ref pass through. All 3D overlays and tests in packages/editor are switched over.
  • Counts P3: doors, windows, risers, surveyed lines, shared with # room(s) and The floor's # roofs now use plain {xCount} strings, so 1234 shows ungrouped, as on main. No new # plurals and no , number formats. Plain placeholders pass through unformatted (I checked Lingui directly).
  • Catalogs: +35 entries per locale, all fuzzy with Review: required. Reviewed stays at 85 per locale and drafts are 2561 for each locale.
  • No Security areas are touched.

Findings

  • P3: riser fitting markers in English change from the raw enum (sanitary-tee) to the prettified inspector option (Sanitary tee). It's display only and arguably better, but it differs from main.
  • P3 (follow-up): packages/nodes overlays still import drei Html (measurement, zone renderer, dormer guides, MEP tools). A component inside those roots that calls usePascalI18n() itself gets the default scope. They should move to LocalizedHtml once this merges.
  • P3: some # plurals from earlier migrations still group at 1000 or more: guide/scan counts, # register(s), # object(s) selected, the Roof/Staircase segment default names, and # tool(s) in apps/editor.

Checks run locally (Node 22; core and nodes dist rebuilt at this head):

  • Tests: editor 2704 pass; nodes 5026 run, 0 fail; core 6166 run, 0 fail; mcp 1338 pass; scripts/i18n*.test.ts 56 pass.
  • tsc clean for editor, nodes and apps/editor. Biome shows 13 warnings, the same as main.
  • i18n:check PASS, catalogs in sync. release-check --base origin/main shows no reviewed regression and no draft compiled in. i18n-literals check reports no new literals.

CI at this SHA: Changed paths, quality, cli-smoke and Cursor Bugbot all succeeded.

After this merges, the compiled en/en-XA messages.ts in #1181, #1182, #1183 and #1185 will conflict (regenerate them). #1181 and #1182 also conflict in i18n/pseudo-surfaces.ts (adjacent insertions). The .po files and literal-baseline.json merge cleanly with this PR.

@Aymericr
Aymericr merged commit 87ec430 into main Oct 27, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants