Skip to content

fix: show block type dropdown for custom inline blocks - #3340

Merged
nperez0111 merged 1 commit into
mainfrom
fix/2401-custom-block-dropdown
Nov 13, 2026
Merged

nperez0111 merged 1 commit into
mainfrom
fix/2401-custom-block-dropdown

Conversation

@nperez0111

@nperez0111 nperez0111 commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Keep the formatting toolbar block-type dropdown visible for custom inline blocks that are not listed as conversion destinations.
  • Add a disabled selected entry showing the current custom block type, as all UI skins require a selected item.
  • Preserve explicit custom labels, schema filtering, empty menus, read-only behavior, and existing media/table toolbar behavior.
  • Add regression coverage for visibility and conversion callbacks.

Fixes #2401

Validation

  • 14 targeted BlockTypeSelect unit tests passed; reproduced the regression before applying the fix.
  • 20 existing Docker/Chromium browser tests passed across customblocks, ariakit, and shadcn suites.
  • Live Paseo browser verification: converted an alert block to Heading 2 with text preserved.
  • Formatting, type-aware lint, and git diff --check passed.

Related: #2347 concerns dropdown contents rather than visibility.

Summary by CodeRabbit

  • Bug Fixes
    • Improved the block type selector for custom inline blocks: their current type remains visible when it isn’t a listed option, while available destinations can still be selected.

@vercel

vercel Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
blocknote Ready Ready Preview Nov 12, 2026 12:59pm UTC
blocknote-website Ready Ready Preview Nov 12, 2026 12:59pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The block type select now displays the selected, disabled entry for an unlisted inline block when conversion destinations are available. Tests cover custom labels, conversion of selected blocks, listed options, and conditions that hide the select.

Changes: Block Type Menu

Layer / File(s) Summary
Inline block menu and conversion
packages/react/src/components/FormattingToolbar/DefaultSelects/BlockTypeSelect.tsx, packages/react/src/components/FormattingToolbar/DefaultSelects/BlockTypeSelect.visibility.test.tsx
The select prepends a selected, disabled entry for an unlisted inline block when destination items are available. Tests cover menu construction, conversion behavior, and visibility conditions.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: matthewlipski

Merge Risk: Minimal · up to 79762

The formatting toolbar's block type dropdown now stays visible for custom inline blocks that are not conversion destinations, showing the current type as a disabled selected item. No concrete merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the primary change: the block type dropdown is kept visible for custom inline blocks. It matches the raw summary, which describes a disabled selected entry for unlisted custom inline b…
Description check Passed The description follows the template's main ideas. It has a Summary with the feature change, a Validation section that covers testing, and a reference to the issue. It omits the Rationale, Impact, Scr…
Linked Issues check Passed Issue #2401 asks that custom blocks can use the formatting toolbar Block Type dropdown. The reviewed head changes BlockTypeSelect.tsx. When the menu has items, no item is selected, and the first selec…
Out of Scope Changes check Passed All changes are in BlockTypeSelect.tsx and its new BlockTypeSelect.visibility.test.tsx. The source change adds a local SelectItems type alias, a mutable items list, and the conditional disabled select…
Full details: Title check

Explanation

The title names the primary change: the block type dropdown is kept visible for custom inline blocks. It matches the raw summary, which describes a disabled selected entry for unlisted custom inline blocks in BlockTypeSelect. The title is short, specific, and uses the conventional fix: prefix. It does not cover the regression tests or the label and filtering preservation, which is expected.

Full details: Description check

Explanation

The description follows the template's main ideas. It has a Summary with the feature change, a Validation section that covers testing, and a reference to the issue. It omits the Rationale, Impact, Screenshots/Video, Checklist, and Additional Notes headings. The Changes section is covered only by the summary bullets. The Testing content is detailed, so the description is mostly complete even though several template sections are missing.

Full details: Linked Issues check

Explanation

Issue #2401 asks that custom blocks can use the formatting toolbar Block Type dropdown. The reviewed head changes BlockTypeSelect.tsx. When the menu has items, no item is selected, and the first selected block's schema content is "inline", the code prepends a selected, disabled entry for the current custom type (items.unshift). Custom inline blocks therefore keep the dropdown visible and can convert to listed destinations. The visibility test file covers this behavior, plus hidden cases for media blocks, empty menus, filtered destinations, and read-only editors. The PR objectives narrow the scope to custom inline blocks that are not conversion destinations. Within that scope, the requirement is implemented. Gap: the new entry is added only for inline content. Custom blocks with non-inline content that are not listed destinations get no selected entry. The issue text is broader than the PR objectives, so this is noted but not treated as a failure.

Full details: Out of Scope Changes check

Explanation

All changes are in BlockTypeSelect.tsx and its new BlockTypeSelect.visibility.test.tsx. The source change adds a local SelectItems type alias, a mutable items list, and the conditional disabled selected entry. The tests cover the same component. No unrelated files or behavior changes appear in the reviewed diff. The media, table, and empty-menu paths keep their existing behavior, as the code guards show.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A rabbit checks the toolbar row,
Where custom blocks now show.
A quiet choice stays marked in place,
While other types can take its place.
The tests hop through each menu case,
Then tuck their notes in a safe place.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 50851d57-8d8d-4a5d-868e-58c19bf9012e
Commits

Reviewing files that changed from the base of the PR and between 8add887 and 797627d.

Files selected for processing: 2

  • packages/react/src/components/FormattingToolbar/DefaultSelects/BlockTypeSelect.tsx
  • packages/react/src/components/FormattingToolbar/DefaultSelects/BlockTypeSelect.visibility.test.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

@pkg-pr-new

pkg-pr-new Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@blocknote/ariakit

npm i https://pkg.pr.new/@blocknote/ariakit@3340

@blocknote/code-block

npm i https://pkg.pr.new/@blocknote/code-block@3340

@blocknote/core

npm i https://pkg.pr.new/@blocknote/core@3340

@blocknote/diagram-block

npm i https://pkg.pr.new/@blocknote/diagram-block@3340

@blocknote/mantine

npm i https://pkg.pr.new/@blocknote/mantine@3340

@blocknote/math-block

npm i https://pkg.pr.new/@blocknote/math-block@3340

@blocknote/react

npm i https://pkg.pr.new/@blocknote/react@3340

@blocknote/server-util

npm i https://pkg.pr.new/@blocknote/server-util@3340

@blocknote/shadcn

npm i https://pkg.pr.new/@blocknote/shadcn@3340

@blocknote/xl-ai

npm i https://pkg.pr.new/@blocknote/xl-ai@3340

@blocknote/xl-docx-exporter

npm i https://pkg.pr.new/@blocknote/xl-docx-exporter@3340

@blocknote/xl-email-exporter

npm i https://pkg.pr.new/@blocknote/xl-email-exporter@3340

@blocknote/xl-multi-column

npm i https://pkg.pr.new/@blocknote/xl-multi-column@3340

@blocknote/xl-odt-exporter

npm i https://pkg.pr.new/@blocknote/xl-odt-exporter@3340

@blocknote/xl-pdf-exporter

npm i https://pkg.pr.new/@blocknote/xl-pdf-exporter@3340

@blocknote/xl-typst-exporter

npm i https://pkg.pr.new/@blocknote/xl-typst-exporter@3340

commit: 797627d

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
PR Preview Action v1.8.2
Preview removed because the pull request was closed.
2026-11-13 07:38 UTC

@nperez0111
nperez0111 merged commit 9740efa into main Nov 13, 2026
37 checks passed
@nperez0111
nperez0111 deleted the fix/2401-custom-block-dropdown branch November 13, 2026 07:34

This branch was successfully deployed

2 active deployments
Preview – blocknote-website — 797627dc Deployed Nov 12, 2026 by vercel[bot]
Preview – blocknote — 797627dc Deployed Nov 12, 2026 by vercel[bot]
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.

Ability to change the custom block type to another

1 participant