Skip to content

Preview Ideas in CMS (pt. 1/2) - #112

Open
interim17 wants to merge 1 commit into
mainfrom
idea-preview-non-relation
Open

Preview Ideas in CMS (pt. 1/2)#112
interim17 wants to merge 1 commit into
mainfrom
idea-preview-non-relation

Conversation

@interim17

@interim17 interim17 commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Problem

Advances #87 Advances #55

We have no customized preview for idea pages.

Solution

Now we have a much improved preview with relevant styling, and a few workarounds that need improvement over time.

I split this work into two PRs to make review simpler, this and #111 should be merged together.

In part one:

  • cms.js had a typo ("idea" vs "ideas") so old preview component wasn't registering at all.
  • The Decap preview component directly renders the gatsby template component. This requires some workarounds and compromises, but is the only way to make previews tractable imo, otherwise you have to develop two components in parallel.

Some workarounds:

  • isPreview state in the Gatsby template helps guard for cases where we can't use Gatsby components (like Link) or consume the data layer (like StaticQuery in child components).
  • provide some placeholder/replacement for static queries and some data normalization

What we don't get:

  • get data from relational widgets into the right shape - this is the lift in part 2
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
Screenshot 2026-07-22 at 3 28 38 PM

@netlify

netlify Bot commented Jul 28, 2026

Copy link
Copy Markdown

Deploy Preview for project-idea-board ready!

Name Link
🔨 Latest commit 84e7c92
🔍 Latest deploy log https://app.netlify.com/projects/project-idea-board/deploys/6a68eee0d2574e0008de733c
😎 Deploy Preview https://deploy-preview-112--project-idea-board.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@interim17 interim17 changed the title render idea preview without resolving relational widget data Preview Ideas in CMS (pt. 1/2) Jul 28, 2026
@interim17
interim17 marked this pull request as ready for review July 28, 2026 18:11
@interim17
interim17 requested review from meganrm and rugeli and removed request for rugeli July 28, 2026 18:11
authors,
date,
introduction,
isPreview,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't love these isPreview checks, and kind of wish that the gatsby components didn't need to know anything about the Decap previews, but it's probably a worthwhile tradeoff, since designing to avoid it would force bigger changes (or make previews onerous to maintain).

As far as gatsby is concerned this is just some visual noise since isPreview should never be true outside of Decap.

@interim17
interim17 requested a review from jessicasyu August 4, 2026 20:20
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.

2 participants