Skip to content

Conversation

@robinbaxon
Copy link
Contributor

Checklist

  • Give Sweden a headsup of the changes made so that they can update their website
  • The design works for both desktop and mobile
  • The new component doesn't already exist and exisitng component can't be expanded to cover the new functionality
  • New functions that can be used in multiple components has been put in a utils directory
  • The new link is added correctly in schema for the possibility to choose internal and external in Sanity Studio

@vercel
Copy link

vercel bot commented Nov 18, 2025

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

Project Deployment Preview Comments Updated (UTC)
variant-no Ready Ready Preview Comment Nov 26, 2025 1:46pm
variant-se-2 Ready Ready Preview Comment Nov 26, 2025 1:46pm

Copy link
Contributor

@anemne anemne left a comment

Choose a reason for hiding this comment

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

Looks good to me 🙌

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 fixes a bug related to the preview functionality for customer cases by refactoring data fetching logic and improving error handling in the page builder schema.

Key Changes:

  • Refactored customer cases data fetching from server component to preview component using useQuery
  • Updated pageBuilder prepare function to handle uninitialized fields gracefully instead of throwing errors
  • Modified CustomerCases component from async server component to synchronous client component

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
studio/schemas/documents/pageBuilder.ts Replaced type-checking errors with defensive null handling for title/slug fields
src/components/customerCases/CustomerCasesPreview.tsx Added useQuery hook for customer cases list data with proper initial data handling
src/components/customerCases/CustomerCases.tsx Converted from async server component to synchronous component receiving data as props
src/app/(main)/[locale]/[...path]/page.tsx Added customer cases data fetching logic for both draft and production modes

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

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

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.


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

@robinbaxon robinbaxon force-pushed the fix-preview-usequery-bug branch from e9564a4 to 3a3c28c Compare November 26, 2025 13:08
@robinbaxon robinbaxon requested a review from Copilot November 26, 2025 13:08
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

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.


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

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

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.


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

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

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.


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

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

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.


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

@robinbaxon robinbaxon changed the title Fix preview usequery bug fix: amend customercases preview components, use initialdata+client-side live-data Nov 26, 2025
@robinbaxon robinbaxon changed the title fix: amend customercases preview components, use initialdata+client-side live-data fix: amend customercases preview component, use initialdata+client-side live-data Nov 26, 2025
@robinbaxon robinbaxon changed the title fix: amend customercases preview component, use initialdata+client-side live-data fix: amend customercases preview component, use initial data from server and fetch live data from client Nov 26, 2025
…fetch updates clientside

fix: query customercases data server side, fetch updates clientside
@robinbaxon robinbaxon force-pushed the fix-preview-usequery-bug branch from b510f77 to 906b925 Compare November 26, 2025 13:42
@robinbaxon robinbaxon merged commit 656007d into v3 Nov 26, 2025
6 checks passed
@robinbaxon robinbaxon deleted the fix-preview-usequery-bug branch November 26, 2025 13:48
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