Skip to content

fix(dashboards): Reduce max fractional digits for number type to 4#110858

Merged
DominikB2014 merged 3 commits intomasterfrom
dominikbuszowiecki/browse-437-reduce-number-of-fractional-digits-for-number-data-type
Mar 17, 2026
Merged

fix(dashboards): Reduce max fractional digits for number type to 4#110858
DominikB2014 merged 3 commits intomasterfrom
dominikbuszowiecki/browse-437-reduce-number-of-fractional-digits-for-number-data-type

Conversation

@DominikB2014
Copy link
Copy Markdown
Contributor

@DominikB2014 DominikB2014 commented Mar 17, 2026

Reduces maximumFractionDigits from 20 to 4 for the "number" data type in tooltip formatting and breakdown legend values. This especially helps with percentage-like charts in prebuilt dashboards where values like 0.000033452 would render with excessive precision.

Y-axis labels are left unchanged at full precision since ECharts chooses nice round values for its axis scale and truncating them would misrepresent the scale.

Changes:

  • formatTooltipValue.tsx — cap number type at 4 fractional digits
  • visualizationWidget.tsx — use formatTooltipValue instead of formatYAxisValue for breakdown legend values, so they also get capped at 4 digits

Before
image

After
image

Refs LINEAR-BROWSE-437

Tooltip and Y-axis formatters used maximumFractionDigits of 20 for the
number data type, producing excessively long decimals especially in
percentage charts on prebuilt dashboards. Cap at 4 fractional digits
to keep values readable.

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

linear-code bot commented Mar 17, 2026

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Mar 17, 2026
@DominikB2014 DominikB2014 marked this pull request as ready for review March 17, 2026 15:59
@DominikB2014 DominikB2014 requested a review from a team as a code owner March 17, 2026 15:59
Copy link
Copy Markdown
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.

Fix All in Cursor

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

@DominikB2014 DominikB2014 marked this pull request as draft March 17, 2026 18:16
DominikB2014 and others added 2 commits March 17, 2026 14:21
…legend

Revert the Y-axis maximumFractionDigits change back to 20 since Y-axis
labels are chosen by ECharts and should render at full precision. Instead,
update the breakdown legend in visualizationWidget to use formatTooltipValue
which caps at 4 fractional digits, matching table cell behavior.

Refs LINEAR-BROWSE-437
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Extract the maximumFractionDigits value into a shared constant in
widgets/common/settings.tsx, used by both the tooltip formatter and
table cell renderer. Includes a TODO to increase precision once we
support per-series value types.

Refs LINEAR-BROWSE-437
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Comment thread static/app/views/dashboards/widgetCard/visualizationWidget.tsx
@DominikB2014 DominikB2014 marked this pull request as ready for review March 17, 2026 18:36
@DominikB2014 DominikB2014 requested a review from a team as a code owner March 17, 2026 18:36
@DominikB2014 DominikB2014 merged commit 95c9758 into master Mar 17, 2026
62 checks passed
@DominikB2014 DominikB2014 deleted the dominikbuszowiecki/browse-437-reduce-number-of-fractional-digits-for-number-data-type branch March 17, 2026 18:51
@github-actions github-actions bot locked and limited conversation to collaborators Apr 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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