Repository navigation
fix(app-shell): the hook and action inspectors, and the shared inspector defaults, read their words in the designer locale (objectui#10586) - #10678
Conversation
…shell defaults, read their words in the designer locale (objectui#10586) HookDefaultInspector and ActionDefaultInspector route their section titles, field labels, placeholders, hints, option labels and accessible names through the designer catalogue under engine.inspector.hook.* and engine.inspector.action.*, with an en and a zh row each. InspectorComboField's placeholder, search, empty, loading and custom-row words, and _shared.tsx's close, reorder and roster-failure defaults, resolve through useMetadataLocale() when the caller passes none. en renders the same text as before. Claude-Session: https://claude.ai/code/session_01KUxVUa7e39aNjhkKi1gsoy Co-authored-by: Claude <noreply@anthropic.com>
…signer locale (objectui#10586) A zh sweep per surface asserts that none of the pre-fix English renders, an en read asserts every pre-fix string still does, named zh samples are read back from the catalogue, a caller's own label still wins, and two lit controls read translations that were already there. Claude-Session: https://claude.ai/code/session_01KUxVUa7e39aNjhkKi1gsoy Co-authored-by: Claude <noreply@anthropic.com>
…default strings patch Claude-Session: https://claude.ai/code/session_01KUxVUa7e39aNjhkKi1gsoy Co-authored-by: Claude <noreply@anthropic.com>
…18n-pr2 Claude-Session: https://claude.ai/code/session_01KUxVUa7e39aNjhkKi1gsoy Co-authored-by: Claude <noreply@anthropic.com>
… return void `Fixture` is `(lang) => Promise<void> | void`, and the two arrows that read the close label and the roster-failure notice off their primitives returned `inLang`'s `RenderResult`. `tsc -p tsconfig.test.json` refused them (TS2322); block bodies fix it. Claude-Session: https://claude.ai/code/session_01KUxVUa7e39aNjhkKi1gsoy 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
|
CI red at
|
Contract reviewServed-tier: Read for this record: card objectui#10586 (body and all 9 comments), the triage ① Derived judgmentsBinding text. Triage
② Semver level
Changeset prose, sentence by sentence: title "the hook and action inspectors, and the shared inspector defaults, read their words in the designer's locale" — true. "rendered their section titles, field labels, placeholders, hints, option labels and accessible names as English literals" — true (the removed lines). " No ③ Boundary flags
Implemented-by: VERDICT: PASS |
…18n-pr2 Claude-Session: https://claude.ai/code/session_01KUxVUa7e39aNjhkKi1gsoy Co-authored-by: Claude <noreply@anthropic.com>
✅ 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: Re-review at the PR's new head. Read for this record: card objectui#10586 (body and all 10 comments), the triage ① Derived judgmentsBinding text. Triage
② Semver level
Changeset prose, sentence by sentence: title "the hook and action inspectors, and the shared inspector defaults, read their words in the designer's locale" — true. " No ③ Boundary flags
Implemented-by: VERDICT: PASS |
Fixes #10586
PR 2 of 2. PR objectui#10651 (PR 1: the dataset, reference and condition surfaces) has merged, and this PR completes the card.
Clause-②: no
The English literals of
HookDefaultInspectorandActionDefaultInspectormove behind the designer catalogue'st(), each with an en and a zh row. The English prop defaults ofInspectorComboFieldand_shared.tsxresolve in the active locale when a caller passes none. en renders byte-identical. No schema, export or accept set moves.What changes
inspectors/HookDefaultInspector.tsxlocaleprop, through its existingtrengine.inspector.hook.*(27)inspectors/ActionDefaultInspector.tsxlocaleprop:trin the body, and alocaleprop intoObjectPickerandParamOptionsEditorengine.inspector.action.*(125)engine.inspector.reorder.up/.down(the per-input move buttons)inspectors/InspectorComboField.tsxuseMetadataLocale(), asInspectorSelectField's default flag already doesengine.inspector.combo.*(4): search, noMatch, loading, useCustomengine.form.selectEllipsis(theplaceholderdefault)inspectors/_shared.tsxuseMetadataLocale()engine.close(InspectorShell),engine.inspector.reorder.up/.down(InspectorReorderButtons),engine.form.optionsLoadFailedTitle(InspectorSelectField's roster-failure notice)metadata-admin/i18n.tsENGINE_STRINGS_ENandENGINE_STRINGS_ZH;pnpm check:i18n-driftreads "0 en value(s) changed (156 key(s) added, 0 removed)"KeyedOptionpluslocalizeOptions, the PR 1 shape) and resolved at render, so stored values do not move.PARAM_TYPE_OPTSkeeps itssatisfiescheck againstResolvableParamFieldType, and the objectui#6538 pin reads only its.value.LOCATION_LABELSstays a totalRecordoverActionLocation, whose values are now keys.{token}slots, filled with a file-local split-and-interleave (theResourceEditPageshape).closeLabel,upLabel/downLabel,rosterFailureLabel,placeholder,searchPlaceholderoremptyTextstill wins. Each default isprop ?? t(KEY, locale).InspectorReorderButtonsreads its locale before its early return, so the hook order does not depend on props.status,done,100,object.viewKey, the API path), thescripttype name, the move arrows and the#1counters.engine.fieldType.*names, anddesigner.field.*(显示名 / 占位符 / 必填).Premise check: the dispatch's mechanism hypotheses, measured
785d3a7). Thet()/tr()counts reproduce: 8 inHookDefaultInspectorand 5 inActionDefaultInspector. The literal counts depend on how the regex is spelled. A loose spelling reads 22 and 66, and a strict one (a capital then a lower-case letter) reads 18 and 54. Neither reproduces the 15 and 47 in the dispatch. Reading both files end to end gives the full set, which is what the pin lists: 27 hook strings and 121 action strings over the fixtures. They include option labels,aria-label/placeholdervalues and composed sentences the regex cannot see.useMetadataLocale()._shared.tsxalready read it for the objectui#9652 flag, andInspectorComboFieldnow imports it. Reach under zh today, over every in-tree call site, read with a tag scanner that skips comments and cross-checked against a plain grep count:InspectorComboFieldemptyTextInspectorComboFieldUsecustom rowallowCustom={false})InspectorComboFieldloading triggerloadingInspectorComboFieldsearchPlaceholderAppNavInspector: the filter-row field picker, the object, view and typed-target pickers)InspectorComboFieldplaceholder(Select…)AppNavInspector: the object, view and typed-target pickers)InspectorReorderButtonsup / downObjectFieldInspector's header)InspectorShellclose labelcloseLabel, and the other 2 hide the buttonInspectorSelectFieldroster-failure noticeroster=site)rosterFailureLabelInspectorShell,InspectorSelectFieldandInspectorComboFieldare not exported from the package'sexports, so these are the only callers. Theplaceholderdefault is outside the claim's enumerated list. It is included under the bounded-fix rule: the same defect class, in the same function signature of a file on the claim, mechanical, and held by the same gates. It is named here as a deviation.hook/action/combokeys in each, the 3 older ones included).pnpm check:i18n-designer-parityexits 0.origin/main02e6d36without conflicts. The two PRs'i18n.tsrows sit in separate hunks.en byte-identical: one-off measurement, not a committed test
A throwaway harness was built from the pin by disabling its
describeblocks and adding one dump case. It rendered every pin fixture under en-US and wrotedocument.body.innerHTMLafter each state. That covers the 2 hook fixtures, the 9 action fixtures, the combo host in flight and answered (plus its two intermediate popover states), the reorder host, the two primitives, and a caller-label case: 19 states in all. It ran once on the fix (0a024c1) and once with the five source files checked out from785d3a7. Both dumps were 312084 bytes with sha2560049a6056c57d289d9a42199cedf93fe9589fd2793c4fbf706471d044e3c30c9, andcmpexited 0. The dump contains the branches it claims to cover (for example the capability-gate sentence twice, the pinned-to-script note twice, and the custom row once). The harness was deleted and never committed. Restore was proven withgit diff HEADat 0 lines and each path'sgit hash-objectequal to its HEAD blob.Pin: red on base, green on head
inspectors/inspectorStrings.hookAction.i18n-10586.test.tsxhas 11 cases:AppNavInspector) and the other shared defaults (the reorder pair throughObjectFieldInspector; the close label and the roster notice read off their primitives, which no host reaches): a zh sweep with exact membership over element text, text nodes,aria-label,titleandplaceholder, then named zh samples read back from the catalogue behind a not-the-key / not-the-en-row guard; and an en case in which every pre-fix string still renders, word for word;ObjectDefaultInspector(thelocaleprop channel) andInspectorSelectField's default flag (theuseMetadataLocale()channel).Measurements:
785d3a7, and the pin from0a024c1. ResultTests 4 failed | 7 passed (11), exit 1. The four zh sweeps list the English still rendered: hook 27 of 27, action 121 of 121, combo 5 of 5, shared 4 of 4. The 7 passes are the four en cases, the caller-label case and the two lit controls.i18n.tsfrom head and the four components from785d3a7. ResultTests 4 failed | 7 passed (11), exit 1, with the same four lists. The catalogue rows alone change nothing on screen.Tests 11 passed (11). At7c35ba6, this pin and PR 1's together readTests 21 passed (21), exit 0.git checkout HEAD --on the mutated paths, thengit diff HEAD0 lines and eachgit hash-objectequal to its HEAD blob.Gates
All at
7c35ba6(after the merge of02e6d36), heavy runs throughos-verify-lock:pnpm exec vitest run packages/app-shell/src/views/metadata-admin/, as 4 path-split runs (inspectors/;previews/+external/+__tests__/; the top-level files in two halves)studio-designtests, 2data-objectstack, 3packages/i18n, and thecheck-i18n-call-site-keys,check-i18n-dead-keysandvite-dts-explicit-extensionsscript testspnpm turbo run type-check --filter @object-ui/app-shell --concurrency=2app-shell:type-checkwas a cache miss, so bothtscprojects ran. The previous run atfca6999was red (TS2322 in the new pin's two primitive fixtures), which shows the pin is in a compiled project;7c35ba6fixes it--format json: 6 files, 0 errors, 7 warnings. The per-file counts equal base: 0 each, except the 7react-refresh/only-export-componentswarnings that_shared.tsxalready had. The new pin has 0check:i18n-designer-parity,check:i18n-keys,check:i18n-drift,check:i18n-dead-keys(0 of the new keys reported),check:control-bytes,check:test-path-roots,check:vi-mock-specifiers,check:vi-mock-inherit,check:vi-mock-override-shape,check:new-line-citations(0 new),check:changeset-claims,check:pending-changeset-literals,check-changeset-presence(6 source files of 1 released package, 1 changeset),check-changeset-no-majorcheck:spec-symbols,check:action-forward-parity,check:phantom-deps.ts/.tsxfiles, which the config's**/*.{ts,tsx}block covers, and the JSON output counts 6 files.eslint.config.jsconfigures no type-aware linting (a grep forprojectServiceor aparserOptionsproject exits 1), so this diff cannot move an untouched file's verdict.check:changeset-claimsreports 4 pending bodies that name a file this PR edits:6310-designer-formula-key-retired,6329-actionparam-one-authority,7125-dashboard-empty-state-keys-retiredand8632-malformed-picklist-option-loud. I read each paragraph, and all four still hold. The 6310 and 7125 paragraphs are about keys this PR does not touch. In 6329, "the eight offered spellings … are now checked against the vocabulary at compile time" still holds:PARAM_TYPE_OPTSkeeps itssatisfiescheck. 8632 restates the carve-out this PR follows.check:eager-locale-cataloguesand the eager-closure budget, which read a builtapps/consolebundle (performance-budget.ymlruns both); the repo-widepnpm lintand the fullpnpm testshards belong to CI.origin/mainmoved tod08ab2fafter the merge. Its three commits touchcomponents,core,fields,plugin-chartsandtypesonly, and no file of this PR. So the branch was not merged again; the merge queue rebuilds on currentmain.Round 2 (
b5f081d): mergedorigin/main7baede3(conflict-free; no file of this PR moved; the incoming commits carry the objectui#10645 test change, PR objectui#10677). Atb5f081d, throughos-verify-lock: both card pinsTests 21 passed (21), exit 0;check:i18n-designer-parityexit 0;pnpm turbo run type-check --filter @object-ui/app-shell30/30 tasks, exit 0 (app-shell cache miss, so it executed).Acceptance notes
localize()helper reads an authored{ en, … }label map as itsenentry first. That is author data being edited, not chrome, and it is outside this card.DatasetDefaultInspector(PR 1) andActionDefaultInspector(this PR) each carry a file-local copy of the same slot helper,withSlots. A shared export from_shared.tsxwould add an eighthreact-refresh/only-export-componentswarning there, so neither PR moved it.SchemaFormrender inside these inspectors with their own strings. They are outside this card.Session:
https://claude.ai/code/session_01KUxVUa7e39aNjhkKi1gsoyGenerated by Claude Code