Skip to content

fix(statistics): stop the chart pane from sizing an empty state by aspect ratio - #43

Merged
basmilius merged 1 commit into
mainfrom
fix/42-chart-pane-empty-height
Aug 3, 2026
Merged

basmilius merged 1 commit into
mainfrom
fix/42-chart-pane-empty-height

Conversation

@basmilius

@basmilius basmilius commented Aug 3, 2026 •

Copy link
Copy Markdown
Owner

Closes #42.

FluxStatisticsChartPane derives its container height from the pane's aspect ratio, which is right for a chart but wrong for a FluxStatisticsEmpty rendered 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 from calc(40cqw / ratio) to calc(100cqw / ratio).

An empty state now gets a compact height instead, following the existing &:has(.statisticsLegend) pattern:

&:has(.statisticsEmpty) {
    .statisticsChartPaneContainer {
        height: auto;
        min-height: var(--min-height, 240px);
    }
}

min-height stays configurable through the pane's min-height prop, 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/statistics cannot 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

  • Style
    • Improved the chart pane’s empty state with a minimum height of 240px.
    • Added support for configuring the minimum height when needed.
    • Ensured the chart pane adapts its height automatically when no data is available.

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

The chart pane now uses automatic height and a configurable minimum height when it contains .statisticsEmpty. The default minimum height is 240px.

Changes

Chart pane empty-state sizing

Layer / File(s) Summary
Empty-state container sizing
packages/statistics/src/css/ChartPane.module.scss
When .statisticsEmpty is present, the chart container uses height: auto and min-height: var(--min-height, 240px).

Estimated code review effort: 1 (Trivial) | ~2 minutes

Poem

I’m a rabbit with a chart to mend,
Empty panes now neatly end.
Auto height and room to spare,
Two-forty keeps the layout fair.
Hop, hop, no square despair!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the fix for empty chart pane sizing and matches the primary change.
Linked Issues check ✅ Passed The change implements the linked issue by overriding aspect-ratio sizing for empty states while preserving configurable min-height support.
Out of Scope Changes check ✅ Passed The pull request changes only the statistics chart pane styling required to resolve the linked issue.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4493b1c and e4df8c0.

📒 Files selected for processing (1)
  • packages/statistics/src/css/ChartPane.module.scss

@basmilius
basmilius merged commit 37730ad into main Aug 3, 2026
1 check passed
@basmilius
basmilius deleted the fix/42-chart-pane-empty-height branch August 3, 2026 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Chart pane forces its aspect-ratio height onto FluxStatisticsEmpty

1 participant