feat(plugin-charts): 把 drillDown 声明成 ObjectChart 的 registry input (framework#5022) - #3358
Merged
Merged
Conversation
…nput (framework#5022)
`ObjectChart` has read `schema.drillDown` all along — it is what opens the
drawer of underlying records when a segment is clicked — but the prop was
declared in neither the protocol nor this registry entry. The manifest the SDUI
save gate validates page JSX against is built verbatim from these `inputs`, so
an author writing the drill got an `unknown-prop` diagnostic for a prop that
works. framework#5022 declares the protocol half (`ChartDrillDownSchema`,
published on the react-tier `<ObjectChart>` contract); this is the renderer half.
The published input describes the six keys the spec declares — `enabled`,
`filter`, `title`, `target` ('drawer' | 'dialog'), `columns`, `maxRows` — and
deliberately NOT the wider `DrillDownConfig` this repo shares with the table /
pivot / metric widgets. `ObjectChart` reads none of `mode` / `report` / `view` /
`sort`, and does not implement `target: 'navigate'` (it falls through to the
drawer). Advertising them in the designer palette would re-open the gap
framework#5022 just closed, one layer down. Two of those keys are read by no
renderer at all — objectui#3354.
The untyped `(schema as any).drillDown` becomes a typed `DrillDownConfig` read.
Narrowing it further to the spec's `ChartDrillDown` is a TODO on the version
pin: `@objectstack/spec` is pinned at `^17.0.0-rc.2` here and the declaration
lands in the next rc, so the import would not compile today — and re-declaring
the shape locally is exactly the fork that would let the two drift.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ehu85kbvMcrNTUJjwxvLJ9
|
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.
配套 PR,主单在 framework:objectstack-ai/objectstack#5022 / objectstack-ai/objectstack#5221
为什么
ObjectChart一直在读schema.drillDown—— 点一个柱子/扇区打开底层记录抽屉,靠的就是它。但这个 prop 两边都没声明过:协议里没有,这个 registry entry 里也没有。SDUI save gate 校验页面 JSX 用的 manifest 是从这些
inputs逐字复制出来的(manifestFromConfigs),所以一个作者写了drillDown会拿到一条unknown-prop诊断 —— 对着一个真的能工作的 prop。framework#5022 声明了协议半边(
ChartDrillDownSchema,发布在 react-tier<ObjectChart>契约上);这个 PR 是渲染器半边,让 gate 跟它对上。改了什么
1. registry
inputs加上drillDown。描述里只列 spec 声明的六个键 ——
enabled/filter/title/target('drawer' | 'dialog')/columns/maxRows。刻意不列本仓与 table / pivot / metric widget 共享的更宽的
DrillDownConfig:ObjectChart不读mode/report/view/sort,也不实现target: 'navigate'(它直接落回 drawer)。把它们摆进设计器面板等于在低一层重新打开 framework#5022 刚合上的那个口子。其中两个键更是任何渲染器都不读 —— objectui#3354。2.
(schema as any).drillDown换成类型化读取(DrillDownConfig)。再往下收窄到 spec 的
ChartDrillDown留成 TODO,挂在版本 pin 上:本仓@objectstack/specpin 在^17.0.0-rc.2,而声明落在下一个 rc,今天 import 编译不过 —— 而在本地重新声明一份形状,正是会让两边漂移的那种 fork,所以没做。注释里写清了两个类型不是同一个集合及其原因。测试
新增两条断言(
packages/plugin-charts/src/index.test.ts):type: 'object');mode/report/navigate—— 第二条是防止下一次「顺手补全」把另一个 widget 的词汇搬进来。🤖 Generated with Claude Code
https://claude.ai/code/session_01Ehu85kbvMcrNTUJjwxvLJ9
Generated by Claude Code