Skip to content

Conversation

kenjonespizza
Copy link
Collaborator

@kenjonespizza kenjonespizza commented Sep 12, 2025

Description: Image System Overhaul & Page Builder Enhancements

This PR introduces significant improvements to the image handling system, enhances the page builder architecture, and modernizes the design system with better typography and visual editing support.

What to review

PageBuilder Improvements (See internal slack thread here)

  • Refactored render functions to use proper React components (JSX) instead of function calls to prevent hook ordering issues
  • Fixed useOptimistic hook compatibility for drag-and-drop functionality in visual editing
  • Improved empty state handling with Sanity data attributes
  • Better TypeScript support with PageBuilderSection type definition

Enhanced CTA Component

  • Complete redesign with rich content support:
    • Eyebrow text
    • Body content
    • Image integration
  • Dark theme support with built-in theme toggle
  • Flexible content alignment options (text-first/image-first layouts)
  • Visual enhancement with background tile patterns

Major version bump: next-sanity v10.0.14 → v11.1.0

Replaced next-sanity/image with sanity-image library

  • Removed: Legacy CoverImage.tsx component
  • Added: New SanityImage.tsx wrapper component using the sanity-image library
  • Updated: All image components (Avatar, CoverImage usage, PortableText) to leverage the new image system
  • Enhanced: Image configuration in next.config.ts with proper remote patterns for security

Dependencies & Upgrades

  • next-sanity: v10.0.14 → v11.1.0
  • sanity: v4.5.0 → v4.8.1
  • Added: sanity-image v1.0.0
  • Removed: styled-components (no longer needed on frontend/ ... right?)
  • Updated import paths to align with new next-sanity structure

Misc minor changes

  • Changing an import from ./client-utils to @/app/client-utils
  • Various styling improvements throughout the application
  • Added IBM Plex Mono font family alongside Inter

Testing

I know a lot of files changed here and testing woulda been simpler with less changes and a couple PR's, but this was initiated by a great PR by Johnny (we closed that PR since he wasn't merging changes into his fork)

Testing might be easiest by:

  1. Installing the template based on this branch by running npm create sanity@latest -- --template https://github.com/sanity-io/sanity-template-nextjs-clean/tree/feat-updates-images-and-page-builder and then importing sample content with npm run import-sample-data
  • The Biggest changes will be:
    • On /about. page - the CTA block in the page builder has been updated
    • Test the drag and drop functionality on the /about page
    • Cropping images in the CTA block
    • Cropping images for a Blog Post cover image and a PTE embedded image
  1. Browsing through the Changed files

codebravotech and others added 24 commits July 31, 2025 12:50
…efault fallback is still the dimensions of the image itself and made percentage so that naming convention is clear)
…eOptimistic bug, fix a bug with image uploads, add props for CTA/Info block so people can do custom createDataAttributes if needed
…process, also update to new major next-sanity version because I thought that was the problem
Copy link

vercel bot commented Sep 12, 2025

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

Project Deployment Preview Comments Updated (UTC)
template-nextjs-clean Ready Ready Preview Comment Sep 22, 2025 10:45pm

@kenjonespizza kenjonespizza marked this pull request as ready for review September 12, 2025 20:06
@kenjonespizza kenjonespizza requested a review from a team as a code owner September 12, 2025 20:06
@kenjonespizza kenjonespizza changed the title feat: migrate to sanity-image and enhance page builder feat: migrate to sanity-image, enhance page builder, update next-sanity Sep 13, 2025
Copy link

@ChrisLaRocque ChrisLaRocque left a comment

Choose a reason for hiding this comment

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

I love Ken Jones. Left comments on a few files but things look good

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