Skip to content

fix(frontend): remove global overflow-x-hidden and hide breadcrumbs on mobile#736

Merged
ericsocrat merged 3 commits intomainfrom
fix/697-remove-overflow-x-hidden
Mar 8, 2026
Merged

fix(frontend): remove global overflow-x-hidden and hide breadcrumbs on mobile#736
ericsocrat merged 3 commits intomainfrom
fix/697-remove-overflow-x-hidden

Conversation

@ericsocrat
Copy link
Owner

Summary

Closes #697

Removes the global overflow-x-hidden from 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)

  • Removed overflow-x-hidden from both the outer flex container and the inner content div
  • The inner div retains max-w-full to prevent layout blowout without clipping scroll containers

2. Hide breadcrumbs on mobile (Breadcrumbs.tsx)

  • Added hidden md:block classes to the <nav> element
  • Breadcrumbs are now hidden on screens < 768px, freeing up vertical space on mobile
  • Cascades to all 20+ pages using the component — no per-page changes needed

3. Fade-edge scroll indicators (globals.css + CategoriesBrowse + SettingsNav)

  • Added scroll-fade-x CSS utility using mask-image gradient for left/right fade edges
  • Added responsive md:scroll-fade-none and lg:scroll-fade-none variants to disable on larger screens
  • Applied to CategoriesBrowse (fades on mobile, grid on lg) and SettingsNav (fades on mobile, normal on md+)

Files Changed

File Change
frontend/src/app/app/layout.tsx Remove 2× overflow-x-hidden
frontend/src/components/layout/Breadcrumbs.tsx Add hidden md:block
frontend/src/components/layout/Breadcrumbs.test.tsx +1 test for mobile hidden behavior
frontend/src/components/dashboard/CategoriesBrowse.tsx Add scroll-fade-x lg:scroll-fade-none
frontend/src/components/settings/SettingsNav.tsx Add scroll-fade-x md:scroll-fade-none
frontend/src/styles/globals.css +32 lines: fade-edge scroll CSS utility

Verification

npx tsc --noEmit          → 0 errors
npx vitest run            → 5,119/5,119 tests pass (305 suites, 0 failures)
Breadcrumbs.test.tsx      → 11/11 pass (+1 new test)

Copilot AI review requested due to automatic review settings March 7, 2026 21:09
@vercel
Copy link

vercel bot commented Mar 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
tryvit Ready Ready Preview, Comment Mar 8, 2026 9:59am

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +716 to +719
transparent,
black 1.5rem,
black calc(100% - 1.5rem),
transparent

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-hidden from 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:block to the Breadcrumbs component to hide breadcrumbs on mobile screens, with a corresponding test
  • Added a scroll-fade-x CSS utility with responsive reset variants (md:scroll-fade-none, lg:scroll-fade-none) and applied it to CategoriesBrowse and SettingsNav

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

Comment on lines +713 to +728
.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
);
}
Copy link

Copilot AI Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@github-actions
Copy link

github-actions bot commented Mar 7, 2026

Bundle Size Report

Metric Value
Main baseline 3471 KB
This PR 3471 KB
Delta +0 KB (+0.0%)
JS chunks 135
Hard limit 4000 KB

✅ Bundle size is within acceptable limits.

Copilot AI review requested due to automatic review settings March 8, 2026 09:14
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.


return (
<nav aria-label={t("a11y.breadcrumb")} className="mb-3">
<nav aria-label={t("a11y.breadcrumb")} className="mb-3 hidden md:block">
Copy link

Copilot AI Mar 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
<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"
>

Copilot uses AI. Check for mistakes.
Comment on lines +177 to +178
expect(nav.className).toContain("hidden");
expect(nav.className).toContain("md:block");
Copy link

Copilot AI Mar 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
expect(nav.className).toContain("hidden");
expect(nav.className).toContain("md:block");
expect(nav).toHaveClass("hidden");
expect(nav).toHaveClass("md:block");

Copilot uses AI. Check for mistakes.
Comment on lines +712 to +728
/* ── 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
);
}
Copy link

Copilot AI Mar 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@ericsocrat ericsocrat merged commit ed0d41c into main Mar 8, 2026
18 of 20 checks passed
@ericsocrat ericsocrat deleted the fix/697-remove-overflow-x-hidden branch March 8, 2026 09:32
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.

fix(frontend): remove global overflow-x-hidden and hide breadcrumbs on mobile

2 participants