Skip to content

Improve category page layout - #105

Merged
damianlegawiec merged 3 commits into
mainfrom
fix/category-layout
Apr 3, 2026
Merged

Improve category page layout#105
damianlegawiec merged 3 commits into
mainfrom
fix/category-layout

Conversation

@damianlegawiec

@damianlegawiec damianlegawiec commented Apr 3, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Style
    • Updated layout containers across storefront pages for improved responsive sizing.
    • Reworked category banner and header layout to display background image and content together.
    • Tweaked spacing and vertical rhythm for hero, product, cart, and product detail sections.
    • Enhanced dropdown appearance with a subtle shadow.
    • Adjusted filter button sizing and refined loading skeleton proportions for visual consistency.

@vercel

vercel Bot commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
storefront Ready Ready Preview, Comment Apr 3, 2026 9:28am

Request Review

@coderabbitai

coderabbitai Bot commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8d5934a0-d5d8-429d-a886-e8c0d9356060

📥 Commits

Reviewing files that changed from the base of the PR and between dbb2c26 and 7356244.

📒 Files selected for processing (3)
  • src/app/[country]/[locale]/(storefront)/c/[...permalink]/page.tsx
  • src/components/products/filters/ProductFilters.tsx
  • src/components/search/SearchBar.tsx
✅ Files skipped from review due to trivial changes (2)
  • src/components/search/SearchBar.tsx
  • src/components/products/filters/ProductFilters.tsx

Walkthrough

Replaces multiple page wrapper max-w-7xl utilities with container, removes the CategoryBanner component and inlines its banner markup on the category page, adjusts a few UI classes (dropdown shadow, filter button size, skeleton heights), and tweaks spacing in several wrappers.

Changes

Cohort / File(s) Summary
Container Layout Migration
src/app/[country]/[locale]/(storefront)/account/layout.tsx, src/app/[country]/[locale]/(storefront)/c/[...permalink]/loading.tsx, src/app/[country]/[locale]/(storefront)/cart/page.tsx, src/app/[country]/[locale]/(storefront)/page.tsx, src/app/[country]/[locale]/(storefront)/products/ProductsContent.tsx, src/app/[country]/[locale]/(storefront)/products/[slug]/ProductDetails.tsx, src/components/search/SearchBar.tsx
Replaced max-w-7xl with container on multiple layout wrappers; minor spacing adjustments in class strings (extra spaces near py-*).
Category banner removal & category page changes
src/components/navigation/CategoryBanner.tsx, src/app/[country]/[locale]/(storefront)/c/[...permalink]/page.tsx
Removed CategoryBanner component; replaced its usage with an inline <div> using category.image_url as a background image and moved Breadcrumbs/title/description into that banner container; adjusted subcategory layout and spacing.
Filter & Skeleton tweaks
src/components/products/filters/FilterDropdown.tsx, src/components/products/filters/ProductFilters.tsx
Set Button trigger to size="sm" in FilterDropdown; reduced skeleton row heights/widths in ProductFilters loading UI (h-10h-9, some w-* adjustments).
Dropdown styling
src/components/ui/dropdown-menu.tsx
Added shadow-lg to default DropdownMenuContent className.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰
I hopped through classes, soft and fleet,
swapped bounds for containers, tidy and neat.
Banners baked into the page with care,
shadows fluffed, small buttons there —
a tiny hop for storefront flair. 🥕

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title 'Improve category page layout' is overly broad and does not accurately reflect the scope of changes, which extend beyond the category page to multiple storefront pages, components, and UI elements. Consider a more specific title such as 'Replace max-w-7xl with container utility across storefront' or 'Refactor layout containers and styling for consistency' that better represents the comprehensive nature of these changes.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/category-layout

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/app/`[country]/[locale]/(storefront)/c/[...permalink]/page.tsx:
- Around line 53-71: The banner currently uses category.image_url as a
background and renders dark text (the h1 in the div and the description
paragraph) directly on top, which can be unreadable; update the banner container
(the div that uses style={{ backgroundImage: `url(${category.image_url})` }}) to
be position: relative and add a full-size absolutely positioned overlay element
between the background and content that applies a semi-opaque dark gradient
(e.g., rgba(0,0,0,0.4) or a left-to-right gradient) to increase contrast, and
update the heading and description text styles (the h1 and the conditional p
rendering category.description) to use a light color (e.g., text-white or
similar) so the text remains readable over bright images.

In `@src/components/products/filters/ProductFilters.tsx`:
- Around line 139-141: The skeleton placeholder divs in ProductFilters.tsx use
the invalid Tailwind utility `w-18`; replace each occurrence of `w-18` in the
three divs (the two left placeholders and the one with `ml-auto`) with a valid
width such as `w-16` or `w-20` so the skeletons render correctly and are not
stripped at build time.

In `@src/components/search/SearchBar.tsx`:
- Line 191: Remove the trailing space in the className string on the div in the
SearchBar component: find the div with className "container mx-auto px-4 sm:px-6
lg:px-8 " and change it to "container mx-auto px-4 sm:px-6 lg:px-8" (no trailing
space) to keep className tidy.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 860fc24e-fb3f-49e2-bce6-5a99fd3f36db

📥 Commits

Reviewing files that changed from the base of the PR and between 652b11a and dbb2c26.

📒 Files selected for processing (12)
  • src/app/[country]/[locale]/(storefront)/account/layout.tsx
  • src/app/[country]/[locale]/(storefront)/c/[...permalink]/loading.tsx
  • src/app/[country]/[locale]/(storefront)/c/[...permalink]/page.tsx
  • src/app/[country]/[locale]/(storefront)/cart/page.tsx
  • src/app/[country]/[locale]/(storefront)/page.tsx
  • src/app/[country]/[locale]/(storefront)/products/ProductsContent.tsx
  • src/app/[country]/[locale]/(storefront)/products/[slug]/ProductDetails.tsx
  • src/components/navigation/CategoryBanner.tsx
  • src/components/products/filters/FilterDropdown.tsx
  • src/components/products/filters/ProductFilters.tsx
  • src/components/search/SearchBar.tsx
  • src/components/ui/dropdown-menu.tsx
💤 Files with no reviewable changes (1)
  • src/components/navigation/CategoryBanner.tsx

Comment on lines +53 to +71
<div
className="flex flex-col justify-end min-h-[350px] bg-gray-50 bg-cover bg-center"
style={{ backgroundImage: `url(${category.image_url})` }}
>
<div className="container mx-auto px-4 sm:px-6 lg:px-8 ">
<Breadcrumbs category={category} basePath={basePath} />

<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
<Breadcrumbs category={category} basePath={basePath} />
<div className="mb-4">
<h1 className="text-4xl font-bold text-gray-900">
{category.name}
</h1>
</div>

<div className="mb-8">
<h1 className="text-3xl font-bold text-gray-900">{category.name}</h1>
{/* Description */}
{category.description && (
<p className="mb-4 text-gray-600">{category.description}</p>
)}
</div>
</div>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Add a contrast overlay for banner text readability.

Line 54–55 place dark text over arbitrary category images. On bright images, heading/description can become unreadable (accessibility blocker).

Suggested fix
-      <div
-        className="flex flex-col justify-end min-h-[350px] bg-gray-50 bg-cover bg-center"
-        style={{ backgroundImage: `url(${category.image_url})` }}
-      >
-        <div className="container mx-auto px-4 sm:px-6 lg:px-8 ">
+      <div
+        className="relative flex flex-col justify-end min-h-[350px] bg-gray-50 bg-cover bg-center"
+        style={
+          category.image_url
+            ? { backgroundImage: `url(${category.image_url})` }
+            : undefined
+        }
+      >
+        {category.image_url && (
+          <div className="absolute inset-0 bg-black/35" aria-hidden="true" />
+        )}
+        <div className="relative container mx-auto px-4 sm:px-6 lg:px-8">
           <Breadcrumbs category={category} basePath={basePath} />
 
           <div className="mb-4">
-            <h1 className="text-4xl font-bold text-gray-900">
+            <h1 className="text-4xl font-bold text-white">
               {category.name}
             </h1>
           </div>
 
           {/* Description */}
           {category.description && (
-            <p className="mb-4 text-gray-600">{category.description}</p>
+            <p className="mb-4 text-white/90">{category.description}</p>
           )}
         </div>
       </div>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<div
className="flex flex-col justify-end min-h-[350px] bg-gray-50 bg-cover bg-center"
style={{ backgroundImage: `url(${category.image_url})` }}
>
<div className="container mx-auto px-4 sm:px-6 lg:px-8 ">
<Breadcrumbs category={category} basePath={basePath} />
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
<Breadcrumbs category={category} basePath={basePath} />
<div className="mb-4">
<h1 className="text-4xl font-bold text-gray-900">
{category.name}
</h1>
</div>
<div className="mb-8">
<h1 className="text-3xl font-bold text-gray-900">{category.name}</h1>
{/* Description */}
{category.description && (
<p className="mb-4 text-gray-600">{category.description}</p>
)}
</div>
</div>
<div
className="relative flex flex-col justify-end min-h-[350px] bg-gray-50 bg-cover bg-center"
style={
category.image_url
? { backgroundImage: `url(${category.image_url})` }
: undefined
}
>
{category.image_url && (
<div className="absolute inset-0 bg-black/35" aria-hidden="true" />
)}
<div className="relative container mx-auto px-4 sm:px-6 lg:px-8">
<Breadcrumbs category={category} basePath={basePath} />
<div className="mb-4">
<h1 className="text-4xl font-bold text-white">
{category.name}
</h1>
</div>
{/* Description */}
{category.description && (
<p className="mb-4 text-white/90">{category.description}</p>
)}
</div>
</div>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/app/`[country]/[locale]/(storefront)/c/[...permalink]/page.tsx around
lines 53 - 71, The banner currently uses category.image_url as a background and
renders dark text (the h1 in the div and the description paragraph) directly on
top, which can be unreadable; update the banner container (the div that uses
style={{ backgroundImage: `url(${category.image_url})` }}) to be position:
relative and add a full-size absolutely positioned overlay element between the
background and content that applies a semi-opaque dark gradient (e.g.,
rgba(0,0,0,0.4) or a left-to-right gradient) to increase contrast, and update
the heading and description text styles (the h1 and the conditional p rendering
category.description) to use a light color (e.g., text-white or similar) so the
text remains readable over bright images.

Comment thread src/components/products/filters/ProductFilters.tsx Outdated
Comment thread src/components/search/SearchBar.tsx Outdated
@damianlegawiec
damianlegawiec merged commit 5966caa into main Apr 3, 2026
6 checks passed
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.

1 participant