Repository navigation
feat(bignumber): add an alignment control - #44554
Conversation
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Code Review Agent Run #e93aae
Actionable Suggestions - 1
-
superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberViz.tsx - 1
- Ineffective textAlign on flex · Line 252-252
Additional Suggestions - 1
-
superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberViz.test.tsx - 1
-
Duplicated test setup · Line 122-185The three new tests repeat the same ~10-line JSX (width/height/bigNumber/formatters/fontSizes/subtitle/refs), differing only in `headerAlignment`. A shared `renderBigNumber(alignment?)` helper would remove the duplication and make the alignment intent clearer.
-
Review Details
-
Files reviewed - 11 · Commit Range:
d9b2d8d..d9b2d8d- superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberTotal/controlPanel.test.ts
- superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberTotal/controlPanel.ts
- superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberTotal/transformProps.test.ts
- superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberTotal/transformProps.ts
- superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberViz.test.tsx
- superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberViz.tsx
- superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberWithTrendline/controlPanel.tsx
- superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberWithTrendline/transformProps.test.ts
- superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberWithTrendline/transformProps.ts
- superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/sharedControls.ts
- superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/types.ts
-
Files skipped - 0
-
Tools
- Whispers (Secret Scanner) - ✔︎ Successful
- Detect-secrets (Secret Scanner) - ✔︎ Successful
- Eslint (Linter) - ✔︎ Successful
Bito Usage Guide
Commands
Type the following command in the pull request comment and save the comment.
-
/review- Manually triggers an incremental AI Review. -
/review full- Manually triggers a full AI Review. -
/pause- Pauses automatic reviews on this pull request. -
/resume- Resumes automatic reviews. -
/resolve- Marks all Bito-posted review comments as resolved. -
/abort- Cancels all in-progress reviews.
Refer to the documentation for additional commands.
Configuration
This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.
Documentation & Help
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #44554 +/- ##
==========================================
+ Coverage 82.17% 82.18% +0.01%
==========================================
Files 2995 2995
Lines 184993 185019 +26
Branches 42818 42819 +1
==========================================
+ Hits 152025 152065 +40
+ Misses 30209 30195 -14
Partials 2759 2759
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Code Review Agent Run #b5a683Actionable Suggestions - 0Additional Suggestions - 48
Filtered by Review RulesBito filtered these suggestions based on rules created automatically for your feedback. Manage rules.
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
e12a34e to
33a57ab
Compare
Code Review Agent Run #87b4bdActionable Suggestions - 0Additional Suggestions - 5
Filtered by Review RulesBito filtered these suggestions based on rules created automatically for your feedback. Manage rules.
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Code Review Agent Run #4a7682Actionable Suggestions - 0Additional Suggestions - 1
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Code Review Agent Run #c651a4Actionable Suggestions - 0Additional Suggestions - 28
Filtered by Review RulesBito filtered these suggestions based on rules created automatically for your feedback. Manage rules.
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Code Review Agent Run #e5274bActionable Suggestions - 0Additional Suggestions - 1
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Code Review Agent Run #3b30d6Actionable Suggestions - 0Additional Suggestions - 1
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Superset 5 centered the Big Number value and subheader; the Emotion CSS-in-JS migration hardcoded align-items: flex-start on the shared BigNumberViz component, and there's been no way back since (#37674). Adds a header_alignment control (Left/Center/Right, default Left to match current behavior) to both BigNumberTotal and BigNumberWithTrendline, threaded through transformProps into BigNumberVizProps. BigNumberViz applies it as align-items on the outer container and text-container, and text-align on each text line (metric name, kicker, header, subheader, subtitle), so multi-line wrapped text aligns internally too. Scoped to alignment only: doesn't touch axis/grid config, context menu wiring, conditional formatting, or aggregation logic. Co-Authored-By: Evan Rusackas <evan@preset.io> Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
header-line is a flex container, so text-align never affected the big number's own position (only justify-content does); fix by aligning via justify-content instead, and update the alignment tests to match. Also regenerate messages.pot/po catalogs to pick up the new alignment control strings and a pre-existing drift from master. Co-Authored-By: Evan Rusackas <evan@preset.io> Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Extracts a renderViz helper for the three headerAlignment test cases in BigNumberViz.test.tsx, per bito-code-review's suggestion, so the ~13-prop render call lives in one place instead of three. Co-Authored-By: Evan Rusackas <evan@preset.io> Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Forces the text-container overflow path (block display) and confirms the header value and subheader stay centered via their own inline styles rather than the parent's disabled alignItems. Co-Authored-By: Evan Rusackas <evan@preset.io> Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
… layouts Co-Authored-By: Evan Rusackas <evan@preset.io> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Evan Rusackas <evan@preset.io> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Code Review Agent Run #e0573dActionable Suggestions - 0Additional Suggestions - 2
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
# Conflicts: # superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberViz.test.tsx
Co-Authored-By: Evan Rusackas <evan@preset.io> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Code Review Agent Run #06c89bActionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
SUMMARY
Fixes #37674.
Superset 5 let you center the Big Number value and subheader. The Emotion CSS-in-JS migration hardcoded
align-items: flex-starton the sharedBigNumberVizrender component, and there's been no way to get centered (or right-aligned) text back since — a user hit exactly this in #37674, asking how to center the value in v6.This adds a real
header_alignmentcontrol (Left / Center / Right) to both Big Number and Big Number with Trendline, rather than just documenting a custom-CSS workaround. Default isLeft, matching current behavior, so no dashboards change unless someone opts in.#37794attempted something in this area but its diff went well beyond alignment — dropped axis/grid config, the drill-to-detail context menu, conditional formatting, and forced date formatting along the way (confirmed by review). This PR is scoped to alignment only and doesn't touch any of that.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A — text-only style change, easiest to verify via the testing instructions below in Explore.
TESTING INSTRUCTIONS
Automated:
34 tests pass across all 6 suites in that directory, including 3 new alignment-specific tests in
BigNumberViz.test.tsx.ADDITIONAL INFORMATION
🤖 Generated with Claude Code