Skip to content

fix(console): a metadata create form says so next to Name when the label cannot fill it - #28366

Merged
objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/project-thread-66arln
Oct 31, 2026
Merged

objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/project-thread-66arln

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Tesla · project thread

Fixes #28232
Refs #28180

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:新建元数据(权限集、视图、流程、页面、动作、钩子、仪表板、文档)时,如果显示名称里没有拉丁字母或数字(例如全中文、全日文),API 名称框下会多一行提示「无法从此显示名称生成名称,请手动输入(snake_case)」;英文界面是 "This label can't be turned into a name; type one in snake_case."。用户填了名称,这行提示就消失。
  • 为什么改:Console 只用显示名称里的拉丁字母和数字自动生成名称;中文或日文名称生成的是空值,名称框空着且必填,旁边却没有任何话说明原因(Metadata create form: say "type a name" next to Name when the label cannot fill it #28232,从 spec(permissionForm): the name help says it is derived from the label, but a Chinese or Japanese label derives an empty name and nothing prompts #28180 拆出的可选半边)。
  • 风险与回滚:只加一行提示文字;名称怎么生成、保存怎么校验、服务端都不变。回滚即 revert 本 PR。
  • 先看:ui/packages/app-shell/src/views/metadata-admin/createDerive.ts(underivableTargets:什么时候算「生成不了」);ui/packages/app-shell/src/views/metadata-admin/SchemaForm.tsx(新可选属性 fieldNotes,画在字段说明下面);ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.tsx(把提示交给两处 SchemaForm)。
  • 两分钟验证:pnpm --dir ui exec vitest run packages/app-shell/src/views/metadata-admin/ResourceEditPage.underivableName-28232.test.tsx,预期 2 个用例全绿;或在中文界面的 Console 新建权限集,显示名称填「销售运营」,名称下出现这行橙色提示,填入名称后消失。
  • 需要你做的:无,席位落地。

What changes

When the line shows (underivableTargets in createDerive.ts): for each createDerive rule whose transform is slugify, the target is listed when the source holds non-blank text, slugify of that text is empty, and the target is empty. A typed Name drops it at once; clearing Name again brings it back while the label still gives nothing. slugify itself is unchanged (no transliteration). useCreateDerive returns the list as underivable (empty when derivation is suspended, i.e. outside create mode).

Where it shows. SchemaForm gains an optional fieldNotes prop: one host-supplied line per top-level field, drawn under the field's help text in both the flat and the sectioned layouts (and on boolean rows), never deferred like an issue. ResourceEditPage maps underivable to the translated line and passes it to both of its SchemaForm call sites: the create form, and the designer's inspector fallback (the doc type's create page). The hunks sit in the useCreateDerive block and on the two SchemaForm prop lists, away from what #28296 moved; main with #28296 is merged in.

Copy. New key engine.create.nameNotDerived in the studio namespace: en "This label can't be turned into a name; type one in snake_case.", zh "无法从此显示名称生成名称,请手动输入(snake_case)。" (the form's zh label for label is 显示名称). The namespace ships en and zh only; the other eight locales fall back to English there, as for every Studio string.

Rider from the #28229 review (help length at colSpan: 1): measured on the live Console (backend --fresh + the Console dev server from this branch, Chromium, permission-set create form) in en and zh-CN at 1280 px and 820 px wide. The help wraps onto a second or third line (white-space: normal, overflow: visible, scrollWidth == clientWidth on the help element) and is never truncated, so nothing changes there. Screenshots: en0.png, en1.png, zh1.png, en-820.png, zh-820.png in the project folder ui-seat-1/r2026-10-30/out/28232/.

Tests

New: ui/packages/app-shell/src/views/metadata-admin/ResourceEditPage.underivableName-28232.test.tsx (2), the real page with the live registrations (registerBuiltinAnchors) and the real served permission form from METADATA_FORM_REGISTRY:

  • (a) an all-Chinese label: exactly one line, in the Name row (not the Label row), Name empty; typing a Name removes it; clearing Name brings it back;
  • (b) CONTROL: a label with Latin letters fills Name (Sales 运营 → sales) with no line; a pristine form and a cleared label show none.

Ablation (through scripts/ablation-replace.mjs, each mutation proved on disk and restored to the HEAD blob):

  • the page hands SchemaForm no notes (underivable.length > 0 → < 0) → (a) red, (b) green;
  • underivableTargets ignores a typed Name (the target-holds-a-value line deleted) → (a) red at "goes away once a Name is typed", (b) green.

Acceptance notes

Verification

Local runs

Head 74a406d6 (branch merged with main 92120357, which carries #28296).

  • OS_SKIP_DTS=1 pnpm turbo run build --filter='@object-ui/app-shell^...' --filter='!@object-ui/*' (under the verify lock) → VERDICT command-exit 0; after the merge, env -u OS_SKIP_DTS pnpm turbo run build --filter='@object-ui/app-shell^...' → Tasks: 64 successful, 64 total.
  • type-check of @object-ui/app-shell and @object-ui/i18n (each tsc --noEmit and tsc -p tsconfig.test.json) after that dts build → VERDICT command-exit 0.
  • New file alone → Test Files 1 passed (1), Tests 2 passed (2).
  • Before the merge, under the verify lock: pnpm --dir ui exec vitest run --maxWorkers=2 packages/app-shell/src/views/metadata-admin/ packages/i18n/ → Test Files 781 passed (781), Tests 8693 passed | 14 skipped (8707), VERDICT command-exit 0. After the merge (scoped to the overlap with feat(app-shell): Studio item toolbar — layers, references, history with rollback, audit and source on every pillar item #28296): ResourceEditPage*, SchemaForm*, createBody* and packages/i18n/ → Test Files 173 passed (173), Tests 2023 passed | 13 skipped (2036), VERDICT command-exit 0. The whole packages/app-shell/ suite was not run locally (CI's Test UI runs it).
  • pnpm --dir ui exec eslint on the six changed ts / tsx files → 0 errors (the warnings are on lines this diff does not touch). pnpm --dir ui run check:new-line-citations → 0 new citations, exit 0.
  • Live Console: pnpm --filter @objectstack/example-showcase dev -- --fresh -p 38231 (the root pnpm dev preflight refused on unbuilt ui/ dist entries the Console dev server does not use) plus ui/apps/console vite --port 5291 --strictPort against it; Chromium via Playwright; servers stopped by their own ports afterwards.
Derived gates

node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack on 74a406d6 → 34 commands, each run with stdin from /dev/null and its exit code captured before any pipe (pnpm --dir ui exec vitest run scripts/ under the verify lock: Test Files 169 passed | 2 skipped (171), Tests 4901 passed | 2 skipped (4903)). --ran reconcile: 34 derived, 34 run, 0 NOT-MEASURED, 0 UNRUN, 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/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:pm-changeset-deadline-census :: exit 0
pnpm check:published-files :: exit 0
pnpm check:query-options-erasure :: exit 0
pnpm check:refd-timer-probe :: 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

Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#1 · os-tesla · session_01L9qibzC6RxMfB59EsgAoNN

席位核对

ACCEPT · seat domain:ui#1 · head 74a406d6 · 2026-10-31T07:08Z

席位意见:在中文或日文界面新建权限集这类元数据时,如果标签全是中文,系统无法自动生成名称,Name 会留空。现在 Name 下方会出现一行提示,请作者自己输入 snake_case 名称;输入后提示消失,清空后又会出现。标签里有英文字母的照常自动生成名称,不显示提示。另外按复审要求核对了 #28229 的帮助文字:在 1280 和 820 像素宽度、英文和中文下都会换行,没有被截断。

  1. Shape: Fixes #28232, draft, base main, 7 files, +221/−7. Changes:
  2. Seat read: Clause-②: no is accepted on the fix(console): a served form row marked required holds Save when left empty #28293 precedent (onRequiredRowFieldsChange): an optional prop on SchemaForm, no new package export, no accept set moved. So no contract review is owed. The note is shown at once and never deferred like an issue, and the CONTROL cases (Latin label, pristine form, cleared label) are pinned. main 92120357 is merged in and carries feat(app-shell): Studio item toolbar — layers, references, history with rollback, audit and source on every pillar item #28296, with no shared hunks.
  3. Finding: the summary banner states Name's identifier errors in English in zh-CN and cuts the second one at 820 px. The seat filed it as Studio create form: the summary banner states Name's identifier errors in English in zh-CN and cuts the second one #28369. The object and report designers' own Name inputs are noted only.
  4. Gates / check-runs: on 74a406d6: 44 success, 11 skipped, 0 failure. mergeable_state clean.
  5. Landing: check-governed-merges --pr 28366 reports NOT governed, 228 changed lines ≤ 3000. The seat readies the PR and arms auto-merge, on the maintainer's 「按 pm-dispatch 审过的pr你可以自主落地」 (seat thread, 2026-10-30T14:19Z).

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review October 31, 2026 07:09
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Oct 31, 2026
Merged via the queue into main with commit 0fd2d08 Oct 31, 2026
56 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-66arln branch October 31, 2026 07:25
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 tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Metadata create form: say "type a name" next to Name when the label cannot fill it

1 participant