Fix/homepage config resolver#9
Conversation
extractHomepageSource returned the whole tenant record before descending into design.layout.homepage, because the "looks like a homepage config" guard passes when version and sections are absent (always true for the store record). Published homepages were never read, so every shop fell back to the default. Resolve the nested homepage first, keep the whole-record check as a last resort. Also allowlist the local media host for next/image so the hero image renders in dev.
Replace the Spree fallback logo with the OLITT logo and change the footer to "Powered by OLITT" (links olitt.com).
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
There was a problem hiding this comment.
Pull request overview
This PR fixes homepage configuration resolution so the storefront can render each tenant’s published homepage (preferring nested design.layout.homepage over treating the whole tenant record as a config), and updates default storefront branding to OLITT (logo + footer attribution). It also updates Next.js image allowlisting for local media during development.
Changes:
- Adjust homepage source extraction to resolve nested homepage config before falling back to the root source.
- Update default branding (header logo + footer “Powered by” link/text) and add the OLITT logo asset.
- Allowlist
http://127.0.0.1:9000/media/**innext/imageremotePatterns for dev media.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/lib/homepage/index.ts | Changes homepage config source selection order to prefer nested config. |
| src/components/layout/Header.tsx | Switches default header logo to OLITT asset. |
| src/components/layout/Footer.tsx | Updates footer attribution link/text to OLITT. |
| public/olitt-logo.svg | Adds OLITT logo SVG asset. |
| next.config.ts | Adds local media host remotePattern for next/image in dev. |
Comments suppressed due to low confidence (1)
src/components/layout/Header.tsx:77
- The header logo default was changed to an SVG, but next/image will try to route it through the image optimizer which can 400 on SVGs unless you opt out. Consider marking SVG logos as unoptimized (or render with a plain
) to avoid a broken header logo.
<Image
src={branding.logoUrl ?? "/olitt-logo.svg"}
alt={branding.name ?? getStoreName()}
width={90}
height={32}
className="max-w-full object-contain"
style={{ width: "auto", height: "auto" }}
fetchPriority="high"
loading="eager"
/>
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Cover getHomepageConfig reading the tenant homepage nested at design.layout.homepage, cleared social proof not leaking through the default merge, section order preservation, and the default fallback when no homepage is present. Fails on the pre-fix resolver ordering.
Add rel="noopener noreferrer" to the OLITT footer link to match the file's other external links, insert an explicit space so "Powered by" renders separately from "OLITT" across all locales, and drop the redundant homepage-source self-check that returned source on both branches.
Makes the customer storefront show each shop's published homepage and
carry OLITT branding.
Homepage
The resolver treated the whole tenant record as a homepage config and
never read design.layout.homepage (its guard passes when version/sections
are absent, always true for the store record), so every shop rendered
the generic default. Now it resolves the nested homepage first, with the
old behaviour preserved as a fallback.
Branding
Header logo defaults to the OLITT logo and the footer reads "Powered by
OLITT".
Also, next/image now allowlists the local media host for dev; the
production storefront-image host must be added to images.remotePatterns
or hero images will 400 in prod.