Skip to content

fix: handle page_content_first gallery cover type for linked database views#690

Open
albertodainotti wants to merge 1 commit intoNotionX:masterfrom
InetIntel:fix-page-content-first
Open

fix: handle page_content_first gallery cover type for linked database views#690
albertodainotti wants to merge 1 commit intoNotionX:masterfrom
InetIntel:fix-page-content-first

Conversation

@albertodainotti
Copy link
Contributor

Summary

When a Notion page embeds a linked view of a database (as opposed to an inline database), the Notion API returns gallery_cover.type as "page_content_first" instead of "page_content".

The CollectionCard component only checked for "page_content", so linked database gallery cards rendered with empty covers even though the image data was correctly fetched and available in the recordMap.

Fix

One-line change in collection-card.tsx to also match on "page_content_first":

- if (cover?.type === 'page_content') {
+ if (cover?.type === 'page_content' || cover?.type === 'page_content_first') {

How to reproduce

  1. Create a Notion page with a linked view of a database (not an inline database)
  2. Configure the gallery view to use "Page content" as the card cover
  3. Render the page with react-notion-x — gallery cards will have empty covers

After this fix, the covers render correctly.

… views

Notion returns gallery_cover type 'page_content_first' (instead of
'page_content') when rendering a linked view of a database. The existing
code only matched on 'page_content', causing linked database gallery
cards to render with empty covers.
@vercel
Copy link

vercel bot commented Mar 8, 2026

@albertodainotti is attempting to deploy a commit to the Saasify Team on Vercel.

A member of the Team first needs to authorize it.

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.

1 participant