NotionX / NotionX/react-notion-x

defaultPageCoverPosition is ignored if the notion page used to have a cover

Open
#351 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
5.4k
Forks
645
PR merge metrics
No merged PRs in 30d

Description

Description

Notion pages seem to keep the page_cover_position in a page format even if the cover was removed.
The Block component from packages/react-notion-x/src/block.tsx uses the page_cover_position from the page format if it's available instead of the defaultPageCoverPosition.

The problem happens when using NotionRenderer with defaultPageCover and defaultPageCoverPosition with a page that used to have a cover.
In this case it uses the page_cover_position from the cover that was removed with the defaultPageCover. defaultPageCoverPosition is ignored.

Notion Test Page ID

This page used to have a cover and has a numeric page_cover_position value as part of its format. It doesn't have page_cover as part of its format.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in packages/react-notion-x/src/block.tsx and inspect how page_cover_position and defaultPageCoverPosition are selected for the Notion Test Page ID in the report. Done means a page with a stale page_cover_position but no page_cover uses defaultPageCoverPosition when rendered with NotionRenderer and defaultPageCover.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.