Skip to content

fix(react): restore file block styling - #3440

Merged
nperez0111 merged 1 commit into
mainfrom
fix/react-file-block-metadata
Nov 30, 2026
Merged

nperez0111 merged 1 commit into
mainfrom
fix/react-file-block-metadata

Conversation

@nperez0111

@nperez0111 nperez0111 commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #3431. ReactFileBlock now declares the same fileBlockAccept: ["*/*"] metadata as the core file block. This restores the data-file-block marker used by the existing styles to align the attachment icon and filename and lay out the “Add file” button. Stored block data is unchanged.

Testing

  • Reproduced in Chromium with the schema override Docs used. The React attachment layout and button styling assertions failed before the fix; the core attachment layout passed.
  • After the fix, all three cases pass with vp run e2e:local File/block.browser.test.tsx. The tests also verify that clicking “Add file” opens the file panel.
  • Type-aware lint and formatting passed for the touched files.

Related

#3379 uses the same metadata for toolbar indentation.

Summary by CodeRabbit

  • New Features
    • The file block now allows selecting files of any type. This expands the formats available through its attachment picker, so files aren’t restricted by file-type filtering. The change applies to the React file block; it does not alter how filenames or attachments are displayed.

@vercel

vercel Bot commented Nov 30, 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 30, 2026 1:38pm UTC
blocknote-website Ready Ready Preview Nov 30, 2026 1:38pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

ReactFileBlock now sets meta.fileBlockAccept to ["*/*"]. New browser tests check file layout, file-block attributes, and the add-file button’s embed-tab interaction.

Changes: React file block

Layer / File(s) Summary
File metadata and browser validation
packages/react/src/blocks/File/block.tsx, packages/react/src/blocks/File/block.browser.test.tsx, tests/vite.config.browser.ts
ReactFileBlock sets meta.fileBlockAccept to ["*/*"]. Browser tests check filename layout, the data-file-block attribute, the add-file button’s display style, and whether clicking the button shows the embed tab. The browser-local test allowlist includes the new test.

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

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: yousefed, matthewlipski

Merge Risk: Minimal · up to 1eeaf

The change restores the file block marker so existing styles lay out attachments and the Add file button correctly. It does not change stored data, and no merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the fix (restoring file block styling) and the affected package (react). The change adds fileBlockAccept metadata to ReactFileBlock, which restores the data-file-block marker that the …
Description check Passed The description follows the repository template. It has a Summary that explains the change and links issue #3431. It has a Testing section that describes the Chromium reproduction, the before and afte…
Linked Issues check Passed Issue #3431 requires ReactFileBlock to carry the same fileBlockAccept metadata as the core file block, so the React variant is classified and styled as a file block. At the reviewed head, `package…
Out of Scope Changes check Passed The changes are the fileBlockAccept metadata in ReactFileBlock (direct implementation of #3431), a browser test file for the File block layouts and add-file button (verification of #3431's compare…
Full details: Title check

Explanation

The title names the fix (restoring file block styling) and the affected package (react). The change adds fileBlockAccept metadata to ReactFileBlock, which restores the data-file-block marker that the existing styles use for the attachment layout and Add file button. The title describes this purpose clearly enough for a reviewer scanning history.

Full details: Description check

Explanation

The description follows the repository template. It has a Summary that explains the change and links issue #3431. It has a Testing section that describes the Chromium reproduction, the before and after results, and the lint and format checks. It also has a Related section. The template's Rationale, Impact, Screenshots/Video, Checklist, and Additional Notes sections are missing. The Changes section is not labeled, although the Summary covers the change. The template's Checklist items are not marked.

Full details: Linked Issues check

Explanation

Issue #3431 requires ReactFileBlock to carry the same fileBlockAccept metadata as the core file block, so the React variant is classified and styled as a file block. At the reviewed head, packages/react/src/blocks/File/block.tsx declares meta: { fileBlockAccept: ["*/*"] } in createReactBlockSpec. The core file block at the merge base (packages/core/src/blocks/File/block.ts) declares the same value. The React parse, toExternalHTML, and render logic are unchanged in intent and reuse the core createFileBlockConfig and fileParse, so stored block data is not changed. The PR adds a browser test (packages/react/src/blocks/File/block.browser.test.tsx) that covers core and React layouts, the data-file-block attribute, the add-file button style, and the file panel opening, and adds that test to tests/vite.config.browser.ts. The PR description reports these tests passing. I could not read the whole-PR text diff for the React block (the tool reported changed blobs missing), so the change was confirmed from the head file contents and the core base file, not from the diff. Runtime CSS results rest on the PR's reported test run.

Full details: Out of Scope Changes check

Explanation

The changes are the fileBlockAccept metadata in ReactFileBlock (direct implementation of #3431), a browser test file for the File block layouts and add-file button (verification of #3431's compare-core-and-React testing request), and a one-line addition to tests/vite.config.browser.ts that includes that test in the local browser suite. All changes relate to the File block parity work. The PR description's reference to #3379 is context only; no toolbar indentation code for #3379 was found in the reviewed changes.

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 file block’s place,
The name sits close beside its face.
A button opens tabs in view,
The embed tab appears there too.
The rabbit hops, tests all in line,
And nibbles clover by design.

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: 8c886782-14ce-4e35-8ab4-3c92ad4a9796
Commits

Reviewing files that changed from the base of the PR and between d074655 and 1eeafb6.

Files selected for processing: 3

  • packages/react/src/blocks/File/block.browser.test.tsx
  • packages/react/src/blocks/File/block.tsx
  • tests/vite.config.browser.ts

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

@pkg-pr-new

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

Copy link
Copy Markdown

Open in StackBlitz

@blocknote/ariakit

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

@blocknote/code-block

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

@blocknote/core

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

@blocknote/diagram-block

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

@blocknote/mantine

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

@blocknote/math-block

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

@blocknote/react

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

@blocknote/server-util

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

@blocknote/shadcn

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

@blocknote/xl-ai

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

@blocknote/xl-docx-exporter

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

@blocknote/xl-email-exporter

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

@blocknote/xl-multi-column

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

@blocknote/xl-odt-exporter

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

@blocknote/xl-pdf-exporter

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

@blocknote/xl-typst-exporter

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

commit: 1eeafb6

@github-actions

github-actions Bot commented Nov 30, 2026 •

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

@nperez0111
nperez0111 merged commit 092fe08 into main Nov 30, 2026
38 checks passed
@nperez0111
nperez0111 deleted the fix/react-file-block-metadata branch November 30, 2026 13:51

This branch was successfully deployed

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

Give ReactFileBlock the same file metadata as the core file block

1 participant