refactor: unify runtime dashboard editor onto studio's spec-driven inspectors#1505
Merged
Conversation
Add a curated dashboard-level home inspector for the studio metadata editor, mirroring ReportDefaultInspector but for the flat Dashboard document: - dashboard-schema.ts: derive the Dashboard JSONSchema + authoring form from @objectstack/spec (DashboardSchema / dashboardForm), pruning curated fields - DashboardDefaultInspector: title / description + widgets list (add via AddWidgetPicker, reorder, drill into the scoped DashboardWidgetInspector by widget id) + the spec-driven SchemaForm for layout/filters/advanced - register as the default inspector for the 'dashboard' type - i18n keys (en + zh) for the dashboard inspector labels Studio-only; the runtime DashboardView is migrated separately.
…pectors Replace BOTH legacy plugin-dashboard panels (dashboard-level DashboardConfigPanel and per-widget WidgetConfigPanel) with a single app-shell-local DashboardConfigPanel that hosts the studio's spec-driven inspectors, so runtime and studio share one dashboard-editing surface: - no widget selected -> DashboardDefaultInspector (dashboard level) - widget selected -> DashboardWidgetInspector (widget level) The panel is controlled (no local draft); both inspectors edit the full nested dashboard schema directly, so the runtime's flatten/unflatten/extract widget adapters are removed. Lives in app-shell to avoid a circular dep on plugin-dashboard; the sys_dashboard persistence path is unchanged.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
This was referenced Jun 6, 2026
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.
背景
延续 #1496(视图)、#1504(报表):把运行时仪表盘编辑也统一到 studio 的 spec 驱动 inspector,消除最后一处运行时编辑引擎重复。
仪表盘比报表复杂:运行时右栏在仪表盘级(
DashboardConfigPanel)与 widget 级(WidgetConfigPanel,用 flatten/unflatten 的扁平 widget config)间切换。studio 已有 widget 级DashboardWidgetInspector,缺仪表盘级 default inspector。同样有 plugin-dashboard ↔ app-shell 的循环依赖约束。改动(两阶段)
Stage 1 — studio 侧补齐
dashboard-schema.ts:从@objectstack/spec的DashboardSchema/dashboardForm派生 JSONSchema + 授权表单。DashboardDefaultInspector.tsx:仪表盘级 home inspector(title/description + widgets 列表〔AddWidgetPicker新增、重排、按id下钻DashboardWidgetInspector〕 + spec 驱动SchemaForm)。dashboard的 default inspector;EN/ZH i18n。Stage 2 — 运行时迁移
DashboardConfigPanel(受控组件,无内部 draft),按是否选中 widget 切换DashboardDefaultInspector/DashboardWidgetInspector,两者都直接编辑完整嵌套 dashboard draft。DashboardView用它替换两个 plugin-dashboard 旧面板;删除 flatten/unflatten/extract 等死代码(运行时不再需要)。sys_dashboard持久化不变;canvasDashboardRenderer的 widget 选中机制不变。置于 app-shell 以避开循环依赖。功能精简点
验证
pnpm turbo run build --filter=@object-ui/app-shell:27/27 通过。app-shell/src/views测试 179 全过(含新增 dashboard-schema + DashboardDefaultInspector 测试)。遗留
DashboardView组件本身无单测,迁移正确性靠 build + inspector 测试保障;建议后续补一个渲染/切换冒烟测试。https://claude.ai/code/session_01SZW3fVCCbijEibXtEH3ZGL
Generated by Claude Code