Repository navigation
fix(app-shell): flow expression notes, the Problems panel and the add-widget picker read the designer locale (objectui#10804) - #10832
Conversation
…e designer locale The flow-scope note under a repeater cell, the Problems panel's expression messages and the screen visibleWhen note now read the designer locale; the Screen fields heading and the add-widget picker's words read new engine.* rows whose en text is the literal they replace. A new widget's default title keeps writing the English label (stored author data). Co-Authored-By: Claude <noreply@anthropic.com>
|
changeset-claim-re-read
|
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
Contract reviewServed-tier: ① Derived judgmentsSites 1 and 2: correct and complete.
Site 3: correct.
zh rows.
Reader split: sound.
Parse-refusal ruling: true on the card's surfaces.
Bounded in-place fix: inside the surface, same class, correct, pinned.
Pins (read, not run).
Residual English on sibling surfaces (outside the named sites, and without a carrier once
Changeset Pending family changesets: none becomes false, and no dated note is owed. ② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS Generated by Claude Code |
Fixes #10804
Clause-②: no — the locale is passed and rows are added; each en row equals today's literal, and no declared surface or stored value moves.
objectui#10805 is folded into this card and rides here. Dispatched by the
domain:uiseat 2 PM (claim5858412835, sessionsession_014mXUNuFomfj24w7s1pZzhN).What changed
All under
packages/app-shell/src/views/metadata-admin/.FlowExprIssue.flowScopeNotepasses the designer locale it already holds todescribeUnknownRefs, as the siblingsFlowEdgeInspectorandFlowNodeConfigFielddo.previews/flow-expr-problems.ts.checkCelpasses itslocaletovalidateExpressionClient('predicate', value, locale).checkScreenVisibleWhentakes thelocalefromflowExpressionProblems(draft, locale)and passes it tovalidateExpressionClientand toscreenVisibleWhenScopeError.Visible when: …). The fields are now read throughlocalizeFlowFields, the localizer the inspector already uses, so the prefix is the column label the author sees. Evidence is in H1 below.engine.*rows.FlowObjectListField'sscreenScopeGroupsheading readsengine.flowScope.group.screenFields(enScreen fields).previews/screen-spec.ts'sscreenVisibleWhenScopeErrorgains an optionallocaleparameter, asdescribeUnknownRefshas one. The undeclared-root sentence readsengine.flowRef.notAScreenFieldandengine.flowRef.notAScreenFieldWithSuggestion; each en row is the literal it replaces.AddWidgetPickerreads the designer locale (useMetadataLocale, asFlowExprIssuedoes) for its search box, empty text, category headings and type names:engine.widgetPicker.*, with en equal to today's literals.previews/widget-types.ts.WIDGET_TYPE_META[].labelKeyis what the picker shows.WIDGET_TYPE_META[].labelstays the English the stored defaultNew TYPEtitle is written from.WIDGET_CATEGORY_LABELbecameWIDGET_CATEGORY_LABEL_KEY, and its only reader was the picker. The storedtypedoes not move.packages/i18nwidgetTypeterms (柱状图, 条形图, 折线图, 面积图, 饼图, 环形图, 散点图, 漏斗图, 透视表)..changeset/10804-designer-notes-locale.md('@object-ui/app-shell': patch).H1 — reproduced on the base, under zh-CN, through the real components
This is a probe run with the base's sources (
fb91ac9b0c). It mountedFlowPreview(Problems panel open) andFlowNodeInspectoron a screen node, both with localezh-CN.(amount > 1."{discount}template brace was used inside a condition — …"visibleWhenscope: "Approval:needsApprovalis not a field on this screen"needsApprovalis not a field on this screen"record.rating >= 4)."visibleWhencell notes: "needsApprovalis not a field on this screen", and the same parse refusal in English.FlowExprIssue: "Unknown referenceamout— did you meanamount?"dicountnote: "dicountis not a field on this screen (did you meandiscount?)"FlowEdgeInspectornamed the sameamoutreference in zh on the base (未知引用amout—— 是否想用amount?). The pin keeps it as a lit control, and it was green on the base.(amount > 1中的圆括号不配对。", "Reason: 条件中似乎用了模板花括号 …", "Approval:needsApproval不是此页面上的字段" and "显示条件:needsApproval不是此页面上的字段".H2 — the
screen-spec.tsseamscreenVisibleWhenScopeError(visibleWhen, node, locale?): an optional trailinglocale, thedescribeUnknownRefsshape. An absent locale reads the en rows, so any caller that passes none renders exactly what it did. The call sites:FlowExprIssue:screenVisibleWhenScopeError(value, screenNode, locale). The component already heldlocalefromuseMetadataLocale()forvalidateExpressionClient.checkScreenVisibleWhen(value, node, locale):screenVisibleWhenScopeError(value, node, locale).flowExpressionProblemsprefixes the message with the row's own label, or the column label when the row has none. The card'sReason:is such a row label: author data, which passes through.unevaluableVisibleWhen(node)inflow-simulator.ts: it passes no locale and still renders the en rows, inside that step's English sentence frame. See the Acceptance notes.H3 — every reader of
WIDGET_TYPE_META[].labelAddWidgetPicker: the entry's name and the search filterlabelbefore, nowlabelKeyDashboardDefaultInspector.addWidgetlabel, intoNew TYPE(and the selection label echoing that stored title)DashboardPreview.handleAddWidgetlabel, intoNew TYPE(same)DashboardDefaultInspector's widget rows,DashboardPreview's selected-widget header.icononlyNo display-only reader exists outside the picker, so nothing else was localized. Both stored-default readers keep writing English.
The search matches the name the entry shows, and the stored
typeid printed beside it. It does not match the English name the entry hides.bar,pivot).chartwould keep five entries that show no such word.Pins and ablation
The new file is
inspectors/inspectorStrings.i18n-10804.test.tsx, on the objectui#10696 / objectui#10748 harness: the rendered text of the real component, zh read back from the catalogue and guarded byzhRow.FlowExprIssue(decision branch);visibleWhenpicker heading;visibleWhennote (both keys);FlowEdgeInspectorsibling,engine.inspector.flowNode.kind, the Problems panel title, and the add-widget trigger.type: 'bar'andtitle: 'New bar chart'.Readings (the pin file held at HEAD):
fb91ac9b0c, restored by trap;git diff HEAD0 bytes after):Tests 12 failed | 9 passed (21). The 12 are exactly the zh site cases. The en controls, the lit controls and the stored-title control passed.4024c9b826:Tests 21 passed (21).ablation-replace.mjs. It dropped the locale at site 1:describeUnknownRefs(unknown, locale)becamedescribeUnknownRefs(unknown), anchor x1 → x0, blob772b9c8255→e8abd2db37.Tests 1 failed | 20 passed (21). The one failure is "FlowExprIssue — … zh: the unknown reference reads engine.flowRef.unknownWithSuggestion", received "Unknown referenceamout— did you meanamount?".FlowEdgeInspectorlit control stayed green.772b9c8255), andgit diff HEADis empty.Gates (HEAD
4024c9b826)packages/app-shelltest files that import a touched module or its mounting components, in two batches.Test Files 21 passed (21) · Tests 275 passed (275)andTest Files 21 passed (21) · Tests 295 passed (295).metadata-admin+studio-designdirectory run did not finish inside the 570-second foreground cap (killed, no verdict), so the full package suite is left to CI.pnpm --filter @object-ui/app-shell type-check(tsc --noEmit && tsc -p tsconfig.test.json): exit 0, after building the dependency closureturbo run build --filter='@object-ui/app-shell^...'(28/28 tasks).--listFilescounts the new pin once intsconfig.test.json.--print-configexit 0 for each).--format json: 8 files, 0 errors, 1 warning. The warning isreact-hooks/refsinFlowObjectListField, on a line this diff does not touch.eslint-rules/rule reads the disk, so this diff cannot move any verdict on an untouched file. The repo-wide lint is CI's.check:i18n-designer-parity0 ("Every en row has a zh row, and every shared row carries the same placeholders.").check:i18n-drift0 ("No designer-table en value changed in this range.").check:i18n-keys0.check:designer-field-key-parity0.check:new-line-citations0 (0 new).check:control-bytes0.check-changeset-presence0.check-changeset-no-major0.check-changeset-fixed0.check:vi-mock-specifiers0,check:vi-mock-inherit0,check-vi-mock-override-shape0.check-test-path-roots0.check:unreferenced-sources0.Serial
ff94a12d24), no open PR touched these files.ViewPreview.tsx(PR objectui#10821) orinspectors/datasetFilterCondition.ts(seat 4, objectui#10813).origin/mainfda49e557b:git merge-tree --write-treeexit 0, no conflicts.metadata-admin/is unchanged between the base and thatmain.Acceptance notes
DashboardDefaultInspector.addWidgetandDashboardPreview.handleAddWidgetkeep writingNew ${label.toLowerCase()}in English under every locale.WIDGET_TYPE_META[].labelreaders, and both are stored-default. Neither is a display-only reader, so neither was changed.screenVisibleWhenScopeErrorreturns producer text there:@objectstack/spec'spredicateSlotRefusalfor the shape;@objectstack/formula'svalidateExpressionandcollectCelRootIdentifiersfor the parse, which embed the CEL engine's own diagnostic ("invalid CEL predicate: Unexpected token: EOF …").flow-simulator.ts) composesunevaluableVisibleWhen's reasons into an English sentence ("A screen field's visibleWhen may reference only the fields declared on this screen; …"). It is outside this file surface. Its reasons stay on the en rows.AddWidgetPicker'slabel = 'Add widget'prop default is unreached: both callers pass the translatedengine.inspector.add.widget. It is left as is.Screen fieldsbecame 页面字段: the screen node is 交互页面 and its fields help says 此页面.Data tablebecame 数据表格, andMetric (KPI)became 指标 (KPI).Generated by Claude Code