Skip to content

fix(dashboards): Fix performance score widget layout and sizing#111258

Merged
gggritso merged 7 commits intomasterfrom
georgegritsouk/dain-1383-address-padding-issue-with-performance-score-widget
Mar 23, 2026
Merged

fix(dashboards): Fix performance score widget layout and sizing#111258
gggritso merged 7 commits intomasterfrom
georgegritsouk/dain-1383-address-padding-issue-with-performance-score-widget

Conversation

@gggritso
Copy link
Member

@gggritso gggritso commented Mar 20, 2026

Fix the performance score (wheel) widget layout in dashboards and make the ring scale to fill its container.

We've had a complaint that the padding around the Score widget is awkward. It's true! I was tinkering with this, and thought, why not take this a step further and let the SVG scale with the widget? Kind of like a Big Number! I also fixed some padding stuff and got rid of the caption that said "last 7 days" altogether, none of our other widgets have that, might as well toss it.

Before:
Screenshot 2026-03-20 at 6 02 50 PM

After:
Screenshot 2026-03-20 at 6 04 20 PM

Refs DAIN-1383

Center the ring vertically and horizontally within the widget card by
replacing the styled Container with a Flex primitive, rebalancing the
SVG y-offset from 25 to 30, and removing the redundant
PerformanceScoreSubtext element.
Add an autoSize prop to PerformanceScoreRingWithTooltips that uses
viewBox with 100% width/height so the SVG scales to fill its container.
The wheel widget opts in; all other callers keep fixed 220x200 sizing.
@gggritso gggritso requested a review from a team as a code owner March 20, 2026 22:07
@linear-code
Copy link

linear-code bot commented Mar 20, 2026

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Mar 20, 2026
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.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Default y offset change affects all callers unintentionally
    • I restored the shared default y offset to 25 and passed y={30} only in the dashboard wheel widget caller so non-dashboard views keep their original positioning.

Create PR

Or push these changes by commenting:

@cursor push 87cc03d62c
Preview (87cc03d62c)
diff --git a/static/app/views/dashboards/widgets/wheelWidget/wheelWidgetVisualization.tsx b/static/app/views/dashboards/widgets/wheelWidget/wheelWidgetVisualization.tsx
--- a/static/app/views/dashboards/widgets/wheelWidget/wheelWidgetVisualization.tsx
+++ b/static/app/views/dashboards/widgets/wheelWidget/wheelWidgetVisualization.tsx
@@ -33,6 +33,7 @@
     <Flex justify="center" align="center" direction="column" height="100%">
       <PerformanceScoreRingWithTooltips
         autoSize
+        y={30}
         projectScore={projectScore}
         text={score}
         width={220}

diff --git a/static/app/views/insights/browser/webVitals/components/performanceScoreRingWithTooltips.tsx b/static/app/views/insights/browser/webVitals/components/performanceScoreRingWithTooltips.tsx
--- a/static/app/views/insights/browser/webVitals/components/performanceScoreRingWithTooltips.tsx
+++ b/static/app/views/insights/browser/webVitals/components/performanceScoreRingWithTooltips.tsx
@@ -150,7 +150,7 @@
   inPerformanceWidget = false,
   size = 140,
   x = 40,
-  y = 30,
+  y = 25,
   labelHeightPadding = 14,
   radiusPadding = 4,
 }: Props) {

This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.

Revert the shared default y from 30 back to 25 so other callers
(pageOverviewSidebar, performanceScoreChart) are unaffected. Pass
y={30} explicitly from the dashboard wheel widget instead.
…nceScoreRingWithTooltips

When autoSize is used, passing width/height is redundant since the SVG
scales to its container. Default both to 220/200 (the value every caller
uses) so autoSize callers don't need to pass them.
… is on

Instead of requiring callers to pass y={30}, compute it as
(height - size) / 2 when autoSize is true. Existing callers keep y=25.
@gggritso gggritso merged commit 48bc95e into master Mar 23, 2026
67 of 70 checks passed
@gggritso gggritso deleted the georgegritsouk/dain-1383-address-padding-issue-with-performance-score-widget branch March 23, 2026 21:34
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