Skip to content

feat(catalog): implement materials catalog, faceted filters, and dedicated product details view - #4

Merged
pireu2 merged 1 commit into
mainfrom
feat/catalog-page-and-product-details
Aug 25, 2026
Merged

feat(catalog): implement materials catalog, faceted filters, and dedicated product details view#4
pireu2 merged 1 commit into
mainfrom
feat/catalog-page-and-product-details

Conversation

@pireu2

@pireu2 pireu2 commented Aug 25, 2026

Copy link
Copy Markdown
Owner

Summary of Changes

  • Materials Catalog Page (/catalog):
    • 2-column responsive layout connecting directly to /api/v1/core/products and /categories.
    • Search param synchronization (?category=...&search=...&page=...) for bookmarkable and shareable filter states.
    • Multi-faceted filter sidebar (Categories, Manufacturers multi-select, Price min/max).
    • Mobile collapsible filter drawer positioned at the top of the grid with active counter badge.
    • 300ms debounced search bar and active filter chips bar with quick removal.
    • Shimmering loading skeleton grid and pagination controls.
  • Dedicated Full Product Details Page (/catalog/[slug]):
    • Balanced 2-column layout with high-resolution imagery pixel-aligned to the specifications table.
    • Clean single-column physical & engineering properties table.
    • Price & action bar ("Generate Assembly Plan" and "Ask AI Copilot").
    • Compatible / similar companion materials grid.
  • Navigation Bar (Navbar.tsx):
    • Streamlined links to Catalog and Saved Projects, routing solution builds exclusively from the central home page hero prompt.

Copilot AI lite review requested due to automatic review settings August 25, 2026 15:50
@pireu2
pireu2 merged commit 209279b into main Aug 25, 2026
1 check passed
@pireu2
pireu2 deleted the feat/catalog-page-and-product-details branch August 25, 2026 15:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

There are build-blocking issues (missing @/lib/api/catalog module references and non-standard params: Promise<...> typing), plus a manufacturer facet logic issue that makes filters incomplete/stale.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds a new materials catalog experience to the Next.js frontend, introducing catalog types and a set of UI components/pages for browsing products with filters and viewing product details.

Changes:

  • Introduces catalog domain types (Category, Product, query/response shapes) for the frontend.
  • Adds /catalog listing page with filter sidebar, debounced search, sorting, skeleton loading, and pagination.
  • Adds /catalog/[slug] product details page plus reusable catalog UI components (cards, header, pagination, skeleton).
File summaries
File Description
frontend/src/types/catalog.ts Adds shared TypeScript types for categories/products and API responses.
frontend/src/components/layout/Navbar.tsx Updates navigation links (removes “Solution Architect/Start Build” entry points) and standardizes formatting.
frontend/src/components/catalog/ProductGridSkeleton.tsx Adds a loading skeleton grid for catalog results.
frontend/src/components/catalog/ProductDetailSheet.tsx Adds a slide-over product detail sheet component (currently standalone).
frontend/src/components/catalog/ProductCard.tsx Adds catalog product card UI with spec highlight badges.
frontend/src/components/catalog/Pagination.tsx Adds pagination controls for navigating result pages.
frontend/src/components/catalog/FilterSidebar.tsx Adds faceted filter sidebar (categories, manufacturers, price range) with reset behavior.
frontend/src/components/catalog/CatalogHeader.tsx Adds search, sort, and active filter chip UI for the catalog page.
frontend/src/app/catalog/page.tsx Implements the catalog page state management, URL sync, data loading, and responsive layout.
frontend/src/app/catalog/[slug]/page.tsx Implements the dedicated product details view and related-materials section.
frontend/next.config.ts Adjusts formatting while retaining env loading and Next config values.
Review details

Suppressed comments (3)

frontend/src/app/catalog/page.tsx:155

  • availableManufacturers is derived only once (when the list is empty) and only from the current page of results (response.data), so the Manufacturers facet will be incomplete for catalogs with >1 page and can become stale when filters change. Consider returning manufacturer facets from the API (or a dedicated endpoint) and setting availableManufacturers from that, or recomputing from an unpaginated source of truth.
          if (availableManufacturers.length === 0 && response.data.length > 0) {
            const mfgs = Array.from(
              new Set(
                response.data
                  .map((p) => p.manufacturer)
                  .filter(Boolean) as string[]
              )
            ).sort();
            setAvailableManufacturers(mfgs);
          }

frontend/src/app/catalog/[slug]/page.tsx:20

  • In Next.js App Router, params is provided as a plain object, not a Promise. Typing it as Promise<{ slug: string }> and awaiting it is non-standard and will likely cause type incompatibilities with Next's generated types.
interface ProductPageProps {
  params: Promise<{
    slug: string;
  }>;
}

frontend/src/components/catalog/ProductDetailSheet.tsx:62

  • Icon-only buttons should have an accessible name. Add an aria-label (and type="button") to this close button so screen readers can announce its purpose.
          <button
            onClick={onClose}
            className="h-8 w-8 rounded-lg flex items-center justify-center text-zinc-400 hover:text-zinc-900 hover:bg-zinc-100 transition-colors cursor-pointer"
          >
            <X className="h-5 w-5" />
          </button>
  • Files reviewed: 11/11 changed files
  • Comments generated: 7
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +11 to +12
import { fetchCategories, fetchProducts } from '@/lib/api/catalog';
import { Category, Product, ProductQueryParams } from '@/types/catalog';
Comment on lines +5 to +6
import { fetchProductByIdentifier, fetchProducts } from '@/lib/api/catalog';
import { ProductCard } from '@/components/catalog/ProductCard';
);
}

function extractSpecHighlights(data: Record<string, any> = []) {
Comment on lines +7 to +16
import {
X,
ArrowRight,
ShieldCheck,
FileText,
Sliders,
Check,
Building2,
Box,
} from 'lucide-react';
Comment on lines +57 to +61
<button
type="button"
onClick={() => onSearchChange('')}
className="absolute right-3 top-1/2 -translate-y-1/2 text-zinc-400 hover:text-zinc-600 cursor-pointer"
>
Comment on lines +33 to +47
<div className="flex items-center gap-1">
{Array.from({ length: totalPages }, (_, i) => i + 1).map((pageNum) => (
<button
key={pageNum}
onClick={() => onPageChange(pageNum)}
className={`h-9 w-9 rounded-lg text-xs font-mono font-medium transition-colors cursor-pointer ${
pageNum === currentPage
? 'bg-zinc-900 text-white font-semibold shadow-2xs'
: 'text-zinc-700 hover:bg-zinc-100 hover:text-zinc-950'
}`}
>
{pageNum}
</button>
))}
</div>
Comment on lines +141 to +145
<Link
href={`/solutions?query=${encodeURIComponent(`Tell me all technical details and installation constraints for ${product.name}`)}`}
>
<Button
variant="outline"
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.

2 participants