Skip to content

fix: improve mobile chart readability and fix label overflow#52

Merged
darcyclarke merged 1 commit intovltpkg:mainfrom
vltbaudbot:fix/mobile-chart-readability
Mar 5, 2026
Merged

fix: improve mobile chart readability and fix label overflow#52
darcyclarke merged 1 commit intovltpkg:mainfrom
vltbaudbot:fix/mobile-chart-readability

Conversation

@vltbaudbot
Copy link
Contributor

Follow-up to #50 addressing mobile chart feedback.

Problems

  1. Total time graph too small on mobile — the grouped bar chart crammed all fixtures into a tiny space, making the data nearly unreadable
  2. Labels overflow outside cards — package manager labels (e.g. "yarn v1.22.22") could float outside their containing card/box

Changes

Mobile horizontal bar charts

On screens < 768px, both the "Total Time" and "Per Package" charts now render as individual fixture cards with horizontal bar charts (bars go left→right). This gives each fixture its own readable space instead of cramming everything into one chart.

  • Package manager names on the Y-axis (stripped to just the name, no version to save space)
  • Full label with version still shows in tooltips
  • Each fixture card is self-contained and properly sized

Label overflow fix

All chart card containers now have overflow-hidden so labels can never escape their bounds.

Desktop unchanged

The grouped vertical bar chart layout on desktop is completely unchanged.

New files

  • app/src/hooks/use-media-query.ts — lightweight useMediaQuery hook for responsive layout switching

Screenshots

Desktop: unchanged
Mobile: horizontal bar charts per fixture instead of one tiny grouped chart

- On mobile, render horizontal bar charts per fixture instead of one
  tiny grouped chart — much more readable on narrow screens
- Add overflow-hidden to all card/chart containers to prevent labels
  from floating outside their bounds
- Strip version numbers from Y-axis labels on mobile to save space
- Use ResponsiveContainer for mobile charts to properly adapt width
- Add useMediaQuery hook for responsive chart layout switching
- Desktop layout unchanged — keeps the grouped bar chart

Co-authored-by: Darcy Clarke <darcy@darcyclarke.me>
@darcyclarke darcyclarke merged commit aedab30 into vltpkg:main Mar 5, 2026
1 check failed
vltbaudbot pushed a commit to vltbaudbot/benchmarks that referenced this pull request Mar 5, 2026
…iner

The mobile chart code paths (introduced in vltpkg#52) use <ResponsiveContainer>
instead of <ChartContainer>, but the tooltip inside them used
<ChartTooltipContent> which calls useChart() — a hook that requires
<ChartContainer>'s context. This throws immediately when Recharts renders
the tooltip component, crashing the app on screens < 768px.

Fix: Add a standalone MobileTooltipContent component that provides the
same tooltip UI without depending on useChart()/ChartContext. The desktop
code paths continue using ChartTooltipContent inside ChartContainer as
before.
lukekarrys pushed a commit that referenced this pull request Mar 5, 2026
…iner (#54)

The mobile chart code paths (introduced in #52) use <ResponsiveContainer>
instead of <ChartContainer>, but the tooltip inside them used
<ChartTooltipContent> which calls useChart() — a hook that requires
<ChartContainer>'s context. This throws immediately when Recharts renders
the tooltip component, crashing the app on screens < 768px.

Fix: Add a standalone MobileTooltipContent component that provides the
same tooltip UI without depending on useChart()/ChartContext. The desktop
code paths continue using ChartTooltipContent inside ChartContainer as
before.

Co-authored-by: baudbot-agent <baudbot-agent@users.noreply.github.com>
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.

3 participants