Repository navigation
fix(console): a packaged action switched off for this deployment is no longer offered as a live button - #28115
Conversation
… button The object reads will serve the names of the actions the installation switched off beside the document (`disabledActions`). The data layer stamps those action entries under a symbol key (survives a spread, never reaches JSON), and every action gate that hides a capability-gated action asks `isActionSwitchedOff` beside it: the record header, action bars, the engine's location and bulk sets, grid row and bulk actions, related-list toolbars and the declared-actions bar. No client copy of the ledger. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CZny6X72Dx4kxxzLm7
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CZny6X72Dx4kxxzLm7
…hed-off stamps Measured live against #27842's branch: the record header still offered a switched-off action, because the provider's by-name object read hands out a `structuredClone` of the adapter's schema and that drops symbol keys. The stamps are carried onto the copy by name. The package-scoped list read now runs the same ingestion as the whole list (`ingestObjectList`). Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CZny6X72Dx4kxxzLm7
|
domain:ui#4 · os-bill · session_01Utp6CZny6X72Dx4kxxzLm7 Preview review (proxy for epic:#26676#1) · c700e99 · PASS Read at 2026-10-30T13:30Z. A context-free review agent ran this PR's head (c700e99) as a live showcase console against a local server built from the same head. It checked the work against #27504's Acceptance and the v4 record-page boards. It switched Acceptance
Screenshots. GitHub can't host files from the review machine, so the screenshots stay in the seat's card folder under
Board deviations not caused by this card. These were the same before and after the change, so the review files nothing here. They belong to the other #26676 record-page cards:
The switch was left ON after the review. Generated by Claude Code |
|
domain:ui#4 · os-bill · session_01Utp6CbDAucNyQ4UtzCJKyh |
|
domain:ui#4 · os-bill · session_01Utp6CbDAucNyQ4UtzCJKyh Contract reviewServed-tier: Face: declaration only. The PR body, the changeset ① Derived judgments
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS Generated by Claude Code |
|
domain:ui#4 · os-bill · session_01Utp6CbDAucNyQ4UtzCJKyh 席位核对ACCEPT · head
Generated by Claude Code |
Requested by Bill · project thread
维护者速读
disabledActions,本 PR 是读它并隐藏的 ui 半边。ui/packages/core/src/utils/action-activation.ts(标记与判定)、ui/packages/app-shell/src/providers/MetadataProvider.tsx(cloneServedObject与ingestObjectList,按名读的副本保留标记)、ui/packages/components/src/renderers/layout/containers.tsx(标题栏闸门)。Fixes #27504
Consumer-of: #27842
Clause-②: yes (widening) — four new
@object-ui/coreexports:ACTION_SWITCHED_OFF_KEY,markSwitchedOffActions,markSwitchedOffActionsByObject,isActionSwitchedOffMetadata-protocol: none
What changes
The object reads serve, beside the document, the names of the actions this deployment switched off (
disabledActions, #27842: astring[]onGET /meta/object/NAME, a map keyed by object name onGET /meta/object). The console reads it and stops offering those actions.@object-ui/core:utils/action-activation.tsstamps a switched-off action entry under a symbol key (markSwitchedOffActions,markSwitchedOffActionsByObject) and answersisActionSwitchedOff. A symbol rides through a spread (localization, a promoted bulk def) and never reachesJSON.stringifyorObject.keys, so an action handed back to a metadata write never carries it.ActionEngine.getActionsForLocationandgetBulkActionsleave such an action out.@object-ui/data-objectstack: the single-object read stamps from its envelope before unwrappingitem, beside the existingsortabilitycarry.@object-ui/app-shell:MetadataProviderstamps the whole list and a package-scoped list through one ingestion (ingestObjectList). Its by-name read hands out astructuredCloneof the adapter's schema, which drops symbol keys;cloneServedObjectcarries the stamps onto the copy. Found live: without it the record header kept the button.requiredPermissionsthe caller lacks asksisActionSwitchedOffbeside it:page:header(containers.tsx),action:bar, the data table's row action defs,RowActionMenu,BulkActionBar, the grid actions column,RelatedListtoolbar,DeclaredActionsBar, and the managed-by empty state's list toolbar check.packages/**file: the server half, including the plain refusal sentence, landed with meta: GET /meta/object serves which packaged actions are switched off beside the item, and the disabled-action refusal reads as a plain sentence #27842.What to look at (preview)
examples/app-showcase, signed in as the seeded admin, viewport 1440×900.showcase_mark_done, objectshowcase_task) off under Setup › Packaged automation › Packaged actions.Tests
core/src/utils/__tests__/action-activation.test.ts(stamp, spread, JSON, list form, engine location and bulk sets),components/src/__tests__/page-header-switched-off-27504.test.tsx(page:headerandaction:bar, hidden then offered again),data-objectstack/src/getObjectSchema.disabledActions-27504.test.ts(envelope carried, absent key stamps nothing),app-shell/src/providers/__tests__/MetadataProvider.disabledActions-27504.test.tsx(list envelope, absent key, by-name copy keeps the stamp).type-checkpassed for core, components, data-objectstack, plugin-detail, plugin-grid and app-shell.Acceptance notes
disabledActionshides nothing, and[]hides nothing: only a served name hides an action.Verification
Repro on main 561b764 (before)
With Mark Done switched off, the record header and the
record:quick_actionsbar both offered a live Mark Done, and a click toasted "Action 'showcase_mark_done' is disabled — it is switched off for this installation in the packaged-metadata activation ledger (sys_metadata_activation, ADR-0126 §8). …".GET /meta/object/showcase_taskservedtype,name,sortability,itemand no activation state.Live check against #27842's branch plus this change (after)
Switched off: Mark Done buttons 0, Log Time 2. Re-enabled and reloaded: Mark Done 2, Log Time 2.
GET /meta/object/showcase_taskserveddisabledActions: ["showcase_mark_done"]; the list servedshowcase_task: ["showcase_mark_done"].Ablations (each red, each restored to HEAD)
The
page:headergate, theaction:bargate, the engine's location filter, the adapter's stamp, the provider's list stamp and the by-name copy's stamp carry were each disabled throughscripts/ablation-replace.mjs; the matching new test failed every time and the restore matched HEAD's blob.Generated by Claude Code
🤖 Generated with Claude Code
https://claude.ai/code/session_01Utp6CZny6X72Dx4kxxzLm7