feat(dashboard): Studio 只授权 ADR-0021 dataset 形态 (framework#3251)#2703
Merged
Conversation
…ework#3251) Finishes the dashboard analytics migration on the authoring side so the framework can enable DashboardWidgetSchema.strict(). Both Studio surfaces now emit only the semantic-layer shape (dataset + dimensions + values). - types: DashboardWidgetSchema gains dataset/dimensions/values; the inline analytics keys (object/categoryField/valueField/aggregate/measures) are deprecated (kept only for the renderer's legacy/static read path). - plugin-dashboard: WidgetConfigPanel rewritten as a dataset picker (chart AND pivot). Replaces the unused availableObjects/availableFields props with a prop-injected `datasets` catalog (WidgetDatasetCatalogEntry), also forwarded by DashboardWithConfig. Free-text fallback when no catalog. New exports: WidgetDatasetCatalogEntry, sanitizeDraftForType. - app-shell: DashboardWidgetInspector drops the legacy inline fields; dataset binding is now the only analytics shape; filter-binding field picker sources from the bound dataset's dimensions. Add-widget catalog drops list/custom (not members of spec ChartTypeSchema). - Renderer legacy/static branches and ObjectPivotTable/PivotTable blocks kept (backward-compat for stored/static widgets); their retirement is a follow-up. - Tests: new WidgetConfigPanel dataset-authoring + sanitize suite; inspector test updated. Docs: SKILL.md examples use the dataset shape. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T4qmiXd4wjnJMLt18Cir1Y
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
os-zhuang
marked this pull request as ready for review
July 19, 2026 18:05
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.
背景
完成 dashboard 分析迁移的授权侧(framework#3251),让 framework 得以开启
DashboardWidgetSchema.strict()。此前 Studio 的两个授权面仍在生成已废弃的 pre-ADR-0021 内联查询形态(object/categoryField/valueField/aggregate,透视表rowField/columnField)。本 PR 后,两个面都只生成语义层形态(dataset+dimensions+values)。这是两仓协作的第一步(先合并):framework 侧的 strict PR(objectstack-ai/framework,同名分支)必须在本 PR 合并 之后 再合并,并在其中把
.objectui-shabump 到本 PR 的合并 commit。顺序不能反,否则旧 console 会让 Studio 保存 422。FROM → TO(授权形态)
object+categoryField+valueField+aggregate→dataset+dimensions+valuesobject+rowField+columnField+valueField+aggregation→dataset+dimensions+values(最后一个维度横向展开为列)改动
@object-ui/types—DashboardWidgetSchema新增dataset/dimensions/values;内联分析键(object/categoryField/categoryGranularity/valueField/aggregate/measures)标记@deprecated,仅保留给渲染器读取遗留/静态元数据。@object-ui/plugin-dashboard—WidgetConfigPanel重写为 dataset 选择器(图表 + 透视表)。破坏性 prop 变更:移除无调用方使用的availableObjects/availableFields,改为注入式datasets?: WidgetDatasetCatalogEntry[](+datasetsLoading?),并由DashboardWithConfig转发。无目录时回退到自由文本授权。新导出:WidgetDatasetCatalogEntry、sanitizeDraftForType。宿主可用元数据客户端list('dataset')解析目录。@object-ui/app-shell— metadata-adminDashboardWidgetInspector移除内联遗留字段(object / value field / category field / aggregate);dataset 绑定成为唯一分析形态;filter-binding 字段选择器改从所绑 dataset 的维度取值。"Add widget" 目录移除list/custom(非 specChartTypeSchema成员,授权后无法发布)。刻意保留(非本次退役范围)
DashboardRenderer的遗留/静态读取分支,以及ObjectPivotTable/PivotTable组件(仍是公开 SDUI block,也是存量/静态 widget 的向后兼容渲染路径)保留不动 —— 只有 dashboard 授权流停止生成遗留键。渲染器分支的退役依赖存量 dashboard 迁移,作为后续独立工作(渲染器消费方可能延伸到cloud,本次不冒险删除)。测试
WidgetConfigPanel.test.tsx:dataset 授权 UI +sanitizeDraftForType遗留键清洗;无目录自由文本回退。DashboardWidgetInspector.test.tsx:断言遗留字段已移除、dataset 绑定仍在。plugin-dashboard全量测试 132 passed;types185 passed(含p1-spec-alignment/spec-ui-schema-reexports/dashboard-config);app-shell type-check 通过;改动文件 lint 0 error。文档 / changeset
plugin-dashboard/SKILL.md的compareTo示例改为 dataset 形态,并加上授权形态说明。@object-ui/types/plugin-dashboard/app-shellminor,含 FROM→TO 与 prop 破坏说明。🤖 Generated with Claude Code
Generated by Claude Code