Skip to content

fix(analytics): make the web analytics page usable on mobile and narrow columns - #564

Merged
Makisuo merged 1 commit into
mainfrom
fix/web-analytics-mobile
Aug 21, 2026
Merged

fix(analytics): make the web analytics page usable on mobile and narrow columns#564
Makisuo merged 1 commit into
mainfrom
fix/web-analytics-mobile

Conversation

@Makisuo

@Makisuo Makisuo commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

What

Makes the /analytics page work at phone width and in narrow content columns (desktop with both sidebars open):

  • KPI strip and breakdown grid now break on @min-[880px]/page container queries instead of lg: viewport breakpoints, matching the convention documented in traces-table.tsx — with both sidebars open the content column is up to ~512px narrower than the viewport, so the old lg: flipped to 4-up/2-up inside spaces that fit half that (tiles clipped under the grid's overflow-hidden).
  • Breakdown cards declare their own @container/panel. The in-card table's column shedding was accidentally gated on ranked, which is only true in the expand dialog — so the narrow card never shed anything. Now below 380px of panel width the card drops Share on non-Pages dimensions (the row's background bar still encodes it) and the secondary Sessions column on Pages; row padding tightens under 420px. The dialog keeps its viewport-based max-sm: rules, which are honest there (max-w-[92vw]).
  • The card filter input flexes (min-w-24 max-w-40 flex-1) beside the tabs instead of always wrapping to its own row (×4 panels).
  • Tiles tighten padding and step the value from 26px to 22px below 560px of container, via new optional className/valueClassName props on the shared StatRailItem — purely additive, no other rail changes behavior.
  • The traffic chart's fixed 52px axis gutter shrinks to 36px on phones (useMediaQuery("max-sm"); the margin is a JS number, so CSS can't reach it — and on phones the sidebars are sheets, so viewport ≈ container).

Verification

Checked in the browser against the dev server:

  • 375px: zero horizontal overflow, 2-up tiles with sparks intact ("26m 56s" fits), each breakdown card shows the name plus one readable numeric column, filter input inline on short-tab cards, expand dialog still sheds #/Share.
  • ~1280px with both sidebars open: strip stays 2×4, panels stack 1-col (previously clipped 4-up).
  • 1600px: strip 4-up, panels 2-up — no regression.
  • tsc --noEmit in apps/web passes; oxfmt clean.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

The analytics page picked its layouts off viewport breakpoints (lg:,
max-sm:) while the content column can be ~512px narrower than the
viewport with both sidebars open, so the KPI strip and breakdown grid
went 4-up/2-up inside spaces that fit half that. Switch both to the
@container/page convention (880px threshold), give each breakdown card
its own @container/panel so the in-card table sheds its Share/secondary
column below 380px — the shedding classes existed but were gated on
`ranked`, which is only true in the expand dialog — and let the card
filter input flex beside the tabs instead of always wrapping. Tiles
tighten padding and step the value to 22px under 560px of container via
new optional className/valueClassName props on StatRailItem, and the
chart's fixed 52px axis gutter drops to 36px on phones.
@Makisuo
Makisuo merged commit 3bf1d7a into main Aug 21, 2026
31 checks passed
@Makisuo
Makisuo deleted the fix/web-analytics-mobile branch August 21, 2026 19:08
@Makisuo
Makisuo deployed to pr-preview August 21, 2026 19:09 — with GitHub Actions Active
@github-actions

Copy link
Copy Markdown

🍁 Maple PR preview

Note

Preview resources were removed when this pull request closed.

Final commit a50fefc · View workflow run

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.

1 participant