Skip to content

fix(shared-notes): keep BlockNote table add-row handle inside the panel#25

Closed
imdt-claudiop wants to merge 6 commits into
GuiLeme:v3.0.x-developfrom
imdt-claudiop:feat/poll-results-and-latex-custom-block
Closed

fix(shared-notes): keep BlockNote table add-row handle inside the panel#25
imdt-claudiop wants to merge 6 commits into
GuiLeme:v3.0.x-developfrom
imdt-claudiop:feat/poll-results-and-latex-custom-block

Conversation

@imdt-claudiop

Copy link
Copy Markdown

What is happening

The BigBlueButton shared-notes editor can run on BlockNote (the modern block-based editor) instead of the legacy Etherpad. When a meeting is created with sharedNotesEditor=blockNote, users get a Notion-like editing experience with slash commands, custom blocks (LaTeX, charts), and tables.

The shared-notes panel in BBB is intentionally narrow (~260px) so it behaves as a side panel alongside the presentation. BlockNote tables, however, default to a width that already exceeds this panel — and the floating "add row" handle that appears on hover (+ below the last row) is sized to the full table width (width: 100%). The result: on a wide table, that handle spills past the panel's right edge and renders partly off-screen, which is the bug reported upstream in TypeCellOS/BlockNote#2692.

Why this happens (and why an upgrade doesn't fix it)

BlockNote's floating table handles used to portal to document.body, which broke their positioning. The upstream fix (TypeCellOS/BlockNote#2729, released in @blocknote 0.51.0) made the portal target configurable and moved the default back into .bn-container. BBB already ships @blocknote 0.51.3, so that upstream fix is already present.

The overflow that remains is BBB-specific: the panel is narrow, the default table is already wider than it, and .bn-editor uses overflow-x: visible, so the full-width handle spills instead of being contained. Upgrading @blocknote further does not address this — the cause lives in how the narrow panel interacts with the table handle sizing.

The fix

A scoped CSS override inside the existing bn-shared-notes component (the same component already injects a <style> block of .bn-* overrides, so this follows the established pattern):

  • Establish .bn-container as a container (container-type: inline-size).
  • Clamp the floating add-row and add-column handles to the editor's visible content width: max-width: calc(100cqw - 60px) (where 100cqw is the .bn-container inline size and 60px is the editor's horizontal padding, padding-inline: 35px 25px).

Critically, only the floating handles are clamped:

  • The table itself stays fully scrollable via its own .tableWrapper (overflow-x: auto) — every column remains reachable by scrolling, nothing is clipped.
  • The left "add block" side menu (.bn-side-menu, the +/drag handle on the left gutter of each block) is not touched, so it is never clipped. A naive overflow-x: hidden on the container would clip both sides; this approach contains only the right-side overflow.

Because the upstream BlockNote fix is already released, the BBB override is made configurable via public.sharedNotes.containTableControlsOverflow (default true), mirroring the existing staticFormattingToolbar flag. An admin can disable this override if a future @blocknote version makes it redundant or conflicting.

Behavior

Before (flag off) — the add-row handle overflows the panel

Preview animated below — click the GIF to open the MP4 (higher quality, with controls):

Before fix: add-row handle overflows the panel

The floating + handle is pinned to the panel's right edge and overflows by ~150px (handle right edge at 649px vs editor right edge at 499px).

After (flag on) — the handle stays inside the panel

Preview animated below — click the GIF to open the MP4 (higher quality, with controls):

After fix: handle clamped inside the panel

The handle is clamped (right edge at 474px ≤ editor 499px), the table grid stays intact and scrollable, and the left add-block side menu remains fully visible.

Tests

New E2E test sharednotes/blocknoteWide table controls stay inside the shared notes panel (bigbluebutton-tests/playwright/sharednotes/blocknote/sharednotes.spec.ts):

  • Inserts a table via the slash menu and asserts the precondition (the table is wider than its scroll wrapper — i.e. it genuinely overflows the panel).
  • Hovers the table and asserts the left add-block side menu (.bn-side-menu) stays inside the panel and is not clipped (non-zero width, left edge ≥ panel left, right edge ≤ panel right).
  • Reveals the add-row handle and asserts its right edge does not exceed the editor's right edge.

Test evidence (geometry is the authoritative proof — the on-screen delta on the default table is modest, ~150px):

State add-row right edge editor right edge result
Flag off (before fix) 649px 499px FAIL (~150px overflow)
Flag on (after fix) 474px 499px PASS (handle inside)

Full blocknote suite passes with the fix enabled (4/4: the new test, LaTeX toolbar visibility, export-empty-notes-as-PDF) — no regressions.

Files changed

  • bigbluebutton-html5/imports/ui/components/bn-shared-notes/component.tsx — flag read + scoped CSS clamp.
  • bigbluebutton-html5/private/config/settings.yml — new public.sharedNotes.containTableControlsOverflow flag (default true).
  • bigbluebutton-tests/playwright/sharednotes/blocknote/sharednotes.spec.ts — new test case.
  • bigbluebutton-tests/playwright/sharednotes/blocknote/sharednotes.tstableControlsStayWithinPanel helper + selectors.

Notes / risks

  • The 60px constant in calc(100cqw - 60px) reflects the editor's current horizontal padding (padding-inline: 35px 25px). If that padding changes upstream, the clamp should be revisited — it is documented in a comment at the override site.
  • The .bn-extend-button-add-remove-columns selector is included for symmetry/defensive coverage; in @blocknote 0.51.3 the column handle is width: 18px so the clamp is inert there today, but it guards against a future width: 100% regression on that handle.

Refs: TypeCellOS/BlockNote#2692, TypeCellOS/BlockNote#2729

Co-Authored-By: Guilherme Leme leme.guilherme.p@gmail.com

imdt-claudiop and others added 6 commits June 19, 2026 21:54
Add a proof-of-concept LaTeX math formula block to the BlockNote
editor in Shared Notes. Users can type /latex to insert a formula
block that renders using KaTeX.

- New LatexBlock custom block spec using createReactBlockSpec
- Edit mode: textarea for LaTeX input
- Render mode: KaTeX-rendered formula display
- Slash menu integration via SuggestionMenuController
- Lightweight: uses katex (~300KB) for rendering

Co-authored-by: leme.guilherme.p@gmail.com
The BlockNote formatting toolbar disappeared when editing a LaTeX custom
block because the block is declared with content: 'none'. BlockNote's
toolbar components (BasicTextStyleButton, BlockTypeSelect, ColorStyleButton,
NestBlockButton, UnnestBlockButton, TextAlignSelect) return null when the
active block has no inline content, causing the entire toolbar to vanish.

Create custom wrapper components that render inert placeholders on
content-less blocks, keeping the toolbar layout intact. Toggle actions
are disabled (no-op) on blocks where they don't apply.

Also adds an E2E test verifying the toolbar stays visible while editing
a LaTeX block.
Adds a "chart" custom block to the Shared Notes BlockNote editor,
mirroring the existing LaTeX block. The chart JSON spec is stored as a
single string prop (BlockNote propSchema holds primitives only) and
parsed at render time by a pure, React-free validator that degrades
gracefully on malformed input instead of crashing the collaborative doc.

Renders pie and scatter charts with recharts (already a dependency, used
by the chat poll results). Wires a slash-menu item ("Chart", aliases
chart/pie/scatter/graph) and block CSS alongside the LaTeX block.

parseChartSpec is unit-tested (pie, scatter with required x/y and
optional label, missing/wrong-typed fields, empty data, malformed JSON,
unknown type) via the Node built-in test runner.

Co-Authored-By: Guilherme <leme.guilherme.p@gmail.com>
When a poll is published, akka broadcasts PollShowResultEvtMsg on the
from-akka-apps-redis-channel that bbb-shared-notes-server already subscribes
to. Handle it by appending a pie chart block (mirroring the html5 BlockNote
chart block) to the meeting's Shared Notes pad.

- handler: parse the SimplePollResultOutVO broadcast and build the pie data
  defensively (non-empty label fallback, finite value >= 0) so the html5
  validator never silently drops slices.
- notesSchema: a server-side ServerBlockNoteEditor whose schema mirrors the
  html5 editor (default blocks minus media, plus latex + chart), so existing
  blocks survive the read/append round-trip and the chart block's
  type/propSchema/content stay byte-for-byte identical to the client.
- appendPollChart: append to the existing fragment (not the empty-pad seed
  path), and stay idempotent by keying the block on pollId embedded in the
  chart spec - a republished poll replaces its chart in place instead of
  stacking duplicates.

Co-Authored-By: Guilherme <leme.guilherme.p@gmail.com>
…e panel

The BlockNote editor in shared-notes uses a narrow panel (~260px). A table
wider than the panel had its floating "add row" handle (.bn-extend-button-
add-remove-rows, width:100% of the table) spill past the panel's right edge,
making the handle overflow the editor and partly render off-screen.

The upstream BlockNote fix (TypeCellOS/BlockNote#2729, released in 0.51.0)
made the floating-handle portal target configurable and moved the default
back into .bn-container. BBB already ships @blocknote 0.51.3, so the
remaining overflow is a BBB-specific symptom: the panel is narrow, the
default table is already wider than it, and .bn-editor's overflow-x is
visible, so the full-width handle spills instead of being contained.

Fix: scope a CSS clamp inside bn-shared-notes that limits the floating
add-row/add-column handles to the editor's visible content width
(max-width: calc(100cqw - 60px)) using a container query on .bn-container.
The table itself stays fully scrollable via its own .tableWrapper
(overflow-x: auto) -- only the handles are clamped, so columns remain
reachable and the left add-block side menu is left untouched (never clipped).

Configurable via public.sharedNotes.containTableControlsOverflow (default
true) because the upstream fix is already released: an admin can disable
this BBB override if a future @blocknote version makes it redundant or
conflicting.

Test: sharednotes/blocknote "Wide table controls stay inside the shared
notes panel" asserts the table overflows its wrapper (precondition), the
left side menu stays visible inside the panel, and the add-row handle's
right edge does not exceed the editor's right edge. Fails before the fix
(handle at 649px, ~150px past the 499px editor) and passes after (474px).

Refs: TypeCellOS/BlockNote#2692, TypeCellOS/BlockNote#2729

Co-Authored-By: Guilherme Leme <leme.guilherme.p@gmail.com>
@github-actions

Copy link
Copy Markdown

Thank you for this contribution!
Could you please confirm if you already sent in the signed Contributor License Agreement?
See https://docs.bigbluebutton.org/support/faq.html#why-do-i-need-to-sign-a-contributor-license-agreement-to-contribute-source-code
Thanks in advance!

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.

2 participants