fix(studio): stop offering the retired action.shortcut / action.bulkEnabled keys - #3154
Merged
Merged
Conversation
…nabled keys spec 17 retired both as retiredKey() tombstones — authoring either is a hard PARSE REJECTION, so a draft carrying it cannot be saved. The action inspector still offered a "Bulk — apply to multiple selected rows" checkbox and a "Shortcut" text field, so Studio let an author build a draft the platform then refused, with the rejection arriving nowhere near the control that caused it. - inspector: both controls removed. The keys stay hidden from the fallback form — the server's live schema still advertises them, so dropping them from the hidden list would put the inputs straight back — but now under a RETIRED_FIELDS list that says why, so nobody restores the "missing" control. - preview: the shortcut / bulk pills are gone; they could only ever render for metadata the platform now refuses to parse. - ActionEngine.registerActions: no longer harvests the two retired keys from authored metadata, which made two dead registration options look load-bearing. Both stay accepted on registerAction(action, options), where a HOST passes them explicitly. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S9aiswZBzoVYsyLKRuGByE
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
…keys CI caught two useActionEngine tests still asserting the metadata harvest this branch removed: getBulkActions() picking up `bulkEnabled: true` and handleShortcut() resolving `shortcut: 'ctrl+k'`, both read off an ActionSchema array. Inverted deliberately rather than reverted. Neither capability has a product consumer — `record-quick-actions` and `record-alert`, the only two callers of this hook, use `getActionsForLocation` / `executeAction` — so removing the harvest broke no live path; the tests were pinning the read of a key that spec 17 retired and that no longer parses. The stale keys stay in the fixture on purpose, so the assertions now prove they are IGNORED — the same shape as plugin-grid's "ignores a stale bulkEnabled flag on an object action". The engine's own bulk / shortcut mechanics keep their coverage in ActionEngine.test.ts, where a host passes those options to registerAction explicitly, which is still supported. Full suite: 9277 passed / 0 failed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S9aiswZBzoVYsyLKRuGByE
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
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.
问题
spec 17 用
retiredKey()退役了action.shortcut与action.bulkEnabled—— 写了就是硬解析拒绝,带这两个 key 的草稿根本存不下去。但 Studio 的动作检查器至今还给它们提供控件:一个「Bulk — apply to multiple selected rows」复选框和一个「Shortcut」文本框。也就是说,设计器引导作者构造一份平台注定拒收的草稿,而拒绝信息出现在保存时、离那个复选框十万八千里。
改动
action-locationsobjectstack#4501 里一并修),把它们从隐藏名单里拿掉反而会让输入框原样回来。现在它们归入一个新的RETIRED_FIELDS列表并写明缘由,免得后来者把"缺失的控件"补回去。shortcut/bulk两个徽标删除 —— 它们只可能为平台已拒收的元数据渲染。ActionEngine.registerActions:不再从作者元数据里采集这两个退役 key。此前的采集让两个死掉的注册选项看起来仍在承重。两者在单动作重载registerAction(action, options)上继续保留 —— 那是主机显式传入的运行期 API,与元数据 key 不是一回事。为什么两个 key 一起处理
同一个墓碑、同一次退役、同三处表面(检查器控件 / 预览徽标 / 引擎采集)。只修
bulkEnabled而把shortcut留在一行之隔,是任意的。替代路径
bulkEnabled的替代是列表视图的bulkActions/bulkActionDefs(墓碑原文如此);shortcut没有替代 —— 按墓碑说明,在 Console 键盘栈里注册按键、让其 handler 按名字调用动作。测试
registerActions不再从元数据采集这两个 key,并写清主机显式传入的路径不受影响。useActionEngine的两条测试(getBulkActions/handleShortcut),它们此前正是靠这条采集才通过。翻转前先确认没有打断活的能力 —— 该 hook 的产品消费者(record-quick-actions、record-alert)只用getActionsForLocation/executeAction,这两个能力无人调用。fixture 里的陈旧 key 特意保留,让断言正面证明"它们被忽略",而不是删掉证据让测试变绿(与 plugin-grid 既有的 "ignores a stale bulkEnabled flag" 同一形态)。引擎自身的 bulk / shortcut 机制在ActionEngine.test.ts由主机显式传参覆盖,未损失。验证:仓根
pnpm test9277 项通过 / 0 失败(795 文件);全量构建通过。🤖 Generated with Claude Code
https://claude.ai/code/session_01S9aiswZBzoVYsyLKRuGByE