fix(frontend): prevent category chip clipping under scroll-fade mask (#974)#977
fix(frontend): prevent category chip clipping under scroll-fade mask (#974)#977ericsocrat merged 1 commit intomainfrom
Conversation
…974) Add horizontal padding (px-4) to the scroll container with compensating negative margin (-mx-4) so the first category chip is not masked by the scroll-fade-x gradient. Reset both on lg breakpoint where grid layout replaces horizontal scroll. Add test asserting scroll container has anti-clipping padding classes.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR fixes a mobile visual bug where the first category chip in CategoriesBrowse was clipped by the scroll-fade-x mask gradient by adding horizontal padding to the scroll container while preserving edge-to-edge layout via compensating negative margins.
Changes:
- Add
-mx-4 px-4to the horizontally scrollable<ul>and reset those atlg:where the layout switches to a grid. - Add a unit test asserting the scroll container includes the anti-clipping padding/margin classes.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
frontend/src/components/dashboard/CategoriesBrowse.tsx |
Adds padding and negative margins to ensure the first chip doesn’t sit under the fade mask on mobile while keeping the container edge-to-edge. |
frontend/src/components/dashboard/CategoriesBrowse.test.tsx |
Adds a regression test to assert the presence of the new padding/margin classes on the scroll list. |
Bundle Size Report
✅ Bundle size is within acceptable limits. |
Summary
Fixes #974 — the first category chip in the horizontal scroll was being clipped by the
scroll-fade-xCSS mask gradient on mobile. "Baby Food" appeared as "y Food".Root Cause
The
scroll-fade-xutility applies amask-imagegradient that fades fromtransparent→blackover the first1.5rem. Since the<ul>had no left padding, the first chip sat directly under this transparent zone and was visually clipped.Fix
Add
px-4(1rem horizontal padding) to the scroll container so content starts after the fade zone, with compensating-mx-4negative margin so the container still bleeds to screen edges. Both are reset onlg:breakpoint (lg:mx-0 lg:px-0) where the grid layout replaces horizontal scroll.Before: First category chip cut off under fade mask
After: Full chip visible with natural fade-in from edge
Changes
CategoriesBrowse.tsx-mx-4 px-4 lg:mx-0 lg:px-0to scroll<ul>CategoriesBrowse.test.tsxVerification
Test Added
px-4and-mx-4classes on the list elementPart of Epic #972 — Dashboard UI/UX Polish