Skip to content

feat(dashboards): Add legendType field and support field links for breakdown charts#110420

Merged
DominikB2014 merged 6 commits intomasterfrom
dominikbuszowiecki/browse-420-cloning-dashboard-with-widgets-that-show-legends-as-table
Mar 11, 2026
Merged

feat(dashboards): Add legendType field and support field links for breakdown charts#110420
DominikB2014 merged 6 commits intomasterfrom
dominikbuszowiecki/browse-420-cloning-dashboard-with-widgets-that-show-legends-as-table

Conversation

@DominikB2014
Copy link
Contributor

Add a legendType field to dashboard widgets and allow line/bar charts with breakdown legends to use field links.

Changes

  • DashboardWidgetLegendType enum — new str enum ("default", "breakdown") in dashboard_widget.py, used for validation and type hints
  • legendType stored in detail JSON field — no migration needed, follows the same pattern as layout and axisRange
  • Field links for breakdown charts — line and bar charts with legendType: "breakdown" can now save linked dashboards (previously only table widgets)
  • Removed dashboards-drilldown-flow feature flag from the field link save path — the flag now only controls UI visibility
  • Duplicate field validation — linked dashboards with the same field are now rejected

Refs LINEAR-BROWSE-420

…eakdown charts

Add a `legendType` field to dashboard widgets, stored in the existing
`detail` JSON field. This enables line and bar charts with breakdown
legends to use field links (previously only supported for table widgets).

Also removes the `dashboards-drilldown-flow` feature flag gate from the
field link save path so the flag only controls UI visibility, and adds
validation to reject duplicate fields in linked dashboards.

Refs LINEAR-BROWSE-420
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@linear-code
Copy link

linear-code bot commented Mar 11, 2026

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Mar 11, 2026
@DominikB2014 DominikB2014 marked this pull request as ready for review March 11, 2026 15:27
@DominikB2014 DominikB2014 requested a review from a team as a code owner March 11, 2026 15:27
@DominikB2014 DominikB2014 enabled auto-merge (squash) March 11, 2026 18:32
The dashboard widget schema now requires legendType, but the example
fixture used by GET, PUT, and POST dashboard API doc tests was missing
it, causing api docs test failures.

Co-Authored-By: Claude Opus 4.6 <noreply@example.com>
Copy link
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

The `is` operator relies on CPython's small-integer caching, which is
an implementation detail. Use `==` for value comparison, consistent
with every other display type check in the file.

Co-Authored-By: Claude Opus 4.6 <noreply@example.com>
…board-with-widgets-that-show-legends-as-table
When linkedDashboards is explicitly null in the request payload, the
key exists so the guard check passes but .get() returns None instead
of the default empty list, causing a TypeError on len(None).

Co-Authored-By: Claude Opus 4.6 <noreply@example.com>
@DominikB2014 DominikB2014 merged commit 1acb400 into master Mar 11, 2026
59 of 60 checks passed
@DominikB2014 DominikB2014 deleted the dominikbuszowiecki/browse-420-cloning-dashboard-with-widgets-that-show-legends-as-table branch March 11, 2026 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants