Skip to content

Render pasted whiteboard images in playback - #367

Open
imdt-claudiop wants to merge 4 commits into
bigbluebutton:developfrom
imdt-claudiop:fix/whiteboard-image-render
Open

Render pasted whiteboard images in playback#367
imdt-claudiop wants to merge 4 commits into
bigbluebutton:developfrom
imdt-claudiop:fix/whiteboard-image-render

Conversation

@imdt-claudiop

Copy link
Copy Markdown

What changed

Reconstruct tldraw image assets from the validated bbbImageSrc stored in recorded image shapes.

The playback now:

  • validates the published upload path and tldraw asset ID;
  • builds the image URL through buildFileURL, preserving relative deployments and MEDIA_ROOT_URL;
  • creates the asset before creating the recorded shape;
  • keeps malformed or unsupported image metadata fail-safe.

A Jest setup mock was also added because the current tldraw dependency loads ESM-only nanoid modules that the existing react-scripts test environment cannot parse directly.

Why

Pasted whiteboard images are recorded as shapes, while their tldraw asset records are intentionally reconstructed by each renderer. The presentation 2.3 playback created the shape without rebuilding its asset, leaving an empty image container.

Tests

  • CI=true npx react-scripts test
  • 7 test suites passed
  • 27 tests passed
  • Production build completed
  • Deployed and verified against BBB 4.0 desktop presentation playback (2.3); other recording formats and mobile layouts were not checked.

Evidence

Recording: 986a45d2a620695c3a0bdca939a8ad4ca6a9e2b9-1785814812863

  • Before: the pasted image is visible in chat but missing from the whiteboard.
  • After: the PASTE-IMG 25385 image renders inside the whiteboard.
  • DOM verification: the recorded image shape contains .tl-image with the expected published upload URL.
  • Pasted image visible on the whiteboard - 00:00:26 in the clip.

Before:

Before: pasted image is missing from the whiteboard

After:

After: pasted image renders on slide 8

Animated preview below - click the GIF to open the full-length MP4 with playback controls:

Playback: pasted image renders on slide 8

The helper that resolves the uploaded file path from a pasted image
shape passed the source straight to String.match, so a truthy non string
value threw a TypeError. Return null instead, matching the other fall
through paths.

Cover the two gaps in the helper tests: a shape carrying no asset id,
and a non string source.

Widen the whiteboard package mock used by the test setup so an export it
does not stub throws with its own name, instead of silently resolving to
undefined.
The buildNotes regex used . which does not match newlines in JavaScript.
BlockNote exports notes.html with multiline body content (image tags
and paragraph tags on separate lines), causing the regex to fail and
the notes panel to render empty.

Replace . with [\s\S] to match any character including newlines.
Pasted images in shared notes have arbitrary natural dimensions
(e.g. 999px wide webcam strips) and overflowed the 304px notes
panel, getting clipped on the right. Add max-width:100% to the
notes img rule so images scale down to fit the panel.
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.

1 participant