Unify headers and clean up removed shop components#96
Conversation
📝 WalkthroughWalkthroughReplaces legacy header and shop wrappers with AppChrome and UnifiedHeader, removes several old header/shop components, adds MainSwitcher and AppMobileMenu, migrates many Link imports to Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Layout as app/[locale]/layout.tsx
participant AppChrome
participant Segments as useSelectedLayoutSegments
participant CartProv as CartProvider
participant UnifiedHeader
participant MainSwitcher
participant Page
User->>Layout: request page
Layout->>AppChrome: render(userExists, showAdminLink){children: MainSwitcher}
AppChrome->>Segments: inspect layout segments
alt route includes "shop"
AppChrome->>CartProv: wrap children
CartProv->>UnifiedHeader: render(variant=shop, userExists, showAdminLink)
CartProv->>MainSwitcher: render(children)
else non-shop
AppChrome->>UnifiedHeader: render(variant=platform, userExists)
AppChrome->>MainSwitcher: render(children)
end
MainSwitcher->>Page: wrap in <main> or return children
Page->>User: render content
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (7)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
🔇 Additional comments (7)
Comment |
✅ Deploy Preview for develop-devlovers ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Actionable comments posted: 4
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
frontend/app/[locale]/shop/checkout/error/page.tsx (1)
116-136: Fix inconsistent link paths – missing/shopprefix in error page navigation.Links at lines 117, 124, and 131 are missing the
/shopprefix, causing navigation failures. All other error page links (lines 30–41, 60–71) correctly use/shop/cartand/shop/products, and this pattern is consistent across all other shop pages.🔎 Required fix for consistent shop path prefixes
<Link - href="/cart" + href="/shop/cart" className="inline-flex items-center justify-center rounded-md border border-border px-4 py-2 text-sm font-semibold uppercase tracking-wide text-foreground hover:bg-secondary" > Back to cart </Link> {isFailed && order.id && ( <Link - href={`/checkout/payment/${order.id}`} + href={`/shop/checkout/payment/${order.id}`} className="inline-flex items-center justify-center rounded-md bg-accent px-4 py-2 text-sm font-semibold uppercase tracking-wide text-accent-foreground hover:bg-accent/90" > Retry payment </Link> )} <Link - href="/products" + href="/shop/products" className="inline-flex items-center justify-center rounded-md border border-border px-4 py-2 text-sm font-semibold uppercase tracking-wide text-foreground hover:bg-secondary" > Continue shopping </Link>frontend/app/[locale]/shop/admin/products/page.tsx (1)
42-42: Remove redundant locale prefixes from lines 142 and 148.The Link component from
next-intlautomatically injects the locale whenlocalePrefix: 'always'is configured. Line 42 correctly useshref="/shop/admin/products/new", while lines 142 and 148 redundantly include the locale prefix explicitly. This is inconsistent with the rest of the codebase, where all other shop pages rely on automatic locale injection.Change:
- Line 142:
href={/${locale}/shop/products/${product.slug}}→href={/shop/products/${product.slug}}- Line 148:
href={/${locale}/shop/admin/products/${product.id}/edit}→href={/shop/admin/products/${product.id}/edit}
🧹 Nitpick comments (2)
frontend/lib/tests/prices.test.ts (1)
4-24: Consider optional test coverage for additional edge cases.The current tests validate the core logic well. For more comprehensive coverage, consider adding tests for:
Null/undefined
originalPriceMinor(should pass, since it's optional):it("accepts when originalPriceMinor is not provided", () => { const r = adminPriceRowSchema.safeParse({ currency: "USD", priceMinor: 1000, }); expect(r.success).toBe(true); });
originalPriceMinor < priceMinor(should fail, per the<=check):it("rejects originalPriceMinor < priceMinor", () => { const r = adminPriceRowSchema.safeParse({ currency: "USD", priceMinor: 1000, originalPriceMinor: 800, }); expect(r.success).toBe(false); });frontend/components/header/AppChrome.tsx (1)
15-40: Consolidate shop detection to a single shared utility.The component uses
segments.includes('shop')viauseSelectedLayoutSegments()whileMainSwitcherusesisShopPath()that parsesusePathname()withsegments[0] === 'shop' || segments[1] === 'shop'. Both correctly detect shop routes under the current routing structure (/[locale]/shop/*), but the different detection methods introduce unnecessary complexity and maintenance risk if routing patterns change.Consider extracting a shared
isShopPath()utility (or using the existing one) in both components to ensure consistency and reduce the risk of detection misalignment during future refactors.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (30)
frontend/app/[locale]/layout.tsxfrontend/app/[locale]/shop/admin/layout.tsxfrontend/app/[locale]/shop/admin/orders/[id]/page.tsxfrontend/app/[locale]/shop/admin/orders/page.tsxfrontend/app/[locale]/shop/admin/page.tsxfrontend/app/[locale]/shop/admin/products/page.tsxfrontend/app/[locale]/shop/cart/page.tsxfrontend/app/[locale]/shop/checkout/error/page.tsxfrontend/app/[locale]/shop/checkout/payment/StripePaymentClient.tsxfrontend/app/[locale]/shop/checkout/payment/[orderId]/page.tsxfrontend/app/[locale]/shop/checkout/success/page.tsxfrontend/app/[locale]/shop/layout.tsxfrontend/app/[locale]/shop/page.tsxfrontend/components/header/AppChrome.tsxfrontend/components/header/AppMobileMenu.tsxfrontend/components/header/HeaderSwitcher.tsxfrontend/components/header/MainSwitcher.tsxfrontend/components/header/SiteHeader.tsxfrontend/components/header/SiteMobileHeader.tsxfrontend/components/header/UnifiedHeader.tsxfrontend/components/shop/category-tile.tsxfrontend/components/shop/header/cart-button.tsxfrontend/components/shop/header/mobile-nav.tsxfrontend/components/shop/header/nav-links.tsxfrontend/components/shop/product-card.tsxfrontend/components/shop/shop-footer.tsxfrontend/components/shop/shop-header.tsxfrontend/components/shop/shop-hero.tsxfrontend/components/shop/shop-shell.tsxfrontend/lib/tests/prices.test.ts
💤 Files with no reviewable changes (6)
- frontend/components/shop/shop-header.tsx
- frontend/components/header/SiteHeader.tsx
- frontend/components/shop/shop-shell.tsx
- frontend/components/header/SiteMobileHeader.tsx
- frontend/components/shop/header/mobile-nav.tsx
- frontend/components/header/HeaderSwitcher.tsx
🧰 Additional context used
🧬 Code graph analysis (4)
frontend/components/header/MainSwitcher.tsx (1)
frontend/components/header/HeaderSwitcher.tsx (1)
MainSwitcher(34-41)
frontend/components/header/UnifiedHeader.tsx (6)
frontend/components/shop/header/nav-links.tsx (1)
NavLinks(38-75)frontend/lib/navigation.ts (1)
SITE_LINKS(1-9)frontend/components/shared/LanguageSwitcher.tsx (1)
LanguageSwitcher(8-72)frontend/components/shop/header/cart-button.tsx (1)
CartButton(9-28)frontend/components/auth/logoutButton.tsx (1)
LogoutButton(12-44)frontend/components/header/AppMobileMenu.tsx (1)
AppMobileMenu(19-121)
frontend/lib/tests/prices.test.ts (1)
frontend/lib/validation/shop.ts (1)
adminPriceRowSchema(173-198)
frontend/app/[locale]/layout.tsx (2)
frontend/components/header/AppChrome.tsx (1)
AppChrome(15-40)frontend/components/header/MainSwitcher.tsx (1)
MainSwitcher(11-18)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Redirect rules - develop-devlovers
- GitHub Check: Header rules - develop-devlovers
- GitHub Check: Pages changed - develop-devlovers
🔇 Additional comments (27)
frontend/components/shop/shop-hero.tsx (1)
1-1: LGTM! Import change aligns with i18n routing migration.The switch from
next/linkto the custom@/i18n/routingmodule is consistent with the project-wide standardization described in the PR objectives. The component logic remains unchanged, and the Link API usage (href, className props) is compatible with the new routing system.frontend/app/[locale]/shop/checkout/payment/[orderId]/page.tsx (1)
1-1: The custom routing module properly exports Link and is correctly implemented.The
@/i18n/routingmodule exports Link fromnext-intl/navigation, which provides i18n-aware routing as a drop-in replacement for Next.js Link. The import change is correct and all existing Link usages (lines 57, 62, 87, 92, 127, 133) are compatible with the new import.frontend/lib/tests/prices.test.ts (2)
5-13: LGTM! Test correctly validates equal prices rejection.The test accurately reflects the schema requirement that
originalPriceMinormust be strictly greater thanpriceMinor. The use of numeric minor units (1000 = $10.00 in cents) is appropriate.
15-23: LGTM! Test correctly validates the valid discount case.The test properly verifies that
originalPriceMinor > priceMinorpasses validation, representing a valid sale scenario ($12.00 → $10.00).frontend/app/[locale]/shop/checkout/payment/StripePaymentClient.tsx (1)
4-5: The import change to@/i18n/routingis correct and compatible with the current href patterns. The Link component exported from@/i18n/routinguses next-intl'screateNavigationwithlocalePrefix: 'always'configuration. When href values already include the locale prefix (e.g.,/${locale}/shop/cart), next-intl's Link intelligently recognizes the locale is already present and does not double-prefix. This manual locale prefixing pattern is consistently used across the entire codebase and functions correctly without causing double-prefixing issues.Likely an incorrect or invalid review comment.
frontend/app/[locale]/shop/checkout/success/page.tsx (1)
1-1: No changes needed—import change is compatible with Next.js 16.0.7.The Link component imported from
@/i18n/routingis provided by thenext-intllibrary viacreateNavigation(). The code uses the modern Link pattern (<Link href="...">text</Link>with className prop) that is fully compatible with Next.js 16.0.7. There are no nested<a>tags,legacyBehavior, orpassHrefprops—the patterns that were breaking in Next.js 16. Since the build and tests pass, the compatibility is confirmed.frontend/components/shop/shop-footer.tsx (1)
5-5: LGTM! Import migration to centralized routing module.The change from
next/linkto@/i18n/routingaligns with the broader PR objective of standardizing navigation imports across the codebase. The component logic remains unchanged.frontend/app/[locale]/shop/checkout/error/page.tsx (1)
1-1: LGTM! Import migration to centralized routing module.Consistent with the broader refactor to use
@/i18n/routingfor all Link imports.frontend/components/header/MainSwitcher.tsx (2)
6-9: LGTM! Shop path detection correctly handles localized routes.The
isShopPathhelper correctly checks bothsegments[0]andsegments[1]for 'shop', which accounts for both/shopand/[locale]/shoproute patterns.
11-18: LGTM! Conditional wrapping logic is correct.The component appropriately skips the
<main>wrapper for shop paths (since shop layout provides its own) and applies the wrapper with appropriate styling for non-shop routes.frontend/app/[locale]/shop/layout.tsx (1)
1-6: LGTM! Layout simplification aligns with the new architecture.The removal of
ShopShelland admin link logic, along with the addition ofshop-theme.css, correctly delegates wrapping and conditional rendering to the newAppChromeandUnifiedHeadercomponents introduced in this PR.frontend/components/header/AppMobileMenu.tsx (3)
19-40: LGTM! State management and effects are well-structured.The component correctly:
- Manages menu open/closed state
- Implements Escape key handling with proper cleanup
- Memoizes link selection based on variant to avoid unnecessary recalculations
43-62: LGTM! Accessible toggle button and overlay implementation.The toggle button includes proper ARIA attributes (
aria-label,aria-expanded,aria-controls), and the overlay pattern for closing the menu is a standard and effective approach for mobile navigation.
63-120: LGTM! Navigation panel with variant-aware link rendering.The mobile navigation correctly:
- Renders appropriate link sets based on variant (SITE_LINKS vs NAV_LINKS)
- Conditionally shows admin link when
variant === 'shop'andshowAdminLink === true- Handles authenticated vs unauthenticated states appropriately
- Closes the menu when links are clicked
frontend/components/shop/header/nav-links.tsx (1)
64-75: LGTM: Admin link rendering is correct.The conditional admin link rendering and navigation behavior are properly implemented.
frontend/components/shop/product-card.tsx (1)
3-3: LGTM: Link import standardization.The import change aligns with the PR's objective to standardize routing through
@/i18n/routing. The Link usage throughout the component remains unchanged and should work correctly in this client component context.frontend/app/[locale]/shop/page.tsx (1)
5-5: LGTM: Consistent routing standardization.The Link import change is consistent with the PR-wide routing refactor. This follows the same pattern as other server components in the PR.
frontend/app/[locale]/shop/admin/layout.tsx (1)
2-2: LGTM: Admin layout routing standardization.The Link import change standardizes routing for the admin layout navigation. This is consistent with the PR's objective to use the custom i18n routing Link throughout the application.
frontend/app/[locale]/shop/admin/orders/page.tsx (1)
1-1: Custom Link fully supports Server Components.The import change from
next/linkto@/i18n/routingis part of the routing standardization. The custom Link is sourced from next-intl/navigation, which has full Server Component support as a first-class feature since version 3.0. The page component uses Link correctly in a Server Component context with proper locale-based href resolution.frontend/app/[locale]/shop/cart/page.tsx (1)
4-5: Link import successfully migrated.The change aligns with the project-wide routing refactor. Note that Link usages at lines 112 and 157 use paths without the locale prefix (e.g.,
/shop/products), which differs from the admin pages pattern. This is expected if@/i18n/routinghandles locale injection automatically.frontend/components/shop/header/cart-button.tsx (1)
3-3: LGTM!The import migration is correct and consistent with the cart page. The Link usage at line 16 follows the same locale-free path pattern (
/shop/cart).frontend/app/[locale]/shop/admin/products/page.tsx (1)
1-1: Link import migration completed.frontend/components/shop/category-tile.tsx (1)
1-1: LGTM!The Link import migration is correct and the usage at line 12 (including query parameters) is compatible with the custom routing module.
frontend/app/[locale]/shop/admin/page.tsx (1)
1-1: LGTM! Import standardization for i18n routing.The switch from
next/linkto the project's@/i18n/routingLink aligns with the broader effort to unify localized navigation across the application.frontend/app/[locale]/layout.tsx (2)
31-32: LGTM! Clean derivation of layout flags.The local constants
userExistsandshowAdminNavLinkare derived correctly and improve readability of the AppChrome props.
42-44: LGTM! AppChrome composition centralizes header logic.The new composition pattern cleanly separates concerns:
AppChromemanages header variants and shop-specific context (CartProvider), whileMainSwitcherhandles the optional<main>wrapper based on route scope.frontend/components/header/UnifiedHeader.tsx (1)
23-136: Component structure is clean and well-organized.The unified header successfully consolidates platform and shop variants into a single component with clear separation of concerns across left, center, and right sections. The variant-based rendering logic is straightforward and the prop interface is well-defined.
| @@ -1,4 +1,5 @@ | |||
| import Link from "next/link"; | |||
| import { Link } from '@/i18n/routing'; | |||
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Search for any remaining imports from next/link across all JavaScript/TypeScript files
echo "=== Searching for next/link imports ==="
rg -n "from ['\"]next/link['\"]" --type tsx --type ts --type jsx --type js
echo ""
echo "=== Searching for require statements of next/link ==="
rg -n "require\(['\"]next/link['\"]" --type tsx --type ts --type jsx --type js
echo ""
echo "=== Total occurrences found ==="
rg "from ['\"]next/link['\"]|require\(['\"]next/link['\"]" --count-matchesRepository: DevLoversTeam/devlovers.net
Length of output: 492
🏁 Script executed:
#!/bin/bash
# Better search for next/link imports
echo "=== Searching for next/link imports ==="
rg "from ['\"]next/link['\"]" --no-heading
echo ""
echo "=== Count by file ==="
rg "from ['\"]next/link['\"]" -l | wc -l
echo ""
echo "=== Files containing next/link ==="
rg "from ['\"]next/link['\"]" -lRepository: DevLoversTeam/devlovers.net
Length of output: 742
Complete the locale-aware Link migration across remaining files.
The import change to the custom routing module is correct, but the migration is incomplete. Five other files are still using Next.js's default next/link import and should be updated:
- frontend/components/blog/BlogCard.tsx
- frontend/components/shared/Footer.tsx
- frontend/components/dashboard/StatsCard.tsx
- frontend/components/about/FeaturesSection.tsx
- frontend/components/legal/LegalPageShell.tsx
Update these files to use import { Link } from '@/i18n/routing' to fully centralize locale-aware navigation across the codebase.
🤖 Prompt for AI Agents
In frontend/app/[locale]/shop/admin/orders/[id]/page.tsx (and update the other
affected files listed below), the project has migrated to a custom locale-aware
Link but several components still import Next's Link; update imports in
frontend/components/blog/BlogCard.tsx, frontend/components/shared/Footer.tsx,
frontend/components/dashboard/StatsCard.tsx,
frontend/components/about/FeaturesSection.tsx, and
frontend/components/legal/LegalPageShell.tsx to use import { Link } from
'@/i18n/routing' instead of next/link; ensure you replace only the import line
and keep existing Link usage/props unchanged so routing remains locale-aware
across the app.
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (3)
frontend/components/header/UnifiedHeader.tsx (1)
90-106: Search button placeholder is now properly disabled.The search button correctly includes
disabled,aria-disabled="true", a descriptive title, and a TODO comment. This addresses the previous review feedback about the non-functional search button confusing users.frontend/components/shop/header/nav-links.tsx (2)
3-4: Correctly using i18n-awareusePathnamenow.The import has been updated to use
usePathnamefrom@/i18n/routingwhich returns locale-stripped paths, eliminating the need for manual locale stripping. This addresses the previous review feedback.
38-48: Active link logic is now correct.The implementation properly:
- Parses the link's query parameters to extract the category
- Compares both the pathname AND the category parameter
- Marks "All Products" active only when no category is in the URL
- Marks category links active only when the category matches
This resolves the critical bug where all category links were highlighted simultaneously.
🧹 Nitpick comments (2)
frontend/components/header/UnifiedHeader.tsx (2)
67-84: Platform navigation links lack active state highlighting.The shop variant uses
NavLinkswhich has active state logic, but the platform variant rendersSITE_LINKSdirectly without any active highlighting. Users won't see visual feedback for the current page.Consider extracting a similar active-state pattern or creating a shared component that both variants can use.
🔎 Example approach using pathname comparison
export function UnifiedHeader({ variant, userExists, showAdminLink = false, enableSearch = true, }: UnifiedHeaderProps) { const isShop = variant === 'shop'; + const pathname = usePathname(); return ( // ... ) : ( <div className="flex items-center gap-1"> {SITE_LINKS.map(link => ( <Link key={link.href} href={link.href} - className="rounded-md px-3 py-2 text-sm font-medium text-muted-foreground transition-colors hover:bg-secondary hover:text-foreground" + className={cn( + 'rounded-md px-3 py-2 text-sm font-medium transition-colors hover:bg-secondary hover:text-foreground', + pathname === link.href ? 'text-foreground' : 'text-muted-foreground' + )} > {link.label} </Link>You'd need to import
usePathnamefrom@/i18n/routingandcnfrom@/lib/utils.
55-63: Minor: Consider usingcn()utility for conditional className.The className construction using array join works but is inconsistent with other parts of the codebase that use the
cn()utility.🔎 Proposed change
<span - className={[ - 'hidden rounded bg-muted px-1.5 py-0.5 text-xs font-medium text-muted-foreground sm:inline', - isShop ? '' : 'invisible', - ].join(' ')} + className={cn( + 'hidden rounded bg-muted px-1.5 py-0.5 text-xs font-medium text-muted-foreground sm:inline', + !isShop && 'invisible' + )} aria-hidden={!isShop} >You'd need to import
cnfrom@/lib/utils.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
frontend/app/[locale]/shop/admin/products/page.tsxfrontend/app/[locale]/shop/checkout/error/page.tsxfrontend/components/header/UnifiedHeader.tsxfrontend/components/shop/header/nav-links.tsx
🧰 Additional context used
🧬 Code graph analysis (2)
frontend/components/shop/header/nav-links.tsx (2)
frontend/lib/config/catalog.ts (1)
CATEGORIES(1-9)frontend/lib/utils.ts (1)
cn(4-6)
frontend/components/header/UnifiedHeader.tsx (6)
frontend/components/shop/header/nav-links.tsx (1)
NavLinks(31-76)frontend/lib/navigation.ts (1)
SITE_LINKS(1-9)frontend/components/shared/LanguageSwitcher.tsx (1)
LanguageSwitcher(8-72)frontend/components/shop/header/cart-button.tsx (1)
CartButton(9-28)frontend/components/auth/logoutButton.tsx (1)
LogoutButton(12-44)frontend/components/header/AppMobileMenu.tsx (1)
AppMobileMenu(19-121)
🔇 Additional comments (5)
frontend/components/header/UnifiedHeader.tsx (1)
23-150: Overall component structure is clean and well-organized.The unified header successfully consolidates both platform and shop variants with:
- Proper accessibility attributes (
aria-label,aria-hidden)- Responsive design with separate desktop/mobile sections
- Good separation of concerns via composed child components
frontend/components/shop/header/nav-links.tsx (2)
9-23: NAV_LINKS label lookup is computed at module load time.The
CATEGORIES.find()calls execute once when the module is imported, not on every render. This is efficient and correct.One consideration: if a category slug doesn't exist in CATEGORIES, the fallback values (
'Apparel','Lifestyle','Collectibles') ensure the nav still works, but this could mask a configuration mismatch.
31-76: Clean implementation of the NavLinks component.The component correctly handles:
- i18n-aware pathname matching
- Query parameter parsing with safe fallback (
linkQuery ?? '')- Proper active state styling using the
cnutility- Optional admin link rendering
frontend/app/[locale]/shop/checkout/error/page.tsx (2)
31-31: The shop navigation paths are correctly updated.All navigation hrefs have been properly updated from root paths to
/shop/*prefixed paths. The updated routes exist in the app structure:
/shop/cart→frontend/app/[locale]/shop/cart/page.tsx/shop/products→frontend/app/[locale]/shop/products/page.tsx/shop/checkout/payment/[orderId]→frontend/app/[locale]/shop/checkout/payment/[orderId]/page.tsxThe changes are consistent across all occurrences and align with the shop-specific routing consolidation.
Also applies to: 37-37, 61-61, 67-67, 117-117, 124-124, 131-131
1-1: No changes needed. The import migration to@/i18n/routinguses the official next-intl library (v4.6.1), which exports the Link component via the standardcreateNavigation()pattern. The next-intl Link component is API-compatible with Next.js Link and handles automatic locale prefix management per the routing configuration. All usage in the file is correct.
| @@ -1,4 +1,4 @@ | |||
| import Link from 'next/link'; | |||
| import { Link } from '@/i18n/routing'; | |||
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify that all shop admin pages consistently use @/i18n/routing Link
# and have removed explicit locale prefixes from hrefs
echo "=== Checking Link imports in shop admin pages ==="
rg --type=tsx --type=ts -n "^import.*Link.*from" frontend/app/\[locale\]/shop/admin/ -A 1
echo -e "\n=== Checking for any remaining locale-prefixed hrefs in shop admin ==="
rg --type=tsx --type=ts -n 'href=.*\$\{locale\}' frontend/app/\[locale\]/shop/admin/Repository: DevLoversTeam/devlovers.net
Length of output: 265
🏁 Script executed:
#!/bin/bash
# Check the specific file to see the actual changes at lines 142, 148
echo "=== Checking products/page.tsx imports and Link usage ==="
head -5 frontend/app/\[locale\]/shop/admin/products/page.tsx
echo -e "\n=== Checking lines around 142, 148 for href changes ==="
sed -n '140,150p' frontend/app/\[locale\]/shop/admin/products/page.tsx
echo -e "\n=== All Link usages in the file ==="
rg --type=tsx -n "Link" frontend/app/\[locale\]/shop/admin/products/page.tsxRepository: DevLoversTeam/devlovers.net
Length of output: 1105
🏁 Script executed:
#!/bin/bash
# Verify the @/i18n/routing module exists and exports Link
echo "=== Checking @/i18n/routing module ==="
find . -path "*/i18n/routing*" -type f | head -20
echo -e "\n=== Checking if Link is exported from @/i18n/routing ==="
rg -n "export.*Link" --type=tsx --type=ts | grep -i "i18n/routing"Repository: DevLoversTeam/devlovers.net
Length of output: 239
🏁 Script executed:
#!/bin/bash
# Read the routing module to verify Link export
echo "=== Checking @/i18n/routing module for Link export ==="
cat ./frontend/i18n/routing.ts | head -50
echo -e "\n=== Verify if Link is exported ==="
grep -n "Link" ./frontend/i18n/routing.tsRepository: DevLoversTeam/devlovers.net
Length of output: 567
🏁 Script executed:
#!/bin/bash
# Read the full file to see all Link usages
echo "=== Full content of products/page.tsx ==="
cat -n frontend/app/\[locale\]/shop/admin/products/page.tsxRepository: DevLoversTeam/devlovers.net
Length of output: 7523
🏁 Script executed:
#!/bin/bash
# Check for Link imports and usage across shop admin pages without file type flags
echo "=== Link imports in shop admin pages ==="
grep -r "import.*Link" frontend/app/\[locale\]/shop/admin/ --include="*.ts" --include="*.tsx" -n
echo -e "\n=== Check for locale-prefixed hrefs in shop admin ==="
grep -r "href=.*\${locale}" frontend/app/\[locale\]/shop/admin/ --include="*.ts" --include="*.tsx" -nRepository: DevLoversTeam/devlovers.net
Length of output: 840
Fix inconsistency in shop admin pages: remove explicit locale prefixes from orders pages.
The changes to products/page.tsx are correct—the import from @/i18n/routing and removal of explicit locale prefixes from hrefs are properly aligned with the custom Link component (configured via next-intl with localePrefix: 'always'). However, verification found that other shop admin pages still use explicit locale-prefixed hrefs:
orders/[id]/page.tsx:47:href={/${locale}/shop/admin/orders}orders/page.tsx:87:href={/${locale}/shop/admin/orders/${order.id}}
Update these to match the pattern in products/page.tsx to complete the i18n routing unification across all shop admin pages.
🤖 Prompt for AI Agents
In frontend/app/[locale]/shop/admin/orders/[id]/page.tsx around line 47 and
frontend/app/[locale]/shop/admin/orders/page.tsx around line 87, fix
inconsistent locale-prefixed hrefs by removing the explicit `/${locale}` prefix
and using the project's custom Link behavior (ensure the file imports Link from
'@/i18n/routing' if not already). Replace
`href={`/${locale}/shop/admin/orders`}` with `href="/shop/admin/orders"` and
replace `href={`/${locale}/shop/admin/orders/${order.id}`}` with
`href={`/shop/admin/orders/${order.id}`}` (or the equivalent non-locale-prefixed
path), so the Link component handles locale-prefixing consistently across admin
shop pages.
…prefixed admin hrefs
Description
This PR unifies the platform and shop headers into a single, reusable header system and removes legacy duplicated header/shell components that were causing inconsistent behavior and broken imports after refactors.
Key goals:
Related Issue
Issue: #<issue_number>
Changes
UnifiedHeaderwithvariant="platform" | "shop") and centralized rendering viaAppChrometo ensure consistent behavior per route segment.CartProvider.Database Changes (if applicable)
How Has This Been Tested?
Notes:
npm run buildpasses successfully.npx vitest runpasses successfully.Screenshots (if applicable)
N/A (no screenshots attached in this PR).
Checklist
Before submitting
Reviewers
Summary by CodeRabbit
New Features
Refactor
Tests
✏️ Tip: You can customize this high-level summary in your review settings.