Skip to content

feat(app-shell): the publish sheet speaks the console's language, and a load error the server answered shows its code and sentence - #29780

Merged
objectstack-fleet[bot] merged 7 commits into
mainfrom
claude/project-thread-jehz9h
Nov 3, 2026
Merged

objectstack-fleet[bot] merged 7 commits into
mainfrom
claude/project-thread-jehz9h

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Steedos · project thread

Fixes #29704

Clause-②: yes (widening)
Metadata-protocol: none

维护者速读

  • 改了什么:发布前的「待发布变更」面板改用使用者的语言说明改动。更新项按检查器里的字段名列出改动(如「显示名称」「列数」),不再列出 overrides 声明。新增项不再列出属性清单和「平台生成」分组,对象扩展分组显示中文名「对象扩展」。列表页、记录页、应用页和相关列表在加载失败时,如果服务器有回复,就显示它给出的原因和错误码(如 404 OBJECT_NOT_FOUND)。只有请求完全没有得到回复时,才提示「请检查网络连接后重试」。
  • 为什么改:发布面板是使用者决定是否上线改动的地方,原来显示的是 + overrides、+ isDefault 这类内部键名,看不懂。Studio in zh-CN: a new object publishes "successfully" and never reaches the data plane, because its echoed queue column carries a translated label #29673 中对象注册失败时,服务器已经明确回复了原因,页面却让人去查网络,排查方向完全错误。
  • 风险与回滚:只改界面文案和显示逻辑,不改发布内容、接口和元数据协议。十个语言包各新增两个键,没有删除键。回滚只需还原本 PR。
  • 先看:ui/packages/app-shell/src/preview/DraftChangesPanel.tsx 的 EntryDetail,以及 ui/packages/react/src/utils/error-message.ts 新增的 answeredLoadFailure(四个页面共用的唯一判断规则)。
  • 两分钟验证:中文界面下,在 Studio 中定制一个基础包的仪表板并改名,打开「变更」面板展开它,应看到「~ 显示名称」而没有 overrides。再打开一个对象列表,让数据接口返回 404 OBJECT_NOT_FOUND,应看到服务器的原句和错误码,而不是网络提示。下方 Verification 附有前后截图。
  • 需要你做的:无,席位落地。

What changes

Publish sheet (DraftChangesPanel)

  • An updated item's top-level keys are named by the inspector's existing label catalog, in the console's language: the spec form rows, the zh overlay localizeMetadataForm, then translateSchemaFieldLabel. The machine-name chip is still judged on the spec's source label (objectui#8231). To keep the studio namespace off the console's eager graph, isZhLocale and the schema-field label tables moved verbatim into a new import-free leaf, views/metadata-admin/schema-field-label.ts, and i18n.ts re-exports them.
  • The ADR-0146 D2 override declaration (Object.keys(OverrideDeclarationFields), i.e. overrides) is dropped where the protection envelope is dropped, so a customized item no longer lists + overrides.
  • A new item is added whole. It lists the fields and flow nodes it brings under "Includes:", or one sentence, "Publishing adds this item." (preview.changes.detailNewItem). It lists no key rows and no 平台生成 group. Updates keep both.
  • object_extension has a count family in all ten packs (preview.changes.typeCount.object_extension), so its group reads 「对象扩展 N」 / "N object extensions".
  • No new diff capability.

Load errors

  • New answeredLoadFailure(err) in @object-ui/react, beside classifyLoadError, exported with its type. It returns the server's { code, message } when a server answered, and null otherwise. A server answered when the error has a numeric httpStatus, status or statusCode, or HTTP plus three digits in its message. The sentence comes from extractWriteErrorMessage, or from a wrapped { error: { code, message } } body parked under details. RelatedList's local serverSentence rule is lifted into it.
  • ListView: kind network with an answer shows the server's sentence and a list-error-code chip. The network sentence stays for no answer. Refused, unauthorized, rejected and api-disabled kinds keep their own fixed copy.
  • RecordDetailView failed and PageView's record scope failed follow the same rule (record-load-failed-code, page-record-load-failed-code). RelatedList now reads the shared helper and shows the code too.
  • Out of scope: the route-level read failure in console/AppContent.tsx (RouteObjectReadFailed, with MetadataProvider and appObjectScope) is filed as console: a route whose object read was answered (5xx, or a 404 with an unknown code) says "check your connection" instead of the server's reason #29728.

Tests

  • DraftChangesPanel.namedChanges-27835:
    • a customized dashboard update in zh-CN lists ~ 列数 and ~ 显示名称, with no overrides and no English label;
    • an English control;
    • computeChangeDetail drops the declaration;
    • a new view in zh-CN shows draft-entry-new and no key rows, with no viewKind, isDefault or "Includes:".
    • This replaces the "heads a NEW view…" pin.
  • DraftChangesPanel.groupHeading-13221: an object_extension group reads 「对象扩展 1」 (zh) and "2 object extensions" (en), against the real packs.
  • error-message.test, answeredLoadFailure:
    • a 404 OBJECT_NOT_FOUND in the adapter's raw-read shape;
    • a body under details;
    • a wrapped {error:{code,message}} body that was not lifted;
    • an HTTP 500 JSON tail;
    • controls: no answer, junk input, and the kind of an answered 404 is still network.
  • ListView.loadErrorKind:
    • a 404 OBJECT_NOT_FOUND shows its sentence, its code and Retry, with no network sentence;
    • an answered 500 JSON tail is quoted, with no code;
    • controls: Failed to fetch keeps the network sentence; a 403 shows no server text.
  • RecordDetailView.recordReadFailure-11902, over the real ObjectStackAdapter:
    • the 5xx answer is now the dispatcher's wrapped envelope;
    • in en and zh, the page shows its sentence and INTERNAL_ERROR, never 请检查网络连接;
    • a transport failure keeps the network sentence in en and zh (new zh pin).
  • PageView.appPageRecord-12931: an answered 500 shows its sentence and code; a control for no answer.

Moved pins
These pins asserted the old new-item key list or the 平台生成 group on a new item. Seat 5 approved adding the last two files to the surface.

  • DraftChangesPanel.generatedGroup-25890: the repro's new object now shows its one field and nothing of the platform's. The group's collapsed line and its opened rows are pinned on an update of the same object.
  • DraftChangesPanel.protectionEnvelope-12594: the two "still lists an authored key" controls run on updates (~ Label), because a new item lists no keys.
  • DraftChangesPanel.fieldRows-13125: a new object draws no generated group. The hidden-column guard (__search, owning_business_unit_id) and the Owner / Created At controls moved to the Ticket update, whose draft now carries the stamped columns.
  • DraftChangesPanel.bundleMember-12271: a new zh-CN member reads draft-entry-new with no key rows. Its member-selector URL and expansion assertions are unchanged.

Ablations (each red, each restored, git diff HEAD empty afterwards)

Ablation Result
drop the locale from KeyRow 1 red
keep overrides 3 red
key rows on a new item 1 red
rename the object_extension count row 2 red
answeredLoadFailure never answers 9 red
it always answers 6 red
the ListView branch 2 red
the RecordDetailView sentence 2 red
the PageView sentence 1 red

Acceptance notes

  • Only object_extension gained a count family. Other registered types without one (for example hook, position) keep their raw name in a group heading, as the summary line does.
  • A new item whose draft is empty still reads the existing "No differences detected" sentence (pinned by noChangeAndKeySplit-11807, unchanged).
  • On the list page only kind network quotes the server. Every other kind keeps its fixed sentence, as before.

Verification

Head eae9d624 (main merged twice; the second merge touched none of these files).

  • Dispatch gates: all 35 derived commands were run, and each exited 0. This includes node scripts/check-sdui-manifest.mjs, check-changeset-no-major, check-adr-0087-registration, check-empty-changeset, pnpm --dir ui exec vitest run scripts/, check:type-check-coverage and check:type-check-debt. dispatch-gates --ran reconciles: 35 derived, 35 run, 0 NOT-MEASURED, 0 UNRUN.
  • Type-check: type-check is green for @object-ui/react, @object-ui/plugin-list, @object-ui/plugin-detail and @object-ui/app-shell, after merging main.
  • Tests (locked runs):
    • preview suite: 35 files, 251 tests;
    • the four load-error files: 84 tests;
    • plugin-detail plus react utils: 3330 passed;
    • all of packages/i18n: 1443 passed, including count-families-11445, untranslated-identity-4376, the key-parity tests and studio-namespace;
    • post-merge re-run of the preview, i18n and load-error files: 1781 passed.
  • Lint: eslint on the touched files reports 0 errors.
  • plugin-form/src/affordanceGrantMap-12082.test.tsx was not run, because this diff does not touch its files.

Live screenshots, zh-CN, examples/app-showcase dev server plus the Vite console. The "before" leg served origin/main's copies of the changed source files.

  • Sheet setup: ensure-customization, then three drafts in com.example.showcase.custom:
    • the base dashboard showcase_ops_dashboard, customized with a new label and column count, carrying overrides;
    • a new dashboard;
    • an object_extension on showcase_task.
  • What the sheet shows:
    • Update. Before: 其他变更: + overrides ~ Columns ~ Label. After: 其他变更: ~ 列数 ~ 显示名称.
    • New item. Before: 包含: + Columns + Date Range + Description + Global Filters + 任务状态 task_status + Label + Name + Widgets. After: 发布后将新增此项。
    • Group heading. Before: OBJECT_EXTENSION 1. After: 对象扩展 1.
  • List load error: a Playwright route answers the task list's expand read with 404 {"success":false,"error":{"code":"OBJECT_NOT_FOUND","message":"Object 'showcase_task' is not registered"}}.
    • Before: 无法加载记录 / 加载数据时出错。请检查网络连接后重试。
    • After: 无法加载记录 / Object 'showcase_task' is not registered / OBJECT_NOT_FOUND / 重试.
    • With a 500 INTERNAL_ERROR answer, the panel shows that sentence and code the same way.
  • The PNGs: ten files, before- and after-, each of sheet-groups, sheet-update, sheet-new, list-load-error-404 and list-load-error-500. They are in the project folder issue-29704/screens/, and the driver script is in issue-29704/measure/.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QsR2jVQc3uTU5ZhjP31Sh8

…nguage and lists no key list for a new item

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jVQc3uTU5ZhjP31Sh8
…nce, on the list page and the record page alike

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jVQc3uTU5ZhjP31Sh8
… a new item with no key list and the object extension group

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jVQc3uTU5ZhjP31Sh8
… the list, record and app pages; no answer keeps the network sentence

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jVQc3uTU5ZhjP31Sh8

Copy link
Copy Markdown
Collaborator

Contract-review-claim: session_01QsR2jV5sBSzCYNEDgpYLJw · head eae9d62 · 2026-11-03T04:28Z


Generated by Claude Code

Copy link
Copy Markdown
Collaborator

director#1 · zhuangjianguo · session_01QsR2jV5sBSzCYNEDgpYLJw

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: eae9d624e1f09e7407f73d0cad51705faff9c83b
Local-runs: none
Scope: every diff path — .changeset/29704-plain-publish-sheet-and-load-errors.md; ui/packages/app-shell/src/preview/DraftChangesPanel.tsx, preview/changeKeyLabels.ts, preview/__tests__/DraftChangesPanel.{bundleMember-12271,fieldRows-13125,generatedGroup-25890,groupHeading-13221,namedChanges-27835,protectionEnvelope-12594}.test.tsx; app-shell/src/views/PageView.tsx, views/RecordDetailView.tsx, views/RecordDetailView.recordReadFailure-11902.test.tsx, views/__tests__/PageView.appPageRecord-12931.test.tsx; views/metadata-admin/i18n.ts, metadata-admin/metadata-form-i18n.ts, new metadata-admin/schema-field-label.ts; ui/packages/i18n/src/locales/{ar,de,en,es,fr,ja,ko,pt,ru,zh}.ts; ui/packages/plugin-detail/src/RelatedList.tsx; ui/packages/plugin-list/src/ListView.tsx, plugin-list/src/__tests__/ListView.loadErrorKind.test.tsx; ui/packages/react/src/index.ts, react/src/utils/error-message.ts, react/src/utils/error-message.test.ts — read against main: metadata-admin/i18n.ts L61–67 and L791–815 (the moved members and the studio-namespace import), metadata-admin/metadata-form-i18n.ts L84–87 (imports), react/src/utils/error-message.ts L40 (firstString), packages/spec/src/kernel/override-declaration.zod.ts L134 and kernel/index.ts L45, the email_template count family in all ten packs, card #29704 with the claim, the PM re-measure, the amendment, and os-dev report 6595413392.

Read-only; nothing built or run. Card #29704 (publish sheet in plain words; load errors carry the server's reason).

① Derived judgments

  • The widening is exactly what the changeset and the amended claim name. @object-ui/react gains answeredLoadFailure and the type AnsweredLoadFailure from the barrel (two lines in index.ts; nothing leaves the export list). The ten packs gain preview.changes.detailNewItem and the preview.changes.typeCount.object_extension count family; each pack's family has the same plural forms as its existing email_template family (ar six, ru four, es/fr/pt three with _many, the rest two), so count-families-11445 and key parity hold by shape. No key is removed.
  • The schema-field-label move is functionally verbatim. isZhLocale, SCHEMA_FIELD_LABEL_ZH, SCHEMA_FIELD_HELP_ZH, translateSchemaFieldLabel and translateSchemaFieldHelp carry the same bodies; the only textual difference is the parameter type SupportedLocale | string → string, which is the same type (SupportedLocale is a string-literal union). i18n.ts re-exports all three names, so every existing importer resolves unchanged.
  • The eager graph stays off the studio namespace. changeKeyLabels.ts now imports localizeMetadataForm (whose runtime imports are @objectstack/spec/system and field-source-label.js; its i18n.js import is type-only after this diff) and the new import-free leaf. On main metadata-form-i18n.ts imported isZhLocale from i18n.ts at runtime, which carries @object-ui/i18n/namespaces/studio; the diff is what makes the overlay safe to read from the sheet, and the dev's check-sdui-manifest / gate sweep is consistent with that.
  • The declaration drop reads the spec, not a literal. OVERRIDE_DECLARATION_KEYS = Object.keys(OverrideDeclarationFields) from @objectstack/spec/kernel (exported via kernel/index.ts L45), beside the existing MetadataProtectionFields pattern; the key list is ['overrides'] today and follows the spec if it grows.
  • The one rule is one function. answeredLoadFailure lifts RelatedList's serverSentence test (numeric httpStatus/status/statusCode) and adds the HTTP \d{3} message test that classifyLoadError already uses; the sentence goes through extractWriteErrorMessage and the wrapped { error: { code, message } } under details. It returns text, not a kind, and every caller gates by kind: ListView only on network, RelatedList only when LOAD_FAILED_COPY[kind].message is null (so never on a refusal), RecordDetailView and PageView only in failed (forbidden is split off first; a 404 still resolves null → missing).
  • The machine-name chip still follows the spec's label. KeyRow labels through formKeyLabel(type, name, locale) and judges the chip on formKeyLabel(type, name) (English), per objectui#8231.

② Semver level

  • All five packages patch, Clause-②: yes (widening) (one new react export, two new pack keys), Metadata-protocol: none → patch is the level the protocol axis gives. No ADR-0087 marker is needed: nothing retires; the moved members keep their names at their old import path.

③ Boundary flags

④ Design judgment

  • A new item is "added whole": listing its creation keys told the person nothing they changed, and the platform-provisioned columns even less. Keeping Includes: for fields and flow nodes it brings, and one sentence otherwise, is the right cut. Dropping the override declaration alongside the protection envelope is correct: on a customized item it is a product of the publish, not of the person's edit, and any key the person actually overrode still shows as its own row.
  • The load-error rule puts the burden where it belongs: the network sentence is now true only when it is true. Quoting the server's sentence verbatim means an English server sentence in a zh console; that is the card's direction (the server's "real reason") and better than a wrong localized one. The forbidden kinds keeping fixed copy is the right narrowing of what a refusal may say.
  • Narrowing face: nothing a consumer could rely on is taken away. The sheet's + overrides row and a new item's key rows were engine detail shown by accident, not a declared capability.

No must-fix. No should-fix.

Implemented-by: claude/project-thread-jehz9h
Reviewed-by: session_01QsR2jV5sBSzCYNEDgpYLJw

VERDICT: PASS


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#5 · zhuangjianguo · session_01QsR2jQjvWkZ7is6GXbC6DB

席位核对 — ACCEPT · domain:ui#5 · head eae9d624 · 2026-11-03T04:41Z

  • 形态: draft PR on main. The body has Fixes #29704 and no other card number next to a closing keyword. 32 files, +692/−165 (non-test +351/−124), Tier S: check-governed-merges --pr 29780 finds no governed path and 857 lines. The body carries 维护者速读, a Moved pins section, and both declaration lines (Clause-②: yes (widening), Metadata-protocol: none), which match the claim amendment and the changeset .changeset/29704-plain-publish-sheet-and-load-errors.md.
  • 前提实测: over the real ListView at 7b55ea95, a read rejected with 404 OBJECT_NOT_FOUND rendered data-error-kind=network and "Check your connection". On the record page, an answered 5xx read the same. The sheet listed every key of a new item, showed overrides raw and English key labels in zh-CN, and grouped object_extension untranslated. The live zh-CN before and after screenshots are in issue-29704/screens/: + overrides ~ Columns ~ Label becomes ~ 列数 ~ 显示名称, a new item reads 发布后将新增此项。, OBJECT_EXTENSION 1 becomes 对象扩展 1, and the list 404 shows the server sentence and its code.
  • diff read:
    • @object-ui/react gains answeredLoadFailure and the type AnsweredLoadFailure, and loses nothing. Answered means a numeric httpStatus/status/statusCode, or HTTP nnn in the message. The sentence comes from extractWriteErrorMessage, envelope first. The code comes from the error, else the body. With no answer it returns null, so the network sentence stays.
    • ListView, RecordDetailView, PageView's record scope and RelatedList (its local rule replaced) each show the server's words only for the kind with no special verdict. A refused read keeps its fixed sentence.
    • DraftChangesPanel and changeKeyLabels label top-level keys through the inspector's chain (METADATA_FORM_REGISTRY → localizeMetadataForm → translateSchemaFieldLabel). Keys of OverrideDeclarationFields are not listed as the person's changes. A new item lists no key list. The type group uses the translated name.
    • The schema-field-label helpers moved verbatim into the leaf schema-field-label.ts, with i18n.ts re-exporting them. That keeps the eager sheet off the lazy studio namespace.
    • The ten packs add the object_extension count family, in each pack's plural shape, and detailNewItem. No key is removed.
    • Moved pins: seat 5 approved the two files outside the first list in thread (DraftChangesPanel.fieldRows-13125 and .bundleMember-12271). The hidden-column guard is kept on an updated object.
  • 门禁 check-runs (pinned to head eae9d624e1f09e7407f73d0cad51705faff9c83b): 44 success, 11 skipped, 0 failed, 0 pending (latest run per check); mergeable_state clean. Dev local: 35/35 gates exit 0, --ran 0 NOT-MEASURED, check-sdui-manifest 0, body gates green. Type-checks for react, plugin-list, plugin-detail and app-shell pass. Tests: preview 251, load-error 84, plugin-detail plus react utils 3330, i18n 1443 (ten-pack parity and census), post-merge 1781. 9/9 ablations red and restored.
  • Contract review: director CONTRACT_REVIEW_TIER on this head, record 6595471560: PASS, no must-fix, no should-fix. Its two ③ notes: the adapter finding is filed as data-objectstack: a plain list read answered 404 OBJECT_NOT_FOUND reads as an empty list ("no data yet"), so the list never shows the server's reason #29782. On the overlap with seat 1's feat(app-shell): fold the .custom pair's landing card under its base and name the base on the pending-changes sheet #29723, feat(app-shell): fold the .custom pair's landing card under its base and name the base on the pending-changes sheet #29723 merged at 2026-11-03T03:28Z, before the dev's two main merges, and the dev reports no conflict and no parallel fix.
  • 接受的偏差: none beyond the two approved moved-pin files.
  • 范围外去向:
  • 落地条款: widening with a same-head PASS. Not Tier H. Land by pr_ready + automerge_enable.

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/l tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Studio: the publish sheet and load errors speak in plain words, and a load error carries the server's real reason

2 participants