Skip to content

fix(studio): a seeded record page heads its More details section with the translated heading - #33575

Merged
objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-nmwo68
Nov 15, 2026
Merged

objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-nmwo68

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Leehom · project thread

domain:ui#1 · os-project-manager · session_01FEkQ5p26Duousy4rdtkRMB

Fixes #33471

Clause-②: no
Metadata-protocol: none

Seat domain:ui#1 · card thread session_01FEkQ5p26Duousy4rdtkRMB · claim 6886592905

维护者速读

  • 改了什么:Studio 给没有字段分组的对象新建完整记录页(或把默认页「转为完整页面」)时,「More details / 更多详情」分区的标题不再写成英文原文,而是写成每种内置语言各一条的多语言写法(取自语言包 detail.sectionMoreDetails),保存后的页面按查看者的语言显示。对象自己语言包里的 _sections.details.label 仍然优先。
  • 为什么改:运行中的记录页会翻译这个标题,但 Studio 生成的页面把它存成英文字符串,非英文用户打开保存过的页面看到的是 "More details"。fix(studio): a seeded grouped record page heads its ungrouped fields with the translated Other heading #33470 已为「其他」分区用了同一写法。
  • 风险与回滚:只改 Studio 生成页面的方式,不改 spec、不改运行中的记录页、不迁移已保存的页面(它们仍显示英文,对象语言包的覆盖照样生效)。回滚即还原本 PR。
  • 先看:ui/packages/app-shell/src/views/recordDetailSections.ts 的 loadPersistedSectionLabels;metadata-admin/previews/PagePreview.tsx 的 convertToFull;metadata-admin/anchors.ts 的 record 页 createSeed。
  • 两分钟验证:pnpm --dir ui exec vitest run packages/app-shell/src/views/recordDetailSections.studioMoreDetailsHeading-33471.test.tsx,预期 5 条全绿(中文显示「更多详情」,英文显示 "More details",对象语言包的标题优先)。
  • 需要你做的:无,席位落地。

What changes

Measured first, on origin/main (8e63ed87). Studio's create seed (metadata-admin/anchors.ts, record page kind: 'full') and PagePreview.tsx convertToFull passed MORE_DETAILS_DEFAULT_LABEL as the details section's label, so the saved section was { name: 'details', label: 'More details', … }. The red-first run below draws that saved seed through the real RecordDetailsRenderer under zh-CN: 「更多详情」 is not on the page (the English text is), while en and an object bundle carrying _sections.details.label read correctly. It reproduces.

How record:details resolves the heading (the measurement the order asked for). In plugin-detail record-details.tsx, a section's label is first resolved for the viewer with pickLocalized(s.label, language), and when the section has a name, that text is passed as the FALLBACK to sectionLabel(objectName, s.name, rawTitle ?? s.name), which answers objects.OBJECT._sections.NAME.label when the bundle has it (useObjectLabel sectionLabel → resolve(objectSuffixes(…), fallback)). So an inline locale map never shadows the per-object override: the override wins over the map exactly as it wins over a string. Leaving label unset would not help either: the fallback then becomes the literal section name details. ⇒ the form #33470 chose for the ungrouped bucket fits here too, and this PR uses it. The CONTROL pin below draws the override winning over the map.

The change.

  • recordDetailSections.ts: loadPersistedUngroupedHeading becomes loadPersistedSectionLabels(objectDef), which answers both headings the derivation writes itself, each as the inline locale map of its catalogue key over every catalogue @object-ui/i18n ships (BUILT_IN_LANGUAGE_CODES + loadBuiltInLocale): moreDetails from detail.sectionMoreDetails, ungrouped from common.ungroupedSection (unchanged). It loads the catalogues only when the page writes one of them (the object's fieldGroups apply, or the flat split yields a details section), and otherwise answers the English defaults, which no section reads. One catalogue that fails to load rejects the whole call (Promise.all), so no partial map is ever saved (the fix(studio): a seeded grouped record page heads its ungrouped fields with the translated Other heading #33470 rule). RecordDetailSectionLabels.moreDetails widens from string to SectionHeading (app-shell internal).
  • anchors.ts (create seed) and PagePreview.tsx (convertToFull) pass loadPersistedSectionLabels' answer. "Convert to full page" stays disabled until it has loaded for the current object, as before, and stays unavailable if a catalogue fails.
  • The running record page (RecordDetailView) and the slotted preview still pass the translated text; they are untouched.

What an existing page shows. No migration. A page saved before this change keeps label: 'More details' (a plain string): every viewer reads English, unless the object's bundle carries _sections.details.label, which still wins. An author can change the heading in the page designer, or re-create the page.

Why

The running record page translates the "More details" heading for every viewer; a page Studio seeded saved it as English, so the same page read differently once saved. #33470 settled the persisted form for the sibling "Other" heading; this applies it to the other heading the seed writes itself.

Tests

  • New: recordDetailSections.studioMoreDetailsHeading-33471.test.tsx (5 tests, the real RecordDetailsRenderer under I18nProvider, as fix(studio): a seeded grouped record page heads its ungrouped fields with the translated Other heading #33470's pins).
    • The seed for a flat object with a long-text field writes details.label as the map of every shipped catalogue's detail.sectionMoreDetails (keys = BUILT_IN_LANGUAGE_CODES, en "More details", zh-Hans 「更多详情」), never a string; firing control: the split yields [['name','subject'],['notes']].
    • The seeded sections parse under the spec's RecordDetailsProps.
    • Drawn under zh-CN: 「更多详情」, no "More details", above the notes value.
    • CONTROL, en: "More details".
    • CONTROL: an object bundle with _sections.details.label (「补充信息」) wins over the saved map.
  • New leg in PagePreview.slottedDefault-27054.test.tsx: "Convert to full page" on a flat object with a textarea writes the details section under the same map, and the converted page passes validateMetadataDraft('page', …) and the block props check.
  • Adjusted sibling pins (they asserted the English string this card removes):
    • recordDetailSections.studioUngroupedHeading-33377.test.tsx CONTROL: a flat object's primary section stays unheaded and only its details section carries a map; a page that writes neither heading answers the English defaults (it called the removed loadPersistedUngroupedHeading).
    • recordDetailSections.agreement-12442.test.ts: the flat seed equals the runtime split with the persisted headings, and details.label.en is "More details".
Red-first on origin/main sources (the three source files checked out at 8e63ed8, tests at head): 3 failed | 8 passed (11)
× the details section carries the locale map of every shipped catalogue 29ms
× zh-CN: the section is headed 更多详情, never the English text, above its field 87ms
× writes the details section under the locale map of every shipped catalogue 39ms
⎯⎯⎯⎯⎯⎯⎯ Failed Tests 3 ⎯⎯⎯⎯⎯⎯⎯
AssertionError: expected 'string' to be 'object' // Object.is equality
TestingLibraryElementError: Unable to find an element with the text: 更多详情.
AssertionError: expected 'string' to be 'object' // Object.is equality
Test Files  2 failed (2)
Tests  3 failed | 8 passed (11)
os-verify-lock: VERDICT command-exit 1 · held the lock 16s · waited 0s · ⚠ SHARED-BOX SECONDS — this lock excluded other LOCKED runs, NOT unlocked sibling work (`check:*` gates and the rest), so these
Ablation at head 8ade4c0: the map put back to the English string — 3 failed | 8 passed (11); restored, blob == HEAD
ablation-replace: anchor   "  return { moreDetails, ungrouped };"  x1 (before)
ablation-replace: replace  "  return { moreDetails: MORE_DETAILS_DEFAULT_LABEL, ungrouped };"  x0 -> x1
ablation-replace: ok mutation landed: anchor 1 -> 0, blob 01bc7b3d1fab -> 161be10235f8
× the details section carries the locale map of every shipped catalogue 69ms
× zh-CN: the section is headed 更多详情, never the English text, above its field 132ms
× writes the details section under the locale map of every shipped catalogue 39ms
⎯⎯⎯⎯⎯⎯⎯ Failed Tests 3 ⎯⎯⎯⎯⎯⎯⎯
Test Files  2 failed (2)
Tests  3 failed | 8 passed (11)
ablation-replace: ok restored: blob == HEAD (01bc7b3d1fab) and `git diff HEAD` is empty
Touched and sibling files at head 8ade4c0
8 touched/sibling files (the new pin, #33377, #12442, 27054, PagePreview, 27177, anchors.page-seed, 6190):
Test Files  8 passed (8)
Tests  54 passed (54)
os-verify-lock: VERDICT command-exit 0 · held the lock 42s · waited 0s · ⚠ SHARED-BOX SECONDS — this lock excluded other LOCKED runs, NOT unlocked sibling work (`check:*` gates and the rest), so these

Every app-shell test file importing recordDetailSections, metadata-admin/anchors or PagePreview (41 files):
Test Files  41 passed (41)
Tests  370 passed (370)
os-verify-lock: VERDICT command-exit 0 · held the lock 219s (3m39s) · waited 0s · ⚠ SHARED-BOX SECONDS — this lock excluded other LOCKED runs, NOT unlocked sibling work (`check:*` gates and the rest),

Acceptance notes

Verification

All local readings at head 8ade4c0d (the PR head).

  • pnpm --filter @object-ui/app-shell run type-check (both tsc --noEmit and tsc -p tsconfig.test.json), after pnpm --filter '@object-ui/app-shell^...' build: exit 0 (os-verify-lock: VERDICT command-exit 0 · held the lock 145s …).
  • pnpm check:new-line-citations (ui): VERDICT new-cross-file-line-citations: 0 new citation(s), enforcement report-only -> exit 0.
  • Control-byte / NBSP scan of the added lines: 0 hits.
  • Derived gate families (node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack), each exit code captured before any pipe; reconciliation ✓ dispatch-gates --ran: 36 derived famil(ies) accounted for — 36 run, 0 NOT-MEASURED (a DERIVED zero — all 36 recorded an exit code and none of them is 3).
36 derived families, all exit 0
node scripts/check-adr-0087-registration.mjs --base origin/main :: exit 0
node scripts/check-adr-0087-registration.mjs --self-test :: exit 0
node scripts/check-changeset-no-major.mjs --base origin/main :: exit 0
node scripts/check-closing-keyword-parity.mjs :: exit 0
node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0
node scripts/check-comment-mask-corpus.mjs :: exit 0
node scripts/check-empty-changeset.mjs --base origin/main :: exit 0
node scripts/check-empty-changeset.mjs --self-test :: exit 0
node scripts/check-sdui-manifest.mjs :: exit 0
node scripts/check-sdui-manifest.mjs --self-test :: exit 0
node scripts/ci/snapshot-next.mjs --self-test :: exit 0
node scripts/pm/release-rehearsal-clone.mjs --self-test :: exit 0
node scripts/release-pending-publish.mjs --self-test :: exit 0
pnpm --dir ui exec vitest run scripts/ :: exit 0
pnpm --filter @objectstack/spec run check:duration-unit-keys :: exit 0
pnpm check:changeset-gate-self-tests :: exit 0
pnpm check:closed-ceremony-text :: exit 0
pnpm check:cross-package-test-inputs :: exit 0
pnpm check:dispatcher-error-vocabulary :: exit 0
pnpm check:driver-memory-census :: exit 0
pnpm check:engine-double-contract :: exit 0
pnpm check:gitlink-declared :: exit 0
pnpm check:nul-bytes :: exit 0
pnpm check:published-files :: exit 0
pnpm check:query-options-erasure :: exit 0
pnpm check:refd-timer-probe :: exit 0
pnpm check:registry-log-declared :: exit 0
pnpm check:rest-log-spy-declared :: exit 0
pnpm check:skill-identifier-liveness :: exit 0
pnpm check:test-source-alias :: exit 0
pnpm check:tier-file-adoption :: exit 0
pnpm check:type-check-coverage :: exit 0
pnpm check:type-check-debt :: exit 0
pnpm check:undeclared-dep-imports :: exit 0
pnpm check:watch-hint-literal :: exit 0
pnpm check:where-matcher :: exit 0

Every family CI runs (the full Test UI shards, lint, the artifact roster) is read off this PR's check-runs; nothing there is re-run locally.

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic. (No packages/spec change.)
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint is CI's run.
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: n/a.
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English (the 维护者速读 block is the seat channel's Chinese).

Generated by Claude Code

… the translated heading

Studio's full-page seed and Convert to full page wrote the "More details"
section's label as the plain English string, so a saved page read English
for every viewer. They now write the inline locale map of
detail.sectionMoreDetails from every shipped catalogue, the I18nLabel form
record:details resolves per viewer; the section keeps its details name, so
the object's own _sections.details.label still wins.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5p26Duousy4rdtkRMB
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 15, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#1 · os-project-manager · session_01FEkQ5nWoa1Ze1QzjRTSYXD

席位核对

Verdict: ACCEPT · head 8ade4c0d · 2026-11-15T01:29Z

  1. Shape. Draft → main, Fixes #33471. 8 files, +357/−75:

    • ui/packages/app-shell/src/views/recordDetailSections.ts, metadata-admin/anchors.ts, metadata-admin/previews/PagePreview.tsx
    • the new recordDetailSections.studioMoreDetailsHeading-33471.test.tsx, a new describe in PagePreview.slottedDefault-27054.test.tsx, and two sibling pins (studioUngroupedHeading-33377, agreement-12442) adjusted because they asserted the English string
    • one root changeset (@object-ui/app-shell + @object-ui/console patch)

    All of it is on the claimed surface (6886592905).

  2. Premise. Measured red on origin/main by the dev (3 red). The seed and convertToFull persisted MORE_DETAILS_DEFAULT_LABEL as a plain English string.

    • The order's measurement, answered. record:details resolves the inline label with pickLocalized and hands it to sectionLabel as the fallback. So objects.OBJECT._sections.details.label still wins over an inline map, and the map form keeps the override working. That is the order's first arm.
    • The fix: loadPersistedSectionLabels returns both persisted headings as inline locale maps, detail.sectionMoreDetails and common.ungroupedSection from every shipped catalogue. The seed and "Convert to full page" pass that one value. A catalogue that fails to load rejects the whole call, and the convert action stays unavailable, as fix(studio): a seeded grouped record page heads its ungrouped fields with the translated Other heading #33470 set it.
    • Pins: zh-CN reads the translated heading; CONTROL en reads "More details"; CONTROL an object bundle's _sections.details.label still wins. Ablation: 3 red, restored.
  3. Contract record. Not owed (Clause-②: no, Metadata-protocol: none): app-shell is private, there is no spec edit, and the written value is one sections[].label already accepts.

  4. Gates on head 8ade4c0d.

    • All 51 check runs are success or skipped, including Test UI shards + aggregate, Type Check UI, Lint UI, Build & E2E UI, Live E2E UI, Lint & Repo Gates, TypeScript Type Check, Check Changeset and PR-body guards.
    • The dev's local --ran is 36/36, reconciled. The app-shell type-check is green, and 41 sibling files passed 370/370.
  5. Accepted trade-off (as on fix(studio): a seeded grouped record page heads its ungrouped fields with the translated Other heading #33470). The map is a snapshot at save time. Pages saved before this change keep their English heading and are not migrated.

  6. K. 13 first-parent commits since base 8e63ed87 < 15, so no base sync.

  7. Out of scope. None.

  8. Authority. Landing under the maintainer's standing authorisation 「按照 pm-dispatch 规则复核过的都授权」 (2026-10-25T11:35Z).

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#1 · os-project-manager · session_01FEkQ5nWoa1Ze1QzjRTSYXD

Landing · head 8ade4c0d (the ACCEPTed head; K = 13, no sync) · 2026-11-15T01:30Z

reading value
check runs on 8ade4c0d 51, all success or skipped
contract record not owed (Clause-② no)

State: ready + auto-merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

1 participant