Skip to content

feat(dashboard): add structured header and multi-measure pivot support#719

Merged
hotlong merged 2 commits into
mainfrom
copilot/enhance-dashboard-schema-headers
Feb 18, 2026
Merged

feat(dashboard): add structured header and multi-measure pivot support#719
hotlong merged 2 commits into
mainfrom
copilot/enhance-dashboard-schema-headers

Conversation

Copilot AI commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

DashboardSchema lacks a structured header configuration and pivot/matrix widgets only support a single measure. This adds both capabilities as optional extensions with full backward compatibility.

Schema additions (dashboard.zod.ts)

  • DashboardHeaderSchemashowTitle (default true), showDescription (default true), actions[] of DashboardHeaderActionSchema (label, actionUrl, actionType?, icon?)
  • WidgetMeasureSchemavalueField, aggregate (default count), label?, format? for multi-measure pivot/matrix analysis
  • DashboardSchema.header — optional structured header config
  • DashboardWidgetSchema.measures — optional array of WidgetMeasureSchema

Usage

Dashboard.create({
  name: 'analytics_dashboard',
  label: 'Analytics',
  header: {
    showTitle: true,
    actions: [{ label: 'Export CSV', actionUrl: '/export/csv', icon: 'download' }],
  },
  widgets: [{
    title: 'Sales Pivot',
    type: 'pivot',
    object: 'opportunity',
    categoryField: 'region',
    measures: [
      { valueField: 'amount', aggregate: 'sum', label: 'Revenue', format: '$0,0' },
      { valueField: 'amount', aggregate: 'count', label: 'Deals' },
      { valueField: 'margin', aggregate: 'avg', label: 'Avg Margin', format: '0.0%' },
    ],
    layout: { x: 0, y: 0, w: 12, h: 6 },
  }],
});

Tests & docs

  • 20 new tests covering header actions, header schema, measures, and integration with Dashboard.create
  • ROADMAP.md Phase 1 protocol items marked complete
Original prompt

This section details on the original issue you should resolve

<issue_title>Spec: DashboardSchema 支持自定义 header 和 multi-measure 分析配置</issue_title>
<issue_description>1. 仪表盘支持 structured header,包含 title/description/action
2. Pivot/Matrix 支持 multi-measure(多数据字段、多聚合)

目标:

  • DashboardSchema 增加 header 配置区块
  • widget/pivot 支持 measures 属性(数组,内含valueField, aggregate, label...)
  • Spec、单元测试、文档范例

详见 1.2, 1.5

类型:enhancement
完成后请运行测试并同步 roadmap</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

vercel Bot commented Feb 18, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
objectstack-play Ready Ready Preview, Comment Feb 18, 2026 7:41am
spec Ready Ready Preview, Comment Feb 18, 2026 7:41am

Request Review

)

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot AI changed the title [WIP] Enhance DashboardSchema to support custom header and multi-measure analysis feat(dashboard): add structured header and multi-measure pivot support Feb 18, 2026
Copilot AI requested a review from hotlong February 18, 2026 07:15
@hotlong
hotlong marked this pull request as ready for review February 18, 2026 07:44
Copilot AI review requested due to automatic review settings February 18, 2026 07:44
@hotlong
hotlong merged commit 2d9a88e into main Feb 18, 2026
7 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds two key protocol enhancements to DashboardSchema for Airtable dashboard feature parity:

  1. Structured Header Configuration: Introduces DashboardHeaderSchema with showTitle, showDescription, and action buttons (DashboardHeaderActionSchema) for dashboard headers.
  2. Multi-Measure Pivot Support: Adds WidgetMeasureSchema enabling pivot/matrix widgets to display multiple aggregated measures (e.g., sum of revenue, count of deals, avg margin) in a single widget.

Both features are optional and fully backward compatible, following the repository's "Zod First" architecture and camelCase configuration key conventions.

Changes:

  • Added DashboardHeaderActionSchema and DashboardHeaderSchema to dashboard.zod.ts with proper validation and optional fields
  • Added WidgetMeasureSchema supporting valueField, aggregate (count/sum/avg/min/max), label, and format fields
  • Integrated header configuration as optional field on DashboardSchema
  • Integrated measures array as optional field on DashboardWidgetSchema
  • Added comprehensive test coverage (20 new tests) covering schema validation, backward compatibility, and integration scenarios
  • Updated ROADMAP.md to mark Phase 1 protocol items as complete

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
packages/spec/src/ui/dashboard.zod.ts Added DashboardHeaderSchema, DashboardHeaderActionSchema, and WidgetMeasureSchema with proper validation; integrated header and measures into main schemas; exported new types
packages/spec/src/ui/dashboard.test.ts Added 20 comprehensive tests covering header actions, header schema, widget measures, and full integration scenarios with Dashboard.create factory
ROADMAP.md Marked dashboard header and multi-measure pivot protocol items (issue #714) as complete in Phase 1

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.

Spec: DashboardSchema 支持自定义 header 和 multi-measure 分析配置

3 participants