Skip to content

fix(dashboards): Treat TOP_N display type as AREA#109876

Merged
DominikB2014 merged 2 commits intomasterfrom
fix/dain-1267-top-n-to-area
Mar 5, 2026
Merged

fix(dashboards): Treat TOP_N display type as AREA#109876
DominikB2014 merged 2 commits intomasterfrom
fix/dain-1267-top-n-to-area

Conversation

@DominikB2014
Copy link
Contributor

@DominikB2014 DominikB2014 commented Mar 4, 2026

TOP_N is an outdated display type that some users still have saved in their
dashboards (e.g. from the General Template). It uses a legacy rendering path
that doesn't abbreviate y-axis values, causing large numbers like 150000000
to display unformatted.

Tested with https://sentry.sentry.io/dashboard/128570/
Before
image

After
image

This PR maps TOP_NAREA in two places:

  • Widget builder: deserializeDisplayType now converts TOP_N to AREA,
    so when users open an old TOP_N widget, the type selector shows "Area". When
    they re-save, the widget is persisted as AREA — gradually migrating users off
    the deprecated type.

  • Widget card: Instead of the old TOP_N-specific query manipulation (trimming
    aggregates, setting a results limit), it simply converts the display type to
    AREA so the widget renders through the standard area chart path with proper
    formatting.

Fixes DAIN-1267

TOP_N is an outdated display type that some users still have saved.
It uses a different rendering path that doesn't abbreviate y-axis
values, causing large numbers to display unformatted.

Map TOP_N to AREA in both the widget builder (so re-saving gradually
migrates widgets) and the widget card (so existing TOP_N widgets
render correctly).

Fixes DAIN-1267
Co-Authored-By: Claude <noreply@anthropic.com>
@linear
Copy link

linear bot commented Mar 4, 2026

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Mar 4, 2026
@DominikB2014
Copy link
Contributor Author

@cursor review

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.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

@DominikB2014 DominikB2014 marked this pull request as ready for review March 5, 2026 13:59
@DominikB2014 DominikB2014 requested a review from a team as a code owner March 5, 2026 13:59
Copy link
Member

@gggritso gggritso left a comment

Choose a reason for hiding this comment

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

This is a bit of a hack (we definitely would want to do some kind of database migration here, and update the API) but works for now! 👍🏻

@DominikB2014 DominikB2014 merged commit c86b78c into master Mar 5, 2026
59 checks passed
@DominikB2014 DominikB2014 deleted the fix/dain-1267-top-n-to-area branch March 5, 2026 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants