fix(frontend): remove global overflow-x-hidden and hide breadcrumbs on mobile#736
fix(frontend): remove global overflow-x-hidden and hide breadcrumbs on mobile#736ericsocrat merged 3 commits intomainfrom
Conversation
…obile, add fade-edge scroll indicators
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4fb32c710c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| transparent, | ||
| black 1.5rem, | ||
| black calc(100% - 1.5rem), | ||
| transparent |
There was a problem hiding this comment.
Avoid clipping edge items with scroll fade mask
The new .scroll-fade-x utility always applies transparent regions at both horizontal edges, which means the first and last 1.5rem of content are permanently masked. In the updated mobile uses (SettingsNav and CategoriesBrowse), those scroll containers do not add compensating side padding, so edge tab/chip labels and icons are visually cut off even when at the start/end (or when the row does not overflow), which is a user-visible regression in readability and affordance.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Pull request overview
This PR fixes horizontal scroll containers being clipped by a global overflow-x-hidden rule, hides breadcrumbs on mobile to save vertical space, and adds CSS fade-edge indicators to signal scrollable content.
Changes:
- Removed
overflow-x-hiddenfrom both the outer flex container and inner content div in the app layout, allowing horizontal scroll containers (carousels, chips) to work properly - Added
hidden md:blockto theBreadcrumbscomponent to hide breadcrumbs on mobile screens, with a corresponding test - Added a
scroll-fade-xCSS utility with responsive reset variants (md:scroll-fade-none,lg:scroll-fade-none) and applied it toCategoriesBrowseandSettingsNav
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
frontend/src/app/app/layout.tsx |
Removed two overflow-x-hidden classes from root layout containers |
frontend/src/components/layout/Breadcrumbs.tsx |
Added hidden md:block to hide breadcrumbs on screens < 768px |
frontend/src/components/layout/Breadcrumbs.test.tsx |
Added test verifying mobile-hidden classes are present |
frontend/src/components/dashboard/CategoriesBrowse.tsx |
Applied scroll-fade-x lg:scroll-fade-none to the scrollable category list |
frontend/src/components/settings/SettingsNav.tsx |
Applied scroll-fade-x md:scroll-fade-none to the tab navigation |
frontend/src/styles/globals.css |
Added scroll-fade-x CSS utility and responsive reset variants |
| .scroll-fade-x { | ||
| mask-image: linear-gradient( | ||
| to right, | ||
| transparent, | ||
| black 1.5rem, | ||
| black calc(100% - 1.5rem), | ||
| transparent | ||
| ); | ||
| -webkit-mask-image: linear-gradient( | ||
| to right, | ||
| transparent, | ||
| black 1.5rem, | ||
| black calc(100% - 1.5rem), | ||
| transparent | ||
| ); | ||
| } |
There was a problem hiding this comment.
The scroll-fade-x mask is static — it always fades both edges regardless of scroll position. When the container is scrolled to the very start, the leftmost content will still be partially masked even though there's nothing further to the left. Similarly, when scrolled to the end, the rightmost item is faded.
Consider adding horizontal padding to the scroll containers (e.g., px-6) so the 1.5rem fade region overlaps the padding rather than the content. This would ensure items are fully visible at the scroll extremes while still showing the fade effect in the middle of the scroll range.
Bundle Size Report
✅ Bundle size is within acceptable limits. |
|
|
||
| return ( | ||
| <nav aria-label={t("a11y.breadcrumb")} className="mb-3"> | ||
| <nav aria-label={t("a11y.breadcrumb")} className="mb-3 hidden md:block"> |
There was a problem hiding this comment.
Hiding the breadcrumb navigation entirely on mobile with hidden means screen reader users on mobile devices lose access to breadcrumb navigation. Consider using a visually-hidden approach (e.g. sr-only) or keeping the nav accessible to assistive technologies while only visually hiding it, so mobile screen reader users can still orient themselves within the page hierarchy.
| <nav aria-label={t("a11y.breadcrumb")} className="mb-3 hidden md:block"> | |
| <nav | |
| aria-label={t("a11y.breadcrumb")} | |
| className="mb-3 sr-only md:not-sr-only md:block" | |
| > |
| expect(nav.className).toContain("hidden"); | ||
| expect(nav.className).toContain("md:block"); |
There was a problem hiding this comment.
This test asserts on specific CSS class name strings rather than testing behavior. It's essentially testing implementation details (that certain Tailwind classes are present) rather than the actual rendering outcome. Since JSDOM doesn't apply CSS media queries, truly testing the mobile-hidden behavior isn't possible here anyway. If the intent is just to guard against accidental class removal, consider using toHaveClass('hidden', 'md:block') from @testing-library/jest-dom for a cleaner assertion, but be aware this remains an implementation-detail test.
| expect(nav.className).toContain("hidden"); | |
| expect(nav.className).toContain("md:block"); | |
| expect(nav).toHaveClass("hidden"); | |
| expect(nav).toHaveClass("md:block"); |
| /* ── Fade-edge scroll indicator ── */ | ||
| .scroll-fade-x { | ||
| mask-image: linear-gradient( | ||
| to right, | ||
| transparent, | ||
| black 1.5rem, | ||
| black calc(100% - 1.5rem), | ||
| transparent | ||
| ); | ||
| -webkit-mask-image: linear-gradient( | ||
| to right, | ||
| transparent, | ||
| black 1.5rem, | ||
| black calc(100% - 1.5rem), | ||
| transparent | ||
| ); | ||
| } |
There was a problem hiding this comment.
The permanent fade masks on both edges can clip the first and last items even when the container is not scrolled (or is scrolled all the way). Consider adding a brief comment noting this intentional trade-off, or mentioning that a JS-based approach could conditionally show/hide each edge fade based on scroll position.
Summary
Closes #697
Removes the global
overflow-x-hiddenfrom the app layout that was clipping horizontal scroll containers, hides breadcrumbs on mobile to save vertical space, and adds fade-edge scroll indicators to signal scrollable content.Changes
1. Remove global
overflow-x-hidden(layout.tsx)overflow-x-hiddenfrom both the outer flex container and the inner content divmax-w-fullto prevent layout blowout without clipping scroll containers2. Hide breadcrumbs on mobile (Breadcrumbs.tsx)
hidden md:blockclasses to the<nav>element3. Fade-edge scroll indicators (globals.css + CategoriesBrowse + SettingsNav)
scroll-fade-xCSS utility usingmask-imagegradient for left/right fade edgesmd:scroll-fade-noneandlg:scroll-fade-nonevariants to disable on larger screensCategoriesBrowse(fades on mobile, grid on lg) andSettingsNav(fades on mobile, normal on md+)Files Changed
frontend/src/app/app/layout.tsxoverflow-x-hiddenfrontend/src/components/layout/Breadcrumbs.tsxhidden md:blockfrontend/src/components/layout/Breadcrumbs.test.tsxfrontend/src/components/dashboard/CategoriesBrowse.tsxscroll-fade-x lg:scroll-fade-nonefrontend/src/components/settings/SettingsNav.tsxscroll-fade-x md:scroll-fade-nonefrontend/src/styles/globals.cssVerification