Repository navigation
feat(ui): the flow designer and the rest of the Studio chrome move into the studio i18n namespace (#25922 slice S6) - #27023
Merged
Conversation
…space Every remaining ENGINE_STRINGS_EN / ENGINE_STRINGS_ZH row except engine.translationPreview.* (538 en, 583 zh; the engine.flowNode.* and engine.enum.* rows stay zh-only) moves to @object-ui/i18n's studio namespace, text unchanged. lookupString already asks the table first and the namespace second, so no call site changes. Claude-Session: https://claude.ai/code/session_01JQwxbX9LnJhjTQPJEmoBYi Co-authored-by: Claude <noreply@anthropic.com>
…re suites read it The namespace pin gains a floor per moved family and asserts the engine.flowNode.* and engine.enum.* rows stay zh-only. Twelve suites that read a moved zh row synchronously load the zh catalogue first. The translateNodeLabel doc keeps the anchor the designer-parity gate cites for the zh-only flowNode family, now that the rows' own comment moved. Claude-Session: https://claude.ai/code/session_01JQwxbX9LnJhjTQPJEmoBYi Co-authored-by: Claude <noreply@anthropic.com>
… lives Claude-Session: https://claude.ai/code/session_01JQwxbX9LnJhjTQPJEmoBYi Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
席位核对ACCEPT · seat 席位意见:第六片把设计器私有表里除
Generated by Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Warren · project thread
Part of #25922
Clause-②: no
Metadata-protocol: none
维护者速读
engine.translationPreview.*之外的全部剩余行(流程设计器各族、页面区块画布、文档与书预览、engine.studio.inspector及其余 Studio 界面文案,共 44 族,en 538 键、zh 583 键),搬进@object-ui/i18n的studio命名空间,文案一字未改,调用点不动;engine.flowNode.*、engine.enum.*两族照旧仅 zh。ui/packages/i18n/src/namespaces/studio/zh.ts末尾的 S6 段(含仅 zh 两族的说明),再看钉测试新增的 44 个家族下限与三个仅 zh 断言。cd ui && pnpm run check:i18n-designer-parity && pnpm exec vitest run packages/app-shell/src/views/metadata-admin/inspectors/inspectorStrings.studioNamespace-25922.test.ts,应全绿。What changes
Slice S6 of the (M) item. Every row left in
ENGINE_STRINGS_EN/ENGINE_STRINGS_ZHinui/packages/app-shell/src/views/metadata-admin/i18n.ts, exceptengine.translationPreview.*, is appended toSTUDIO_EN/STUDIO_ZHinui/packages/i18n/src/namespaces/studio/{en,zh}.ts, text byte-for-byte unchanged. These are the 44 families, by keys per language:en=zhunless noted)enzhflowSim64,flowCanvas21,flowRuns19,flowPreview17,flowScope17,flowValidate16,flowProblems9,flowPalette8,flowExpr6,flowRef5,flowRegion4,flowNode(zh-only, 41),enum(zh-only, 4)pageBlockCanvas59,docPreview26,bookPreview22,layers16,widgetPicker16studio.inspector35list36,catalog25,sharingRule16,diagnostics16,directory14,draftConflict10,validation10,position9,appNav8,embedded7,quickfind5,badge3,fieldsListEditor3,typeAction2,celTest2,sourcePageEditor2,condition2, and one key each:celLint,package,breadcrumb,repeater,viewColumnPanes,home,engine.cancel,engine.closeEvery family is moved; none is left for S7.
engine.translationPreview.*stays (22 rows in each language) because feat(spec): a hook declares its refusal catalogue, and its body refuses by code, answered in the caller's language #26831 is still open. After this PR, those 22 rows are all the table holds. fix(metadata-protocol,runtime,app-shell)!: refuse a save or draft publish naming a package that is not installed #26920 is still open too, so its twoengine.studio.notFound.*rows are not in this PR. Whichever of fix(metadata-protocol,runtime,app-shell)!: refuse a save or draft publish naming a package that is not installed #26920 and this PR lands second resolves the conflict.zh-only rows stay zh-only.
engine.flowNode.*(41) andengine.enum.*(4) have noenentry, before and after:translateEnumOptionreturns the raw value for any non-zh locale.check:i18n-designer-parityalready lists both inZH_ONLY_FAMILIES, and the zh heading comment says why.One anchor kept in place (forced edit).
ZH_ONLY_FAMILIEScites the anchorresolved by translateNodeLabel/Hintini18n.ts. That text lived in theengine.flowNode.*rows' comment, which moved with the rows, so the gate's own test (check-i18n-designer-table-parity.test.ts, "every citation resolves") went red. The gate stays untouched, as the order requires. Instead,translateNodeLabel's doc comment now says that the rows are resolved by translateNodeLabel/Hint throughlookupStringfrom the namespace. That makes the cited text occur once again ini18n.ts.The S2–S5 AST pass, with a heading comment marking the S6 section in each catalogue. Two comment groups were mixed: their first row moved, so the comment moved, and the
engine.translationPreview.*rows after it stayed.No runtime change.
lookupStringalready asks the table first and the namespace second, sot/tFormat/tOptional,translateNodeLabel/translateNodeHint/translateEnumOptionand every call site are untouched. The table object,t()/tOptional(),TYPE_LABELS/DOMAIN_LABELS,FLOW_FIELD_ZHandcheck:i18n-designer-parityare left as they are for S7.Readers. Every non-test reader of a moved family is under app-shell's
views/metadata-admin/orviews/studio-design/. None callst()at module scope. The dynamic keys (engine.flowNode.${type}.label|hint,engine.enum.${field}.${value}) go throughlookupString. Nothing to stop and report.Main merged twice (
5fbed2b9,b94ef650). The first merge picked up fix(app-shell): the dashboard's Add-widget menu and widget Type select offer every spec widget type, from one registry #26967, which added nineengine.widgetPicker.type.*rows to the namespace. That PR's comment said the family's other rows "still sit in the app-shell designer table (objectstack#25922 moves them)". This PR moves them, so the comment now points at the S6 section. Text and key set are otherwise unchanged.Before the move, I read the patches of every open PR that touched either home (feat(spec): a hook declares its refusal catalogue, and its body refuses by code, answered in the caller's language #26831, fix(metadata-protocol,runtime,app-shell)!: refuse a save or draft publish naming a package that is not installed #26920, fix(app-shell): the dashboard's Add-widget menu and widget Type select offer every spec widget type, from one registry #26967, feat(app-shell): author a nav entry's landing, badge, order and visible condition in the Studio inspector #26977, fix(studio): Interfaces lists a package's pages, dashboards, reports and views no nav entry names #26982, fix(app-shell): Studio's Automations, App and Data creates refuse an identifier a published or draft item already holds #26987). None touches a moved key. fix(app-shell): the dashboard's Add-widget menu and widget Type select offer every spec widget type, from one registry #26967, feat(app-shell): author a nav entry's landing, badge, order and visible condition in the Studio inspector #26977 and fix(app-shell): Studio's Automations, App and Data creates refuse an identifier a published or draft item already holds #26987 have since merged and arrived through the main merges.
Changeset:
.changeset/25922-studio-i18n-flow-and-chrome.md,@object-ui/i18npatch.⛔ Untouched:
ui/packages/i18n/src/locales/*.ts,ui/.github/**, rootci.yml,engine.translationPreview.*,ui/scripts/check-i18n-designer-table-parity.mjs.Why
Ruling 6431032267 Q2 = A (upheld by 6431234244): the designer table becomes one lazy
@object-ui/i18nnamespace, moved in slices.Tests
inspectors/inspectorStrings.studioNamespace-25922.test.tsgains a floor for each of the 44 S6 families (86 families in all). Every key in each family must resolve throught()to the namespace value inen-US,zh-CNandde-DE. The zh-only case now covers three families (engine.packages.form.help.,engine.flowNode.,engine.enum.). For each, the rows are absent fromen,tOptionalinzh-CNreturns thezhvalue, andtOptionalinen-USstaysundefined.zhcatalogue first with a top-levelawait loadStudioCatalogue('zh'). No assertion changed.metadata-admin/:CelPredicateField.i18n-10862-s2metadata-admin/inspectors/:FlowNodeInspector.nodeTypeOptions-11778metadata-admin/previews/:AppNavCanvas.labelMaps-11128,AppNavCanvas.untitledCard-11862,DocPreview,FlowPreview.headerPills-11779,NodePalette,flowNodeLabels-13200studio-design/:ObjectListViewInspector.displayTitle-13151metadata-admin/flowNodePaletteI18n.test.ts,previews/FlowRunsPanel.test.tsandpreviews/flow-problems.repeatedEdge-11772.test.ts. All three are in theunitproject (isolate: false). Each passed in the full run only because an earlier file had already loadedzh, and failed when run alone.The sweep
I delayed the
zhloader innamespaces/studio/index.tsby 4000 ms (scripts/ablation-replace.mjs --hold, restored byte-identical). Under that delay I ran every app-shell test that names zh or a moved key, plus the i18n namespace and script tests (458 files). Then I ran each of the 50 unit-project files alone.i18n/src/__tests__/studio-namespace-lazy.test.tsxfails by construction under the delay, because itsfindByTextwaits 1 s against a 4 s delay.scripts/__tests__/check-i18n-designer-table-parity.test.tsfailed because of the moved citation anchor described above, not because of the delay.Tests 305 passed (305)). The dom suites and those three pass under the delay too (Tests 271 passed (271)). The three unit suites pass alone, both delayed and at normal speed.block-config-i18ntests and the equivalence check. Last run:Tests 501 passed (501). The equivalence check still reports 4,235 lookups, 0 differing.Acceptance notes
With the table nearly empty, every lookup resolves as before. This was a one-off measurement and is not committed. I read all 560
enand 605zhrows of the base table at49b50591by AST, which includes the 22 + 22engine.translationPreview.*rows that stay. I compared each witht()andtOptional()on this branch, withzhresident:envalue inen-US,en,de-DEandfr;zhvalue inzh-CN,zhandzh-TW;en-USandde-DE,t()must echo the key andtOptional()must returnundefined;translateNodeLabel/translateNodeHintfor everyengine.flowNode.*row (thezhvalue inzh-CN, the caller's fallback inen-US), andtranslateEnumOptionfor everyengine.enum.*row (thezhvalue inzh-CN, the raw value inen-US).Result: 4,235 lookups, 0 differing.
Ablations (mutation landed by anchor count and blob, restored byte-identical to
HEAD):?? studioString(key, locale)arm fromlookupStringturns 90 tests red: the pin'st()case for all 86 families, its three zh-only cases, and the equivalence check. The equivalence check reports 3,946 of 4,235 lookups differing. The 289 that hold are the 154engine.translationPreview.*lookups the table still serves, plus the 135en-side zh-only lookups, whose expected answer is "not found" or the fallback either way.engine.flowNode.start.label) makes the equivalence check report exactly 4 differing lookups (zh-CN,zh,zh-TWandtranslateNodeLabelinzh-CN). The pin stays green, as designed.Eager bundle: not re-measured locally, as in S2–S5. CI's
Build & E2E UImeasures it.Verification
At
b94ef650(the second main merge).Tests and gates
pnpm --filter @object-ui/i18n --filter @object-ui/app-shell run type-check: VERDICT command-exit 0.node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack: 34 commands, each exit 0, includingpnpm --dir ui exec vitest run scripts/(Test Files 176 passed | 2 skipped (178)).--ran: 34 derived, 34 run, 0 NOT-MEASURED. I also ran the same 34 after the first merge, all exit 0, and re-derived after the second merge: the same 34 commands.check:i18n-designer-parity,check:i18n-dead-keys,check:i18n-drift(0envalues changed) andcheck:i18n-keysall exit 0, before and after each merge.check:new-line-citations: exit 0 (0 new citations).node scripts/check-nul-bytes.mjs: exit 0.Human Minimum
packages/specchange.pnpm lintis CI's.main, one pull request.Generated by Claude Code