Commit b961579
fix(dashboard): stop the shell scrolling sideways between 768px and ~890px (#588)
* fix(dashboard): stop the shell scrolling sideways between 768px and ~890px
Every `/dashboard/*` page could only be read by panning horizontally at
viewports between 768px and roughly 890px. Measured on the student
dashboard, the document was 87px wider than the viewport at 768px, 55px at
800px and 5px at 850px.
Two things collided, and both needed fixing.
`SidebarInset` was `w-full flex-1` with no `min-w-0`. As a flex item its
min-width resolved to `auto`, so it refused to shrink below its min-content
width and widened the document instead of letting the offending content clip
or scroll inside itself. That is a latent trap for any wide child — tables,
code blocks, charts — not only for the case found here.
The content that tripped it was the gamification header card, gated on
`hidden md:block`. The desktop sidebar also appears at `md` and takes 256px,
so the card arrived at exactly the moment the column it lives in got 256px
narrower. Teacher and admin dashboards, which render the same shell without
that card, never overflowed at any width — which is what isolated it.
The card now waits until `lg`. Between 768px and 1023px it is still
reachable in the avatar dropdown, whose gate moved from `md:hidden` to
`lg:hidden` in lockstep; the two breakpoints are a pair, and a test now
asserts the card is visible in exactly one of the two places at every width
rather than in neither. Losing the always-visible chips in that band is a
deliberate trade against a page that cannot be read without panning.
Also matched the card's loading skeleton to its loaded state
(`max-w-full overflow-hidden`), since the skeleton was briefly wider than the
thing it stood in for.
`tests/playwright/specs/overflow-586.spec.ts` walks student, teacher and
admin dashboards across 700/768/800/850/900/1024/1280 and asserts
`scrollWidth === clientWidth` everywhere. It fails on the parent commit with
exactly the numbers above.
Closes #586
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01183C2p5ed7youHQAUdPfR1
* docs(qa): before/after evidence for #586
Screenshots at 768px and 820px on the student dashboard and courses list,
plus a scrolled-fully-right frame showing what was unreachable before, and a
pair of GIFs sweeping the viewport from 700px to 1024px.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01183C2p5ed7youHQAUdPfR1
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 14a7832 commit b961579
16 files changed
Lines changed: 318 additions & 9 deletions
File tree
- app/[locale]/dashboard
- components
- gamification
- ui
- docs/qa
- tests/playwright/specs
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
34 | 41 | | |
35 | | - | |
| 42 | + | |
36 | 43 | | |
37 | 44 | | |
38 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| |||
30 | 32 | | |
31 | 33 | | |
32 | 34 | | |
33 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
34 | 39 | | |
35 | 40 | | |
36 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
307 | 307 | | |
308 | 308 | | |
309 | 309 | | |
310 | | - | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
311 | 315 | | |
312 | 316 | | |
313 | 317 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
85 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
86 | 90 | | |
87 | 91 | | |
88 | 92 | | |
| |||
Loading
Loading
Loading
Loading
Loading
0 commit comments