Skip to content

Conversation

@didrikhegna
Copy link
Member

  • Added language var to all relation components in GraphQL
  • Added prefetch to all storefront links
  • Fixed PDF renderer
  • Improved search, added an API route to so we don’t need to expose ENV variables
  • Removed linting warning for NEXT/IMAGE since it used fixed size image
  • Fixed occasional error when searching if product was missing image
  • Update boilerplate settings to accommodate new ENV variables
  • Removed relating products title on PDP if there was no relating products
  • Added som padding to the page class for lower resolutions

- Added language var to all relation components in GraphQL
- Added prefetch to all storefront links
- Fixed PDF renderer
- Improved search, added an API route to so we don’t need to expose ENV variables
- Removed linting warning for NEXT/IMAGE since it used fixed size image
- Fixed occasional error when searching if product was missing image
- Update boilerplate settings to accommodate new ENV variables
- Removed relating products title on PDP if there was no relating products
- Added som padding to the page class for lower resolutions
@vercel
Copy link

vercel bot commented Dec 5, 2025

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

Project Deployment Preview Updated (UTC)
nextjs-furnitut Ready Ready Preview Dec 5, 2025 11:41am

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 implements several miscellaneous improvements focused on performance optimization, API security, and responsive design. The key changes migrate environment variables from NEXT_PUBLIC_* to non-prefixed versions for server-side usage, add prefetch to all navigation links for improved page load performance, and create a new search API endpoint to avoid exposing environment variables to the client.

  • Migrated environment variables from NEXT_PUBLIC_* to server-side only variables for better security
  • Added prefetch={true} to all Link components across the application for performance optimization
  • Created a new /api/search route to handle search requests server-side instead of exposing GraphQL credentials to the client
  • Fixed PDF generation by removing unused marketIdentifiers parameter and improved error logging
  • Added language parameters to GraphQL relation components for proper localization
  • Improved responsive design with conditional padding for lower resolutions
  • Enhanced conditional rendering to hide empty sections (e.g., related products when none exist)

Reviewed changes

Copilot reviewed 30 out of 30 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
utils/api-request.ts Changed env vars to server-side only and improved GraphQL error handling
i18n/request.ts Updated language env variable to server-side only
components/variant-selector.tsx Added prefetch and improved code formatting
components/story.tsx Added prefetch to story links
components/product.tsx Added prefetch to product links
components/pdf/product/utils.ts Removed unused marketIdentifiers parameter
components/pdf/product/query.graphql Cleaned up query parameters
components/pagination.tsx Added prefetch to all pagination links
components/navigation.tsx Added prefetch to navigation links
components/hot-spot.tsx Added conditional prefetch for hotspot links
components/header.tsx Added prefetch to logo link
components/footer.tsx Added prefetch and improved responsive padding
components/command-palette/global-search.graphql Added score-based sorting to search
components/command-palette/command-palette.tsx Migrated to new search API endpoint and added null-safe image rendering
components/category.tsx Added prefetch to category links
components/breadcrumbs.tsx Added prefetch to breadcrumb links
components/block-pieces/story-slider.graphql Added language parameter to items query
components/block-pieces/product-slider.tsx Added page class for consistent padding
components/block-fragments/typography.tsx Improved conditional rendering for description
components/block-fragments/image.graphql Added language parameter to items query
components/ProductPage/index.tsx Added prefetch and improved conditional rendering for related products
app/globals.css Enhanced page utility class with responsive padding
app/api/search/route.ts New API endpoint for server-side search
app/api/pdf/route.tsx Added debug logging and cleaned up whitespace
app/(shop)/stories/page.tsx Fixed trailing comma formatting
app/(shop)/stories/[story]/query.graphql Added language parameters to relation queries
app/(shop)/stories/[story]/page.tsx Added prefetch to product links
app/(shop)/[...category]/page.tsx Updated env variable usage and improved page structure
.eslintrc.json Disabled img-element warning for fixed-size images
.crystallize/env Updated env variable names to server-side only

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
didrikhegna and others added 2 commits December 5, 2025 12:00
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link

Copilot AI commented Dec 5, 2025

@didrikhegna I've opened a new pull request, #70, to work on those changes. Once the pull request is ready, I'll request review from you.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI and others added 3 commits December 5, 2025 11:06
Co-authored-by: didrikhegna <22788785+didrikhegna@users.noreply.github.com>
Co-authored-by: didrikhegna <22788785+didrikhegna@users.noreply.github.com>
Add error handling for search API fetch request

return (
<Link
prefetch={true}
Copy link
Member

Choose a reason for hiding this comment

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

This seems to be true by default so no need to add it - https://nextjs.org/docs/pages/api-reference/components/link#prefetch


export const Typography = ({ title, description, callToAction, isFirstBlock }: TypographyProps) => {
const actions = callToAction?.action;
const hasDescription = description && description?.length > 0;
Copy link
Member

Choose a reason for hiding this comment

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

This can be just this const hasDescription = !!description?.length;

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.

3 participants