fix(analytics): make the web analytics page usable on mobile and narrow columns - #564
Merged
Conversation
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.
🍁 Maple PR previewNote Preview resources were removed when this pull request closed. Final commit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Makes the
/analyticspage work at phone width and in narrow content columns (desktop with both sidebars open):@min-[880px]/pagecontainer queries instead oflg:viewport breakpoints, matching the convention documented intraces-table.tsx— with both sidebars open the content column is up to ~512px narrower than the viewport, so the oldlg:flipped to 4-up/2-up inside spaces that fit half that (tiles clipped under the grid'soverflow-hidden).@container/panel. The in-card table's column shedding was accidentally gated onranked, 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-basedmax-sm:rules, which are honest there (max-w-[92vw]).min-w-24 max-w-40 flex-1) beside the tabs instead of always wrapping to its own row (×4 panels).className/valueClassNameprops on the sharedStatRailItem— purely additive, no other rail changes behavior.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:
#/Share.tsc --noEmitin apps/web passes; oxfmt clean.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.