Skip to content

feat: Enable users to pan outside the current presenters view during infinite whiteboard - #25010

Merged
antobinary merged 6 commits into
bigbluebutton:v3.0.x-developfrom
ramonlsouza:issue-25008
May 13, 2026
Merged

antobinary merged 6 commits into
bigbluebutton:v3.0.x-developfrom
ramonlsouza:issue-25008

Conversation

@ramonlsouza

Copy link
Copy Markdown
Member

What does this PR do?

Introduces a new property to settings file: public.whiteboard.allowInfiniteWhiteboardPanForViewers (default: false).

If switched to true,

  • the toolbar of non-presenters will also contain the Hand panning tool.
  • the shortcuts of non-presenters will also allow the H key combo which enables the Hand panning tool.

Closes Issue(s)

Closes #25008

How to test

  1. set public.whiteboard.allowInfiniteWhiteboard: true
  2. set public.whiteboard.allowInfiniteWhiteboardPanForViewers: true
  3. restart BigBlueButton
  4. start a new meeting
  5. join as presenter
  6. enable infinite whiteboard
  7. join as viewer
  8. viewer should be able to use the hand tool to move around the whiteboard area

@coderabbitai

coderabbitai Bot commented May 5, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 76e3bb5f-c178-44a8-b904-1c3b492a3d88

📥 Commits

Reviewing files that changed from the base of the PR and between 95dfdab and 1af5635.

📒 Files selected for processing (1)
  • bigbluebutton-html5/imports/ui/components/whiteboard/component.jsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • bigbluebutton-html5/imports/ui/components/whiteboard/component.jsx

Walkthrough

This pull request adds a new configuration option allowInfiniteWhiteboardPanForViewers that permits non-presenter users to pan the infinite whiteboard with the hand tool. The setting is added to server config, client initial values, and TypeScript types, and wired into the whiteboard component: it computes viewerCanPan, syncs a ref for handlers, conditionally exposes the hand tool in toolbars, updates initial tool selection and keyboard shortcuts (SPACE, h), and gates camera adjustments and global styling based on the flag.

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant Settings as meetingClientSettings
  participant Whiteboard as WhiteboardComponent
  participant Tldraw as TldrawEditor
  participant Styles as TldrawV2GlobalStyle

  Client->>Settings: read allowInfiniteWhiteboardPanForViewers
  Settings->>Whiteboard: provide flag
  Whiteboard->>Whiteboard: compute viewerCanPan, init viewerCanPanRef
  Whiteboard->>Tldraw: set initial tool (hand/noop) based on viewerCanPan
  Whiteboard->>Tldraw: expose hand tool in toolbar when viewerCanPan
  Whiteboard->>Tldraw: handle SPACE / 'h' shortcuts using viewerCanPanRef
  Whiteboard->>Whiteboard: adjustCameraOnMount(true) on slide change if viewerCanPanRef.current
  Whiteboard->>Styles: pass viewerCanPan to global styles
  Styles->>Client: show/hide [data-testid="tools.hand"] per viewerCanPan and role
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: enabling users to pan outside the presenter's view during infinite whiteboard mode.
Description check ✅ Passed The description is directly related to the changeset, clearly explaining the new setting, its effects on non-presenters' toolbar and shortcuts, and providing comprehensive testing instructions.
Linked Issues check ✅ Passed The PR fully implements issue #25008 requirements: adds the new setting, enables the hand tool in non-presenters' toolbar, and implements H shortcut support for viewers when the setting is enabled.
Out of Scope Changes check ✅ Passed All changes are directly scoped to implementing the infinite whiteboard panning feature for viewers, with no unrelated modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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

Comment @coderabbitai help to get the list of available commands and usage tips.

@antobinary antobinary added this to the Release 3.0 milestone May 5, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
bigbluebutton-html5/imports/ui/components/whiteboard/component.jsx (1)

663-713: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Stale closure: h shortcut should use viewerCanPanRef.current, not viewerCanPan.

On Line 710 the h handler reads viewerCanPan from the closure, but handleKeyDown’s useCallback dependency list (Line 877-880) does not include viewerCanPan. As a result, when viewerCanPan flips (e.g., role/access changes, infinite whiteboard toggled), the simpleKeyMap['h'] branch will keep the stale value while the SPACE branch on Line 663 (which already uses viewerCanPanRef.current) will not. Use the ref for consistency and to avoid the stale read.

🐛 Proposed fix
       e: () => tlEditorRef.current?.setCurrentTool('eraser'),
       h: () => {
-        if (isPresenterRef.current || viewerCanPan) {
+        if (isPresenterRef.current || viewerCanPanRef.current) {
           tlEditorRef.current?.setCurrentTool('hand');
         }
       },
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@bigbluebutton-html5/imports/ui/components/whiteboard/component.jsx` around
lines 663 - 713, The 'h' key handler inside simpleKeyMap uses the stale
closed-over variable viewerCanPan; update that branch to read
viewerCanPanRef.current (like the SPACE handling) so it always reflects the
latest state — locate the simpleKeyMap 'h' entry in handleKeyDown and change the
condition to if (isPresenterRef.current || viewerCanPanRef.current) while
keeping uses of tlEditorRef and isPresenterRef as-is.
🧹 Nitpick comments (2)
bigbluebutton-html5/imports/ui/components/whiteboard/component.jsx (2)

290-313: 💤 Low value

Minor: hand item position is inconsistent between modes.

In the pen-only branch (Line 294-297) hand is unshift-ed (front of toolbar), while in the multi-user branch (Line 309-312) it is push-ed (end). This produces a visible reordering depending on which override path applies. If there is no specific UX reason, picking one position consistently (typically near select at the top) would be preferable.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@bigbluebutton-html5/imports/ui/components/whiteboard/component.jsx` around
lines 290 - 313, The hand/tool ordering is inconsistent: in the PEN-ONLY branch
you unshift the 'hand' item, but in the MULTI-USER-TOOLS branch you push it;
change the MULTI-USER-TOOLS branch to also unshift the 'hand' item so it appears
at the front like in PEN-ONLY. Update the block that handles bbbMultiUserTools
(the code using toolbarItems.filter and the conditional that finds the item with
id === 'hand') to insert the hand with items.unshift(hand) instead of
items.push(hand), and keep the existing guard that prevents adding it if already
present.

476-483: 💤 Low value

Consider also reacting to hasWBAccess/role changes.

This effect only fires when isInfiniteWhiteboard changes, but it gates on isPresenterRef.current, isModeratorRef.current, and hasWBAccessRef.current. If a user becomes a viewer with WB access while infinite whiteboard is already on (e.g., role demotion or WB-access grant after the page rendered with isInfiniteWhiteboard=true), the tool will not be re-initialized to hand. The existing [hasWBAccess] effect at Line 433-462 reads multiUserTools and won’t pick hand. Consider widening the deps (or adding hasWBAccess/isModerator handling) so the panning viewer reliably starts in hand mode on those transitions.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@bigbluebutton-html5/imports/ui/components/whiteboard/component.jsx` around
lines 476 - 483, The effect that sets the editor tool (React.useEffect that
calls tlEditorRef?.current?.setCurrentTool) only runs on isInfiniteWhiteboard
changes but needs to also run when WB access or role changes; update its
dependency list to include the reactive values that represent WB access and role
(not only refs) — e.g., add hasWBAccess (or hasWBAccessState/prop) and the
presenter/moderator role state flags (or their equivalents used elsewhere) so
that when allowInfiniteWhiteboardPanForViewers && !isPresenter && !isModerator
&& hasWBAccess && isInfiniteWhiteboard the effect will re-run and
setCurrentTool('hand') appropriately; if you must keep refs, derive/use their
corresponding state/props in the deps and/or add a small listener to flip the
tool when role/hasWBAccess changes.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@bigbluebutton-html5/imports/ui/components/whiteboard/component.jsx`:
- Around line 663-713: The 'h' key handler inside simpleKeyMap uses the stale
closed-over variable viewerCanPan; update that branch to read
viewerCanPanRef.current (like the SPACE handling) so it always reflects the
latest state — locate the simpleKeyMap 'h' entry in handleKeyDown and change the
condition to if (isPresenterRef.current || viewerCanPanRef.current) while
keeping uses of tlEditorRef and isPresenterRef as-is.

---

Nitpick comments:
In `@bigbluebutton-html5/imports/ui/components/whiteboard/component.jsx`:
- Around line 290-313: The hand/tool ordering is inconsistent: in the PEN-ONLY
branch you unshift the 'hand' item, but in the MULTI-USER-TOOLS branch you push
it; change the MULTI-USER-TOOLS branch to also unshift the 'hand' item so it
appears at the front like in PEN-ONLY. Update the block that handles
bbbMultiUserTools (the code using toolbarItems.filter and the conditional that
finds the item with id === 'hand') to insert the hand with items.unshift(hand)
instead of items.push(hand), and keep the existing guard that prevents adding it
if already present.
- Around line 476-483: The effect that sets the editor tool (React.useEffect
that calls tlEditorRef?.current?.setCurrentTool) only runs on
isInfiniteWhiteboard changes but needs to also run when WB access or role
changes; update its dependency list to include the reactive values that
represent WB access and role (not only refs) — e.g., add hasWBAccess (or
hasWBAccessState/prop) and the presenter/moderator role state flags (or their
equivalents used elsewhere) so that when allowInfiniteWhiteboardPanForViewers &&
!isPresenter && !isModerator && hasWBAccess && isInfiniteWhiteboard the effect
will re-run and setCurrentTool('hand') appropriately; if you must keep refs,
derive/use their corresponding state/props in the deps and/or add a small
listener to flip the tool when role/hasWBAccess changes.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 738d5a08-2507-4b8d-83a6-e20a1981dbeb

📥 Commits

Reviewing files that changed from the base of the PR and between b0b5b12 and c837427.

📒 Files selected for processing (5)
  • bigbluebutton-html5/imports/ui/Types/meetingClientSettings.ts
  • bigbluebutton-html5/imports/ui/components/whiteboard/component.jsx
  • bigbluebutton-html5/imports/ui/components/whiteboard/styles.js
  • bigbluebutton-html5/imports/ui/core/initial-values/meetingClientSettings.ts
  • bigbluebutton-html5/private/config/settings.yml

@antobinary antobinary changed the title Enable users to pan outside the current presenters view during infinite whiteboard feat: Enable users to pan outside the current presenters view during infinite whiteboard May 6, 2026
@antobinary antobinary mentioned this pull request May 6, 2026
12 of 17 tasks
@ramonlsouza
ramonlsouza requested a review from Tainan404 May 6, 2026 13:57
@github-actions

Copy link
Copy Markdown

This pull request has conflicts ☹
Please resolve those so we can review the pull request.
Thanks.

e: () => tlEditorRef.current?.setCurrentTool('eraser'),
h: () => {
if (isPresenterRef.current) {
if (isPresenterRef.current || viewerCanPan) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or add viewerCanPan as a dependency of the useCallback or use the ref reference here


React.useEffect(() => {
if (!isPresenter
&& !viewerCanPan

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think hasWBAccess is missing here

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hasWBAccess is already implicitly covered... viewerCanPan includes it, so adding it to the condition would change behavior when allowInfiniteWhiteboardPanForViewers is not enabled

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

✅ Automated tests have passed!

@Tainan404 Tainan404 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed and tested the code

@antobinary
antobinary merged commit 4236b21 into bigbluebutton:v3.0.x-develop May 13, 2026
60 of 61 checks passed
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.

Enable users to pan outside the current presenters view during infinite whiteboard

3 participants