fix(grid): 删掉 bulkEnabled 推导 —— 这个 spec key 已是墓碑 (#3002) - #3053
Merged
Conversation
…stone (#3002) Follow-up to #3031. `@objectstack/spec` 17.0.0 retired `action.bulkEnabled` in the #3896 audit close-out (framework#4054), which landed while #3031 was in flight — the spec source still carried the key when its design was settled. It is now a retiredKey() tombstone, so it is not merely ignored: defineStack HARD-REJECTS a config that sets it and the backend refuses to boot. The derivation branch could never run, and #3031's changeset pointed authors at a key that breaks their app. Browser verification against a real showcase backend is what surfaced it. The tombstone prescribes the surviving path — "declare the action in the view's `bulkActions` instead" — which is #3031's other half, and the half the end-to-end run exercised: naming `showcase_mark_done` in the view issued one POST /api/v1/actions/showcase_task/showcase_mark_done per selected record (10/10 → done: true, progress: 100 server-side). Everything downstream of the fold is unchanged. A stale `bulkEnabled: true` is now inert rather than a second path into the bar. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
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.
#3031 的跟进修复。#3031 的一半设计是错的,浏览器实测把它抓出来了。
发生了什么
#3031 让选择栏折叠两路来源:view 的
bulkActions名字解析到objectDef.actions,以及对象 action 上的ActionSchema.bulkEnabled。第二路是死的。@objectstack/spec17.0.0 在 #3896 审计收尾里退役了action.bulkEnabled(framework#405412a19a88a)—— 这个提交在 #3031 进行途中落地,我定设计时读到的 spec 源码里这个 key 还在。它现在是
retiredKey()墓碑,不是「被忽略」而是硬拒绝:defineStack直接拒绝编译,后端起不来。所以那条推导分支永远不可能执行,而 #3031 的 changeset 还在教作者用一个会让应用启动失败的 key。是浏览器验证发现的 —— 我在 showcase 里加
bulkEnabled: true想跑端到端,后端直接拒绝启动。单测和 type-check 都抓不到:折叠函数读的是带索引签名的NamedActionDef,退役 key 不会显现成never(见 objectui 的 spec-tombstone 经验)。改动
墓碑自己给的处方正是 #3031 活下来的那一半 —— "declare the action in the view's
bulkActionsinstead"。所以resolveBulkActions现在只折叠两路词汇:bulkActionDefs;bulkActions里的名字,解析到对象 action 后提升成该 def。折叠之下的一切都没变:提升出的 def 照样带 action 的 label / icon /
visible/ 确认文案 / 参数,照样走BulkActionDialog(params → confirm → progress → result),照样逐记录带_rowRecord派发、逐条归因失败。对象 action 上残留的bulkEnabled: true现在是惰性的,不再是进入选择栏的第二条路。DERIVED_BULK_BATCH_SIZE→PROMOTED_BULK_BATCH_SIZE(未导出到包外,只在本模块和测试里用)。验证
真实 console + 真实后端(objectstack worktree 起 showcase 于 :3010,console dev 从本 worktree 起于 :5182):
bulkActions: ['showcase_mark_done', 'showcase_recalc_estimate'],两个名字都被提升 —— 选择栏显示的是 action 自己的标签 "Mark Done" / "Recalculate Estimate"(不是 humanize 出来的 "Showcase Mark Done")和 action 的图标。POST /api/v1/actions/showcase_task/showcase_mark_done全部 200,逐记录一次。done: true, progress: 100。修复前这条路径零请求、零改动。测试:
plugin-grid44 文件 / 351 测试全绿;types+plugin-grid+app-shelltype-check 31 任务全过;改动文件 0 lint error。🤖 Generated with Claude Code