Repository navigation
fix(console): a metadata create form says so next to Name when the label cannot fill it - #28366
Merged
Merged
Conversation
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibzY3yWKQ3Yxq1YdCDq
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibzY3yWKQ3Yxq1YdCDq
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibzY3yWKQ3Yxq1YdCDq
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibzY3yWKQ3Yxq1YdCDq
Contributor
Author
|
domain:ui#1 · os-tesla · session_01L9qibzC6RxMfB59EsgAoNN 席位核对ACCEPT · seat 席位意见:在中文或日文界面新建权限集这类元数据时,如果标签全是中文,系统无法自动生成名称,Name 会留空。现在 Name 下方会出现一行提示,请作者自己输入 snake_case 名称;输入后提示消失,清空后又会出现。标签里有英文字母的照常自动生成名称,不显示提示。另外按复审要求核对了 #28229 的帮助文字:在 1280 和 820 像素宽度、英文和中文下都会换行,没有被截断。
|
This was referenced Oct 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Tesla · project thread
Fixes #28232
Refs #28180
Clause-②: no
Metadata-protocol: none
维护者速读
namehelp says it is derived from the label, but a Chinese or Japanese label derives an empty name and nothing prompts #28180 拆出的可选半边)。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 (
underivableTargetsincreateDerive.ts): for eachcreateDeriverule whose transform isslugify, the target is listed when the source holds non-blank text,slugifyof 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.slugifyitself is unchanged (no transliteration).useCreateDerivereturns the list asunderivable(empty when derivation is suspended, i.e. outside create mode).Where it shows.
SchemaFormgains an optionalfieldNotesprop: 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.ResourceEditPagemapsunderivableto the translated line and passes it to both of itsSchemaFormcall sites: the create form, and the designer's inspector fallback (thedoctype's create page). The hunks sit in theuseCreateDeriveblock and on the twoSchemaFormprop lists, away from what #28296 moved;mainwith #28296 is merged in.Copy. New key
engine.create.nameNotDerivedin thestudionamespace: en "This label can't be turned into a name; type one in snake_case.", zh "无法从此显示名称生成名称,请手动输入(snake_case)。" (the form's zh label forlabelis 显示名称). The namespace shipsenandzhonly; 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 == clientWidthon the help element) and is never truncated, so nothing changes there. Screenshots:en0.png,en1.png,zh1.png,en-820.png,zh-820.pngin the project folderui-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 fromMETADATA_FORM_REGISTRY: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):SchemaFormno notes (underivable.length > 0→< 0) → (a) red, (b) green;underivableTargetsignores a typed Name (the target-holds-a-value line deleted) → (a) red at "goes away once a Name is typed", (b) green.Acceptance notes
ObjectDefaultInspector,ReportDefaultInspector), so their create pages do not show this line; that is outside the order's file surface (the create form andcreateDerive).Clause-②: nofollows the precedent of fix(console): a served form row marked required holds Save when left empty #28293 (console(metadata-admin): a served form row markedrequiredthat the Zod leaves optional is only a star, so Save accepts it empty (permission set Label after #28152) #28179), which added the optionalSchemaFormproponRequiredRowFieldsChangeunderClause-②: no;fieldNotesis the same shape of change. The seat may judge otherwise.Verification
Local runs
Head
74a406d6(branch merged withmain92120357, 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-checkof@object-ui/app-shelland@object-ui/i18n(eachtsc --noEmitandtsc -p tsconfig.test.json) after that dts build → VERDICT command-exit 0.Test Files 1 passed (1),Tests 2 passed (2).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*andpackages/i18n/→Test Files 173 passed (173),Tests 2023 passed | 13 skipped (2036), VERDICT command-exit 0. The wholepackages/app-shell/suite was not run locally (CI's Test UI runs it).pnpm --dir ui exec eslinton the six changedts/tsxfiles → 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.pnpm --filter @objectstack/example-showcase dev -- --fresh -p 38231(the rootpnpm devpreflight refused on unbuiltui/dist entries the Console dev server does not use) plusui/apps/consolevite --port 5291 --strictPortagainst it; Chromium via Playwright; servers stopped by their own ports afterwards.Derived gates
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackon74a406d6→ 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)).--ranreconcile:34 derived, 34 run, 0 NOT-MEASURED, 0 UNRUN, exit 0.Generated by Claude Code