Skip to content

Comments

feat: Dashboard debug/diagnostic mode for data chain troubleshooting#842

Closed
Copilot wants to merge 4 commits intomainfrom
copilot/debug-dashboard-data-issue
Closed

feat: Dashboard debug/diagnostic mode for data chain troubleshooting#842
Copilot wants to merge 4 commits intomainfrom
copilot/debug-dashboard-data-issue

Conversation

Copy link
Contributor

Copilot AI commented Feb 24, 2026

Dashboard widgets render blank with no visibility into why — no error, no loading state, just empty. This adds a debug mode that surfaces the full data chain state per widget so broken injection points are immediately obvious.

Changes

  • @object-ui/typesdebug?: boolean on DashboardSchema
  • @object-ui/core'dashboard' added to DebugCategory
  • @object-ui/plugin-dashboard
    • New DashboardDebugOverlay — collapsible panel at dashboard top showing per-widget: data presence, provider:object status, objectName, aggregate config. Green/red color-coded.
    • DashboardRenderer + DashboardGridLayout — reads schema.debug or SchemaRendererContext.debug, pre-computes widget diagnostics, renders overlay, emits debugLog('dashboard', ...)
  • ROADMAP — Phase 10 under P1.10

Usage

// Schema-level activation
{ "type": "dashboard", "debug": true, "widgets": [...] }
// Context-level activation
<SchemaRendererProvider dataSource={ds} debug>
  <DashboardRenderer schema={schema} />
</SchemaRendererProvider>
// Console logging (independent of visual overlay)
globalThis.OBJECTUI_DEBUG = true;

Tests

7 new tests covering overlay render/toggle, per-widget diagnostics, provider detection, and debugLog emission. All 148 existing dashboard tests pass.

Original prompt

This section details on the original issue you should resolve

<issue_title>[极高优先] Dashboard 仍然全部空白,需要Debug/Test模式定位数据链路断点</issue_title>
<issue_description># 问题现象

近期已完成排查与修复(但无效)

  • ObjectChart、ObjectTable 相关的【数据聚合、extractRecords、series字段自动适配】均已修正。
  • DashboardRenderer 向各 widget 下发 objectName、aggregate/dataProvider 等链路已验证。
  • 各组件内有 Array.isArray/data无类型检查防御。
  • main 分支测试和CI完全通过。

可能遗漏与新疑点

  1. dataSource 注入/挂载问题?
    • 被动 context(SchemaRendererProvider)注入的 dataSource 实际 value 可能为 {}null
    • CRM Demo/Console App 入口处,DashboardView 是否拿到真实 dataSource?
    • 打印 dataSource/context 相��的 debug 输出确认其类型和结构。
  2. 数据 mock/context stub 被覆盖或未生效?
    • Storybook/Console/Demo 环境的注入写法与生产版/自定义切换是否一致?比如
  3. 测试与运行时 divergence?
    • 测试用例用 mock data,CI 通过但线上依赖接口/adapter真实请求。
    • 若无 mock-server 或接口异常,整体 context 会断链。
  4. 错误静默&可观测性不足
    • 没有更详细的 loading/error UI(如 dataSource/dataProvider 断链时全链路红色告警提示)。

建议方案

  • 新增【Dashboard/SchemaRenderer 全局 debug/test 模式】:
    • 自动打印(或渲染到widget/看板顶部)当前 dataSource/context/主要数据结构内容。
    • widget渲染链路主动输出 dataSource 是否有效、objectName 是否已下发,fetch error、record数、聚合、渲染入口参数等。
    • 支持 dashboard/schema 参数如 debug: true 继而各级联动。
  • 建议在生产态提供可选开关(如 debug 面板、长按/按钮触发、report 页面特定路径querystring)以便快速定位后端/context注入问题。
    </issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@vercel
Copy link

vercel bot commented Feb 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
objectui Ready Ready Preview, Comment Feb 24, 2026 4:47pm
objectui-demo Ready Ready Preview, Comment Feb 24, 2026 4:47pm
objectui-storybook Ready Ready Preview, Comment Feb 24, 2026 4:47pm

Request Review

Copilot AI and others added 2 commits February 24, 2026 16:31
…stics

- Add 'dashboard' to DebugCategory in core debug utils
- Add debug?: boolean field to DashboardSchema type
- Add DashboardDebugOverlay component with collapsible diagnostics panel
- Integrate debug mode into DashboardRenderer and DashboardGridLayout
- Log per-widget data chain info (provider, objectName, aggregate) via debugLog
- Add 7 focused tests for debug mode behavior

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
…dget debug infos

- Replace try-catch useSchemaContext() with useContext(SchemaRendererContext) to follow Rules of Hooks
- Pre-compute widget debug info list before rendering overlay instead of mutating ref during render

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot AI changed the title [WIP] Debug and test data connection for dashboard issues feat: Dashboard debug/diagnostic mode for data chain troubleshooting Feb 24, 2026
Copilot AI requested a review from hotlong February 24, 2026 16:41
@hotlong hotlong closed this Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[极高优先] Dashboard 仍然全部空白,需要Debug/Test模式定位数据链路断点

2 participants