Repository navigation
fix(app-shell): the metadata editor page tells its scoped inspector why it is read-only - #29203
Merged
Merged
Conversation
… its scoped inspector ResourceEditPage passed formReadOnly to the scoped inspector with no readOnlyReason, so a flow's node inspector on the metadata editor page showed disabled controls with nothing to say why. The page now passes the sentence its own notice gives for the cause in force: the walled catalog, a read-only package, a lock, a declaration-only catalog, a caller without manage_metadata, a code-package item, or a runtime read-only type. View mode passes none: a designer type is always editing while writable. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUgMp6a6PrErVUDx8h
Contributor
Author
|
domain:ui#1 · zhuangjianguo · session_01QsR2jUJ19MstFvFhjgiYTu 席位核对 · ACCEPT · 2026-11-02T09:30ZHead-sha:
|
This was referenced Nov 2, 2026
This was referenced Nov 2, 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 Steedos · project thread
Fixes #29079
Clause-②: no
Metadata-protocol: none
维护者速读
/studio/包/metadata/flow/名称)现在会把「为什么只读」告诉右侧的节点属性栏。属性栏显示的原因,就是编辑器上方提示条对当前原因说的那句话:只读软件包、锁定、缺少manage_metadata能力、代码包提供的条目、运行时只读的类型,以及安全目录的隔离墙。没有新增文案。readOnlyReason,且只传给按选中项打开的属性栏;可写时不传,渲染与之前相同。未选中时的默认属性栏不变。回滚即还原本 PR。ResourceEditPage.tsx中formReadOnly下方新增的inspectorReadOnlyReason(原因的先后顺序与上方提示条一致),以及InspectorComponent调用处新增的一行。ui/下运行pnpm exec vitest run packages/app-shell/src/views/metadata-admin/ResourceEditPage.inspectorReadOnlyReason-29079.test.tsx,预期 6 个测试全绿;去掉调用处那一行后 5 个变红。What changes
ResourceEditPagederivesinspectorReadOnlyReasonnext toformReadOnlyand passes it to the scoped inspector (InspectorComponent) asreadOnlyReason, the prop Studio flow node inspector: on a read-only package every control is disabled with no reason on hover, keyboard focus or to assistive tech #28985 added toMetadataInspectorProps. The sentence is the one the page's own notice gives for the cause in force, in the notices' order:engine.catalog.readOnly.walled;engine.studio.pkg.readonlyHint, the sentence Studio's Automations pillar passes;lockReasonthe server serves;engine.catalog.declaredOnly.hintsentence;manage_metadata:engine.edit.capabilityReadOnly;engine.edit.artifactLockedBanner;engine.edit.readOnlyTypeBanner.An editable page passes none.
MetadataDefaultInspectorPropsdeclares noreadOnlyReason, and widening it is outside this card.Deviations
The card asks for three causes on the node inspector: no write access, a pending walled decision, and view mode pointing at Edit. Measured on
main87d6baef, only the first can reach the flow node inspector on this page:position,permission,capability), and none of them registers a scoped inspector. The page still names the wall first, so an inspector a host registers for one of those types gets the right sentence and not the capability one. The test pins that through a host inspector registered forposition.Tests
ResourceEditPage.inspectorReadOnlyReason-29079.test.tsx, 6 cases. The real page, gates andFlowInspector→FlowNodeInspector; only the canvases (to emit a selection) and the data reads are stubbed. Each case opens the item, selects on the canvas and reads the accessible description of the node inspector's reason group:manage_metadata, a locked item with a served reason, and a flow a code package ships: each shows its own sentence;positionreceivesreadOnlyand the wall's sentence.87d6baefreads 5 failed, 1 passed (only the writable control passes).readOnlyReason={inspectorReadOnlyReason}line throughscripts/ablation-replace.mjsreads 5 failed, 1 passed; restored, blob equalsHEADandgit diff HEADis empty.Verification
All readings on head
162f85c0, base87d6baef.Tests
pnpm exec vitest run(fromui/) onResourceEditPage.inspectorReadOnlyReason-29079.test.tsx: 6 of 6 passed. The same file on87d6baef: 5 failed, 1 passed.readOnlyReason={inspectorReadOnlyReason}line (scripts/ablation-replace.mjs, anchor 1 to 0, blob9e74e863to5d2abee0): 5 failed, 1 passed; restored to theHEADblob,git diff HEADempty.git grepfinds namingResourceEditPage,MetadataResourceEditPageorreadOnlyReason, in three locked batches at--maxWorkers=2: 40/40 files (364 tests), 40/40 (204), 40/40 (547). Narrowed on purpose: CI's Test UI runs the rest of app-shell.pnpm exec turbo run type-check --filter=@object-ui/app-shell: 65 of 65 tasks successful.eslinton the two changed ui files: 0 errors; 51 warnings, the same countResourceEditPage.tsxcarries onmain, none in the new test.Gates
node scripts/pm/dispatch-gates.mjs --commandsderived 34 families; all 34 ran with exit 0: the 33 unlocked ones with this body as the PR event (check-adr-0087-registration,check-changeset-no-major,check-closing-keyword-parityandcheck-sdui-manifestamong them), andpnpm --dir ui exec vitest run scripts/locked: 169 files passed, 2 skipped (4,900 tests).dispatch-gates --ran: 34 derived, 34 run, 0 NOT-MEASURED, 0 UNRUN.check:new-line-citations: 0 new citations.Generated by Claude Code