Skip to content

fix: grid-aware resize snapping in camera dock - #25410

Merged
antobinary merged 3 commits into
bigbluebutton:v3.0.x-developfrom
ramonlsouza:cam-size-up
Jul 23, 2026
Merged

antobinary merged 3 commits into
bigbluebutton:v3.0.x-developfrom
ramonlsouza:cam-size-up

Conversation

@ramonlsouza

Copy link
Copy Markdown
Member

What does this PR do?

Automatically adjust presentation size to best use of available space when resizing (custom and unified layouts).

Resizing remains continuous, allowing transitions such as 1x4 to 2x2. On release, unused dock height or width snaps to the camera grid actual size.

before

before.mp4

after.mp4

@coderabbitai

coderabbitai Bot commented Jul 13, 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: b448d164-ac05-4a34-a8ff-e2116b1e6c75

📥 Commits

Reviewing files that changed from the base of the PR and between ae97e55 and 7065b5a.

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

Walkthrough

The webcam component adds optional grid snapping for camera dock resizing. It tracks current dock and grid dimensions, calculates constrained snapped sizes, and dispatches size updates after a settle delay. WebcamContainer enables snapping for custom and unified layouts and passes the flag to WebcamComponent.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant WebcamContainer
  participant WebcamComponent
  participant CameraDockState
  WebcamContainer->>WebcamComponent: pass snapToCameraGrid for custom or unified layout
  WebcamComponent->>WebcamComponent: wait for resize settle delay
  WebcamComponent->>CameraDockState: dispatch SET_CAMERA_DOCK_SIZE
  WebcamComponent->>WebcamComponent: stop camera dock resize
Loading

Suggested reviewers: tainan404

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: grid-aware snapping in the camera dock resize flow.
Description check ✅ Passed The description matches the PR by explaining the resize snapping behavior for custom and unified layouts.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@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.

Actionable comments posted: 1

🤖 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.

Inline comments:
In `@bigbluebutton-html5/imports/ui/components/webcam/component.tsx`:
- Around line 333-339: Update the camera dock resize flow around
snapCameraDockToGrid and stopCameraDockResize to store the delayed snap timer in
a ref, clear any pending timer when a new resize starts, and clear it during
unmount cleanup. Ensure only the current resize can snap dimensions and dispatch
isResizing: false.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 25eb2c02-3dcf-4ea6-b40b-e1a87ae2ed78

📥 Commits

Reviewing files that changed from the base of the PR and between 4ad56e1 and 919ff6a.

📒 Files selected for processing (1)
  • bigbluebutton-html5/imports/ui/components/webcam/component.tsx

Copilot AI 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.

Pull request overview

Adds grid-aware “snap on release” behavior to the webcam/camera dock so that, after a continuous resize interaction, the dock compacts to the computed optimal camera grid size (for custom and unified layouts).

Changes:

  • Introduces grid-snapping helpers and a post-resize “settle then snap” flow in the webcam dock component.
  • Tracks latest cameraDock and computed optimal grid size via refs to support delayed snapping after resize stop.
  • Enables snapping only for custom and unified layouts via a new snapToCameraGrid prop.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@antobinary antobinary changed the title grid-aware resize snapping in camera dock fix: grid-aware resize snapping in camera dock Jul 15, 2026
@Tainan404

Copy link
Copy Markdown
Member

camera dock redimension is not respected.

Screencast.from.16-07-2026.10.40.43.webm

@ramonlsouza

Copy link
Copy Markdown
Member Author

camera dock redimension is not respected.

Screencast.from.16-07-2026.10.40.43.webm

fixed on 7065b5a

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

✅ Automated tests have passed!

@antobinary
antobinary merged commit 224714f into bigbluebutton:v3.0.x-develop Jul 23, 2026
35 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.

4 participants