Repository navigation
fix(statistics): stop the chart pane from sizing an empty state by aspect ratio - #43
Conversation
WalkthroughThe chart pane now uses automatic height and a configurable minimum height when it contains ChangesChart pane empty-state sizing
Estimated code review effort: 1 (Trivial) | ~2 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/statistics/src/css/ChartPane.module.scss`:
- Around line 37-42: Update the :has(.statisticsEmpty) rule in
ChartPane.module.scss to use a shared exported or global empty-state marker
matching the class emitted by FluxStatisticsEmpty.vue from Empty.module.scss,
ensuring the height reset applies. Rebuild with the statistics package build
command and verify the generated selector matches the emitted class.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 7ed2298a-19a8-4dd2-9ea6-595a2717350b
📒 Files selected for processing (1)
packages/statistics/src/css/ChartPane.module.scss
Closes #42.
FluxStatisticsChartPanederives its container height from the pane's aspect ratio, which is right for a chart but wrong for aFluxStatisticsEmptyrendered as that chart's empty state: with:aspect-ratio="1"on a wide pane the card becomes a huge square holding one icon and two lines of text. It gets worse when the legend is hidden in the empty state, because the container then falls back fromcalc(40cqw / ratio)tocalc(100cqw / ratio).An empty state now gets a compact height instead, following the existing
&:has(.statisticsLegend)pattern:min-heightstays configurable through the pane'smin-heightprop, so a caller that wants a taller empty state still wins.This cannot be fixed downstream: class names are scoped per package, so an app consuming
@flux-ui/statisticscannot target.statisticsChartPaneContainer— not through:global(.statistics-chart-pane-container)(that name does not survive scoping) and not through a same-named class in its own module (which lands on a different scoped class).Summary by CodeRabbit