Skip to content

Idea preview post leave#111

Draft
interim17 wants to merge 2 commits into
mainfrom
idea-preview-post-leave
Draft

Idea preview post leave#111
interim17 wants to merge 2 commits into
mainfrom
idea-preview-post-leave

Conversation

@interim17

Copy link
Copy Markdown
Contributor

Problem

Closes #87 Closes #55

Solution

Where before we had no working custom preview for ideas, we have a much improved preview with relevant styling, and a few workarounds that need improvement over time.

What we did:

cms.js had a type ("idea" vs "ideas") so old preview component wasn't registering at all.

Once registered, and refactored to typescript (like the resources example) we hit a few errors. Errors were primarily of two types:

  • The idea-post.tsx template renders children that rely on static Gatsby queries that won't work in the Decap preview. In the template component isPreview checks whether we are in the production site or the CMS, and guards against rendering these ( and ).
  • Some of the data coming from Decap forms relies on relational data (e.g. an author name resolves to a more complex object that includes other fields). In the context of the preview Decap only gives us the label from the dropdown, not the data that that label will resolve in the production app. We can get rid of errors by normalizing a bit to just provide the component with the basic strings. For some data, like an author names, just using the string label is a fine work around. For something more complicated like the Relevant Resources section it's really not great, but I think that is out of scope for this PR and worth a separate look. The normalizing functions are a small maintenance burden.
  • 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 22, 2026

Copy link
Copy Markdown

Deploy Preview for project-idea-board ready!

Name Link
🔨 Latest commit 72037f1
🔍 Latest deploy log https://app.netlify.com/projects/project-idea-board/deploys/6a614d97c50ed70009cc1d0c
😎 Deploy Preview https://deploy-preview-111--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.

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.

preview for ideas Preview components

1 participant