Repository navigation
fix(fields): permission-ref / position-ref cells draw the registry label, the name on title - #27970
Merged
Merged
Conversation
…bel, the name on title Claude-Session: https://claude.ai/code/session_01Utp6CbDAucNyQ4UtzCJKyh Co-authored-by: Claude <noreply@anthropic.com>
…e name fallback Claude-Session: https://claude.ai/code/session_01Utp6CbDAucNyQ4UtzCJKyh Co-authored-by: Claude <noreply@anthropic.com>
…e keys Claude-Session: https://claude.ai/code/session_01Utp6CbDAucNyQ4UtzCJKyh Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6CbDAucNyQ4UtzCJKyh Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
|
domain:ui#4 · os-bill · session_01Utp6CbDAucNyQ4UtzCJKyh 席位核对ACCEPT · head
Generated by Claude Code |
3 tasks
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.
domain:ui#4 · os-bill · session_01Utp6CbDAucNyQ4UtzCJKyh
Requested by Bill · project thread
Fixes #27861
Clause-②: no
Metadata-protocol: none
维护者速读
organization_admin_no_bypass)改为显示目录里的标签(如 "Organization Admin"),鼠标悬停显示 API 名;目录里查不到的名字照原样显示。ui/packages/fields/src/widgets/RegistryRefCell.tsx(新的只读单元格)、ui/packages/fields/src/widgets/registryCatalog.ts(共享目录读取,每个数据源每种类型只请求一次)、ui/packages/plugin-detail/src/RelatedList.tsx(把字段的widget传给单元格类型解析的一行)。pnpm --dir ui exec vitest run packages/plugin-detail/src/__tests__/RelatedList.registryRefColumn.test.tsx,预期 3 个用例全绿;或在 showcase 里打开 Setup → Users → 任一用户 → Permission Sets,应看到权限集标签,悬停看到 API 名。What changes
sys_user_permission_set.permission_setandsys_user_position.positionare by-name text columns declaringwidget: 'permission-ref'/widget: 'position-ref'. The edit face (RegistryRefFieldin@object-ui/fields, not the form renderer the card names) already listed the registry with labels; no read cell did, so a user's Permission Sets and Positions tabs printed the api name.@object-ui/fields(widgets/RegistryRefCell.tsx), registered underpermission-ref/position-ref, whichresolveCellRendererTypenow promotes a textual field declaring either widget to (WIDGET_CELL_RENDERER_TYPES, besideobject-ref/recipient-picker). It draws the registry label with the stored name ontitle.widgets/registryCatalog.ts): the catalog the edit picker lists,DataSource.listMetadataItems(type)(GET /api/v1/meta/:type), read once per data source and registry type and shared by every cell; a cell mounting after it settled draws the label on its first render. A failed read is not kept, so the next cell asks again. No new endpoint.RegistryRefFieldnow imports itsregistryListernarrowing from that module instead of keeping its own copy; its behaviour is unchanged.RelatedList'smakeCellresolved the cell key fromtypeandformatonly, so the declaredwidgetnever reached the cell resolution there (the grid already passed it). It now passeswidgettoo. Side effect named: a related-list column declaringobject-refalso reaches its console face now;recipient-pickerstill draws its stored text there, because the related list passes nodependentValues.Tests
ui/packages/fields/src/widgets/__tests__/RegistryRefCell.readFace.test.tsx— the widget picks the key;permission-refandposition-refeach draw the label with the name ontitlefrom ONElistMetadataItemscall shared by several cells; a late mount draws the label at once with no second read; the fallback (an unknown name and an unlabelled one render the name); no data source, loading and a failed catalog draw the name, and a failed catalog is re-read; an empty value draws the shared No-value glyph and reads nothing.ui/packages/plugin-detail/src/__tests__/RelatedList.registryRefColumn.test.tsx— the realRelatedListand data-table, one test per acceptance box: Permission Sets (label, api name ontitle, one catalog read for the column), Positions, and an unknown name rendering as the name.cellRenderers.objectLiteral-8596.test.tsx(fields) andsummaryChip.badgeFitCensus-8464.test.tsx(plugin-detail, fit side 38 → 40).Acceptance notes
ui/packages/components/src/renderers/form/form.tsxas the edit face; the picker isui/packages/fields/src/widgets/RegistryRefField.tsx(form.tsx only lists the widget names it hands a data source). The catalog reused is that picker's.object-ref/recipient-pickerfaces live in@object-ui/app-shell, kept out of@object-ui/fieldsfor the console's eagerui-componentschunk; this card's ruling puts the registry-name face in@object-ui/fields. Its reader is the picker's own catalog call plus a small cache. CI'scheck:eager-closurestep weighs it; this branch did not build the console locally.GET /meta/:typeserves; the server already translates the security catalog's labels for that route, so the cell does no client translation.RegistryRefField) still reads its catalog fresh per mount, uncached: a set authored in Studio is listed on the next form, as before.Verification
All readings on head
8307533a(after mergingorigin/main), through the shared verification lock.Targeted tests
pnpm --dir ui exec vitest run packages/fields/src/widgets/__tests__/RegistryRef packages/fields/src/__tests__/cellRenderers.objectLiteral-8596.test.tsx packages/fields/src/__tests__/widgetRefCells-12613.test.tsx packages/fields/src/__tests__/listCellRendererTypes-8734.test.tsx packages/fields/src/__tests__/fieldFaceSeam-13216.test.tsx packages/plugin-detail/src/__tests__/RelatedList.registryRefColumn.test.tsx packages/plugin-detail/src/__tests__/summaryChip.badgeFitCensus-8464.test.tsx packages/app-shell/src/views/widget-ref-cells/— Test Files 10 passed (10), Tests 89 passed (89).packages/fields/+packages/plugin-detail/whole — 624 files passed, 4 tests red incellRenderers.objectLiteral-8596(the census naming the two new keys, then fixed: 34/34); the cross-package pins (plugin-gridtests,plugin-listtests, app-shell widget-ref and pointer-card faces, plugin-tree/kanban/form, cli registered-types ratchet, components form wiring, two console services) — 396 files, 3659 tests passed.pnpm --filter @object-ui/fields --filter @object-ui/plugin-detail run type-check— both Done (each runstsc --noEmit && tsc -p tsconfig.test.json, the second covering the test files).Ablations (one-off, restored, blob-verified)
RelatedList.tsx: droppingwidget: def.widgetfrom the cell resolution —RelatedList.registryRefColumn.test.tsx3 failed (3); restored bloba15b2c84= HEAD.RegistryRefCell.tsx: drawing{name}in place of{label ?? name}—RegistryRefCell.readFace.test.tsx5 failed / 4 passed (the four that pass are the name-fallback, no-source, loading and empty cases, which the mutation does not change); restored blob7ff0f587= HEAD.Gates
dispatch-gates --ran: 34 derived, 34 run, 0 NOT-MEASURED, every exit 0 — includingnode scripts/check-sdui-manifest.mjs,pnpm check:nul-bytes,pnpm check:cross-package-test-inputs,pnpm check:test-source-alias,pnpm --dir ui exec vitest run scripts/(169 files passed).pnpm check:changeset-fixedexit 0;pnpm check:new-line-citations(ui) — 0 new citations.check:eager-closurebudget, which CI's Build & E2E UI job runs.Generated by Claude Code