Skip to content

fix: allow column_list/column as children of single-level-nestable blocks - #779

Open
ShayanMuhammad-CS wants to merge 2 commits into
makenotion:mainfrom
ShayanMuhammad-CS:fix/callout-nested-column-list-575
Open

ShayanMuhammad-CS wants to merge 2 commits into
makenotion:mainfrom
ShayanMuhammad-CS:fix/callout-nested-column-list-575

Conversation

@ShayanMuhammad-CS

Copy link
Copy Markdown

Summary

Fixes #575.

The original report claimed callout blocks were missing from BlockObjectRequest entirely — that part was already fixed on main and a prior attempt (#613) was rightly closed since it couldn't reproduce a compile error for that case.

However, a real bug was left unresolved further down the same issue thread: @Fental's comment posted a real API response showing a callout block containing a nested column_list → column → paragraph. That shape does not type-check on main today:

error TS2322: Type '"column_list"' is not assignable to type '"code" | "file" | "toggle" | ... | "synced_block"'.

Root cause

BlockObjectWithSingleLevelOfChildrenRequest (src/api-endpoints/common.ts) models the children of blocks that support one level of nesting — callout, toggle, quote, bulleted_list_item, numbered_list_item, heading_1-4, paragraph, template, synced_block. That union is missing column_list/column entirely, even though the top-level BlockObjectRequest union supports them fine. So a column layout could be created at the root of a page, but not nested inside any of those container blocks — despite the Notion API allowing it.

Fix

Added column_list/column variants to BlockObjectWithSingleLevelOfChildrenRequest, mirroring the existing top-level ColumnListRequest/ColumnWithChildrenRequest definitions but with children capped one level deeper (BlockObjectRequestWithoutChildren), consistent with how every other nestable block type in that union reduces its child depth (e.g. quote, toggle).

Test plan

  • npm run build (tsc) — no errors
  • npm run lint — no new warnings/errors introduced by this change
  • npm test — 130/130 passing
  • Added test/block-nesting-types.test.ts, a type-level regression test (via ts-jest) that:
    • asserts a callout with a nested column_list/column/paragraph layout now compiles
    • asserts a block still cannot go one level deeper than allowed (e.g. a quote nested inside a column still correctly fails to compile)

@CLAassistant

CLAassistant commented Aug 25, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@ShayanMuhammad-CS

Copy link
Copy Markdown
Author

recheck

…ocks

Blocks like `callout`, `toggle`, `quote`, `bulleted_list_item`, etc. support
one level of nested `children` via `BlockObjectWithSingleLevelOfChildrenRequest`,
but that union was missing `column_list`/`column` entirely, even though the
top-level `BlockObjectRequest` union supported them. As a result, TypeScript
rejected a real, API-supported shape: a column layout nested inside a callout
(reproduced from a real API response in the issue thread).

Adds `column_list`/`column` variants to the single-level union, using
depth-reduced child types so columns at this depth still cannot themselves
contain a further nested `children` level (consistent with how every other
nestable block in that union is modeled).

Fixes makenotion#575
@ShayanMuhammad-CS
ShayanMuhammad-CS force-pushed the fix/callout-nested-column-list-575 branch from fe60aeb to a4c401a Compare August 25, 2026 19:51
@ShayanMuhammad-CS

Copy link
Copy Markdown
Author

recheck

1 similar comment
@ShayanMuhammad-CS

Copy link
Copy Markdown
Author

recheck

@ShayanMuhammad-CS

Copy link
Copy Markdown
Author

Hi @ksinder — following up since you were involved in the discussion on #575 and the earlier attempt (#613). This PR fixes the underlying bug from that thread: `column_list`/`column` were missing from `BlockObjectWithSingleLevelOfChildrenRequest`, so a callout with a nested column layout (as shown in the API response @Fental posted in the issue) didn't type-check even though the API supports it.

Build/lint/tests all pass locally, and I added a regression test (`test/block-nesting-types.test.ts`). Would appreciate a review/workflow approval when you have a chance. Thanks!

This branch has not been deployed

No deployments
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.

"callout" blocks should have children

2 participants