feat(spec)!: dashboard 的 header、过滤器和根收紧(#4001 批 6c) - #4532
Merged
Conversation
`DashboardWidgetSchema` has been strict since the ADR-0021 cutover, and its
error map states the reason in its own words: undeclared keys "were dropped
silently before strict validation, shipping inert metadata". Everything AROUND
the widget kept the posture the widget was rescued from — the header, its
actions, the global filters and their option sources, the date range, and the
dashboard root.
Three keys get a prescription rather than a rename, because a rename would be
wrong:
- `layout` on the dashboard reads like a template selector; there is none.
Layout is per-widget, and a widget without one is auto-flowed.
- `subtitle` on the header: the header renders the dashboard's own
label/description, with only showTitle/showDescription to toggle them.
- `filterBindings` on a filter: the binding runs the other way — a WIDGET
maps this filter's name to one of its own fields, or false to opt out.
Deliberately left open. `DashboardWidgetOptionsSchema` stays passthrough: it is
the renderer-extras escape hatch by design, and the four keys in it that do
reach the analytics query are already declared explicitly (framework#3588).
Closing it would break the escape hatch to fix a problem already fixed the right
way. The widget's bespoke error map also stays — it works and is tested;
converging it onto strictObject is a follow-up, not a prerequisite.
Registered types closed: 23 of 25. Still open: action, view — the last two, so
the warning layer is down to two covered roots. When both close it has nothing
left to warn about at a root, which is the campaign finishing rather than the
layer breaking; the test says so in place rather than being deleted.
Surfaced while re-pointing a test at `view`: one unknown key on a view reports
TWICE, because `view` is a union and the walk emits per strip-mode variant.
Recorded in the test rather than dodged by picking a non-union collection.
Verified: 284 files / 7240 tests, tsc clean, 8 generated artifacts current, all
10 spec gates green, and CRM/Todo/showcase/platform-objects build (showcase
carries three real dashboards).
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WnqGjQFQMqd5k81LYV8SCY
os-zhuang
marked this pull request as ready for review
August 1, 2026 19:13
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
os-zhuang
enabled auto-merge
August 1, 2026 19:13
Contributor
📓 Docs Drift CheckThis PR changes 1 package(s): 107 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
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.
#4001 批 6c(清单)。批 1–6b = #4514 → #4531,均已合并。
widget 三个版本前就被救出来了,它周围的一切没有
DashboardWidgetSchema从 ADR-0021 切换起就是.strict(),它的错误信息里自己写着理由:而 widget 周围的一切,保持的正是 widget 当年被救出来的那个姿态——header、header actions、全局过滤器、过滤器的动态选项源、日期范围,以及 dashboard 根本身。
这批把它们关上。
三个键给处方,而不是改名——因为改名会是错的
layout{x,y,w,h},没写的会被自动排布subtitlelabel/description,没有独立的 header 文案,只有showTitle/showDescription开关filterBindingsname映射到自己的字段,或写false退出别名走 dashboard 的词汇表:
charts/components/cards/tiles→widgets,filters→globalFilters,refresh/autoRefresh/pollInterval→refreshInterval,dateFilter/timeRange→dateRange。刻意不动的两处
DashboardWidgetOptionsSchema保持passthrough。 它是设计上的渲染器逃生舱——渲染器认识的展示类设置不关 spec 的事——而其中真正影响分析查询的那四个键早已单独声明(framework#3588)。关掉它等于为了修一个已经用对的方式修好的问题,而砸掉逃生舱。widget 那张 bespoke
strictWidgetAnalyticsError也不动。 它能用、有测试,携带 pre-ADR-0021 内联分析和 objectui 内部属性两族处方。收敛到strictObject(那样能在处方之上再叠加「你是不是想写」)是后续项,不是前置条件。顺带记下一个噪音
把测试指向
view时发现:一个未知键在 view 上会报两次——view是 union(container | ViewItem | overlay),遍历为每个 strip 变体各发一条。记在测试里,而不是换个非 union 的集合绕开。
view关闭后自然消失。进度
注册类型顶层已关闭:23 / 25。仍剥离:
action·view—— 最后两个。告警层覆盖的根降到 2。两个都关上之后,这一层在根层面就没有可警告的了——那是战役完成,不是这层坏了;测试会故意断言空集,而不是被删掉(已写在原地)。
验证
tsc --noEmit干净check:*全绿授权影响:这些形状没声明的键从「静默丢弃」变成「拒绝」——本来就已经被忽略。
参考
POST /data/sharing/rules绕过SharingRuleSchema:criteria缺失或拼错静默变成"共享该对象全部记录",与 ADR-0049 "never seeded as a permissive match-all" 直接冲突 #3896(aria/performance移除)🤖 Generated with Claude Code
https://claude.ai/code/session_01WnqGjQFQMqd5k81LYV8SCY
Generated by Claude Code