Skip to content

feat(layout): arrange cameras and presentation side by side on phones in landscape - #25565

Merged
prlanzarin merged 4 commits into
bigbluebutton:v4.0.x-developfrom
AtilaU19:task-2769
Aug 12, 2026
Merged

prlanzarin merged 4 commits into
bigbluebutton:v4.0.x-developfrom
AtilaU19:task-2769

Conversation

@AtilaU19

@AtilaU19 AtilaU19 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Reworks how the unified layout behaves on a phone held in landscape (deviceInfo.isPhone + landscape orientation — tablets are deliberately excluded, they keep the regular behavior).

  • Cameras right, presentation left. When both the content and the cameras are visible, the arrangement is imposed by the device instead of being freely placed: the camera dock is docked to the right with a fixed share of the media area (phoneLandscapeCameraWidthPercentage), and is neither draggable nor resizable. This is computed as an effective position in the layout manager, so the user's/meeting's stored camera position is left untouched and comes back when the phone returns to portrait. As with every other camera position, contentRight mirrors under RTL.
  • No longer follows the presenter's camera placement. Since the arrangement is local to the device, camera dock position/size are not replicated on such a client. Conversely, the position a presenter propagates now comes from the layout input rather than the (possibly device-enforced) output, so a phone in landscape never pushes contentRight to the whole meeting.
  • Sidebar navigation scroll after rotating collapsed. The flag that suppresses the scrollbar during the mobile expand animation was never restored when the device stopped being mobile, so a sidebar collapsed in portrait was left unscrollable in landscape (while one left open kept its scroll).

Closes Issue(s)

Closes None

More

  • Pairs with feat(mobile): mobile layout overhaul — paginated webcams, compact bars and responsive dialogs #25340 (mobile layout overhaul). That PR owns the mobile polish; this one only changes layout geometry and the slide controls sizing. Cosmetic leftovers visible while testing this branch on its own — most notably the camera dock's vertical page arrows overlapping the surrounding controls — are resolved there, since it stops rendering those buttons on mobile and moves pagination into a bar inside the dock. The enforced arrangement here assumes that: it no longer reserves the 20px those arrows used to occupy, so until feat(mobile): mobile layout overhaul — paginated webcams, compact bars and responsive dialogs #25340 lands the arrows still render and overlap. The two are meant to go in together.
  • The toolbar sizing change is a no-op whenever the slide is wider than presentationToolbarMinWidth (430px), which is the case at the default desktop viewports: behavior only changes where the toolbar previously overflowed its area. The width is computed after the presentationBounds guard and falls back to the presentation area width while the slide has no measured size.
  • Hiding the toolbar scrollbar left the pre-existing "Fancy scroll" rules unable to paint on any engine, so they are removed in the second commit.
  • deviceInfo.isMobile includes tablets, so a new isPhoneLandscape() helper was added rather than reusing it.

Moderator

Screenshot from 2026-08-04 10-20-54

Participant

Screenshot from 2026-08-04 10-18-29

@coderabbitai

coderabbitai Bot commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The layout detects phone landscape mode and enforces side-by-side camera placement with a configured width and disabled dragging and resizing. Orientation and resize events trigger browser-size updates and recalculations. Push-layout synchronization propagates the enforced camera dock. Presentation controls use unified sizing and responsive scrolling. Dropdowns support short viewports, sidebars restore scrolling on non-mobile layouts, and video pagination reserves a camera tile.

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

Sequence Diagram(s)

sequenceDiagram
  participant Browser
  participant observer
  participant unifiedLayout
  participant pushLayoutEngine
  Browser->>observer: report orientation or resize change
  observer->>unifiedLayout: trigger layout recalculation
  unifiedLayout->>unifiedLayout: enforce phone landscape camera dock
  pushLayoutEngine->>pushLayoutEngine: compute propagated camera dock
  pushLayoutEngine->>unifiedLayout: provide propagated dock
  unifiedLayout-->>Browser: render updated layout
Loading

Suggested reviewers: ramonlsouza, arthurk12

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main layout change for phones in landscape.
Description check ✅ Passed The description directly explains the landscape phone layout changes and related behavior updates.
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

🧹 Nitpick comments (2)
bigbluebutton-html5/imports/ui/components/presentation/presentation-toolbar/styles.js (1)

31-42: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Hidden scrollbar removes the overflow affordance.

The scrollbar is now fully hidden (scrollbar-width: none, ::-webkit-scrollbar { display: none }), and the previous visible "Fancy scroll" styling is removed. If the toolbar content still overflows in edge cases (see the related note on hasRoomForZoomTool in presentation-toolbar/component.jsx), users have no visual cue that hidden controls exist or that they can scroll to reach them.

Consider a lightweight overflow indicator (e.g., an edge gradient or fade) if overflow can still occur after the zoom tool is hidden.

Also applies to: 74-75

🤖 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/presentation/presentation-toolbar/styles.js`
around lines 31 - 42, Update the presentation toolbar styling around the hidden
scrollbar rules to provide a lightweight visual overflow cue, such as an edge
gradient or fade, when horizontally scrollable content extends beyond the
visible area. Preserve the existing scrollbar-hiding behavior and ensure the
indicator does not obstruct toolbar controls.
bigbluebutton-html5/imports/ui/components/presentation/presentation-toolbar/component.jsx (1)

354-360: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider widening hasRoomForZoomTool to account for other optional controls.

hasRoomForZoomTool compares toolbarWidth only against DEFAULT_VALUES.presentationToolbarMinWidth. It does not account for the extra width added by other optional controls, such as the quick poll button, the infinite whiteboard button, and the multi-user tool, when they are simultaneously visible. On a narrow toolbar with several of these controls enabled, content can still overflow after the zoom tool is hidden. Since the scrollbar is now hidden in styles.js, overflow becomes undiscoverable.

If this scenario is rare in practice, keep the current threshold. Otherwise, compute the threshold from the actual set of rendered optional controls.

🤖 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/presentation/presentation-toolbar/component.jsx`
around lines 354 - 360, Review the toolbar-width calculation around
hasRoomForZoomTool and account for the widths of other simultaneously rendered
optional controls, including quick poll, infinite whiteboard, and multi-user
tools, before deciding whether to show zoom. Derive the threshold from the
actual enabled optional-control set so hiding zoom prevents overflow, while
preserving the existing behavior when those controls are not present.
🤖 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/layout/push-layout/pushLayoutEngine.jsx`:
- Around line 319-321: Apply the same !deviceInfo.isPhoneLandscape() guard to
the initial unified-layout camera dock position and size replication around
SET_CAMERA_DOCK_POSITION and SET_CAMERA_DOCK_SIZE in pushLayoutEngine,
preventing those dispatches in phone landscape while preserving replication for
other device orientations.

---

Nitpick comments:
In
`@bigbluebutton-html5/imports/ui/components/presentation/presentation-toolbar/component.jsx`:
- Around line 354-360: Review the toolbar-width calculation around
hasRoomForZoomTool and account for the widths of other simultaneously rendered
optional controls, including quick poll, infinite whiteboard, and multi-user
tools, before deciding whether to show zoom. Derive the threshold from the
actual enabled optional-control set so hiding zoom prevents overflow, while
preserving the existing behavior when those controls are not present.

In
`@bigbluebutton-html5/imports/ui/components/presentation/presentation-toolbar/styles.js`:
- Around line 31-42: Update the presentation toolbar styling around the hidden
scrollbar rules to provide a lightweight visual overflow cue, such as an edge
gradient or fade, when horizontally scrollable content extends beyond the
visible area. Preserve the existing scrollbar-hiding behavior and ensure the
indicator does not obstruct toolbar controls.
🪄 Autofix

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 Plus

Run ID: a0ecd879-bd4c-493b-ad3f-331a0b1bcbbb

📥 Commits

Reviewing files that changed from the base of the PR and between 13c457f and 111b48c.

📒 Files selected for processing (11)
  • bigbluebutton-html5/imports/ui/components/layout/defaultValues.js
  • bigbluebutton-html5/imports/ui/components/layout/layout-manager/unifiedLayout.jsx
  • bigbluebutton-html5/imports/ui/components/layout/observer.tsx
  • bigbluebutton-html5/imports/ui/components/layout/push-layout/hooks.ts
  • bigbluebutton-html5/imports/ui/components/layout/push-layout/pushLayoutEngine.jsx
  • bigbluebutton-html5/imports/ui/components/presentation/component.jsx
  • bigbluebutton-html5/imports/ui/components/presentation/container.jsx
  • bigbluebutton-html5/imports/ui/components/presentation/presentation-toolbar/component.jsx
  • bigbluebutton-html5/imports/ui/components/presentation/presentation-toolbar/styles.js
  • bigbluebutton-html5/imports/ui/components/sidebar-navigation/component.tsx
  • bigbluebutton-html5/imports/utils/deviceInfo.js
💤 Files with no reviewable changes (1)
  • bigbluebutton-html5/imports/ui/components/presentation/container.jsx

Comment on lines +319 to +321
// A phone in landscape arranges the dock on its own terms, so it must not
// follow the presenter's camera dock position and size.
if (syncCameraDockSizeAndPosition && !deviceInfo.isPhoneLandscape()) {

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.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Exclude initial camera replication in phone landscape.

This guard only protects the later replication path. The initial unified-layout path still dispatches SET_CAMERA_DOCK_POSITION and SET_CAMERA_DOCK_SIZE at lines 153-186 while the phone is in landscape.

That path overwrites cameraDockInput.position. After rotation to portrait, UnifiedLayout uses this replicated position instead of the prior local position. Apply the same !deviceInfo.isPhoneLandscape() condition to the initial position and size replication.

🤖 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/layout/push-layout/pushLayoutEngine.jsx`
around lines 319 - 321, Apply the same !deviceInfo.isPhoneLandscape() guard to
the initial unified-layout camera dock position and size replication around
SET_CAMERA_DOCK_POSITION and SET_CAMERA_DOCK_SIZE in pushLayoutEngine,
preventing those dispatches in phone landscape while preserving replication for
other device orientations.

@AtilaU19
AtilaU19 requested a review from Arthurk12 August 4, 2026 13:39
@prlanzarin prlanzarin added this to the Release 4.0 milestone Aug 4, 2026
…udio-only tiles

The audio-only reservation could take every slot of the first page. A mobile page holds 2 tiles (kurento.pagination.mobilePageSizes) and maxAudioOnlyUsers is also 2, so two speaking users without a camera evicted every camera stream from the page.

With no camera stream left on the page, the unified layout counted zero cameras (audio-only tiles are deliberately excluded from that count, issue bigbluebutton#25235) and stopped displaying the camera dock altogether: the presentation took over the whole media area and both the shared webcam and the audio-only tiles were lost.

@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: 3

🤖 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/dropdown/content/styles.js`:
- Around line 44-46: Apply the hasPhoneDimentions breakpoint to the Scrollable
styles alongside smallOnly, including its overflow-y behavior and absolute
positioning bounds, so short wide viewports retain a constrained scrollable
region like Content. Keep the existing narrow-viewport behavior unchanged.

In
`@bigbluebutton-html5/imports/ui/components/layout/push-layout/pushLayoutEngine.jsx`:
- Line 399: Update the meetingLayoutVideoRate handling in pushLayoutEngine to
derive the rate axis from meetingLayoutCameraPosition rather than
cameraDockPosition. Use cameraDockPosition only as the fallback when
synchronized meeting layout data is unavailable, including the related position
handling at the other affected occurrence, so propagated contentTop/contentRight
values retain their correct orientation.

In `@bigbluebutton-html5/imports/ui/components/layout/push-layout/service.ts`:
- Around line 10-12: Update the camera-dock change detection around
isPositionEnforced and getPropagatedCameraDock so phone-landscape layouts
enforced to contentRight also compare the complete dock state, including width
and height. Reuse the shared enforced-layout condition, and restore
cameraDockInput geometry whenever the enforced camera-dock state differs rather
than checking position alone.
🪄 Autofix

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 Plus

Run ID: 2017a2ca-6efb-4b32-9eb2-95742cb32d3c

📥 Commits

Reviewing files that changed from the base of the PR and between a01cf8d and 745d6b6.

📒 Files selected for processing (11)
  • bigbluebutton-html5/imports/ui/components/dropdown/content/styles.js
  • bigbluebutton-html5/imports/ui/components/layout/layout-manager/unifiedLayout.jsx
  • bigbluebutton-html5/imports/ui/components/layout/observer.tsx
  • bigbluebutton-html5/imports/ui/components/layout/push-layout/hooks.ts
  • bigbluebutton-html5/imports/ui/components/layout/push-layout/pushLayoutEngine.jsx
  • bigbluebutton-html5/imports/ui/components/layout/push-layout/service.ts
  • bigbluebutton-html5/imports/ui/components/presentation/component.jsx
  • bigbluebutton-html5/imports/ui/components/presentation/presentation-toolbar/component.jsx
  • bigbluebutton-html5/imports/ui/components/presentation/presentation-toolbar/styles.js
  • bigbluebutton-html5/imports/ui/components/video-provider/hooks/index.ts
  • bigbluebutton-html5/imports/utils/deviceInfo.js
🚧 Files skipped from review as they are similar to previous changes (4)
  • bigbluebutton-html5/imports/ui/components/video-provider/hooks/index.ts
  • bigbluebutton-html5/imports/ui/components/layout/observer.tsx
  • bigbluebutton-html5/imports/ui/components/presentation/component.jsx
  • bigbluebutton-html5/imports/ui/components/layout/layout-manager/unifiedLayout.jsx

Comment on lines +44 to +46
// Short viewports too, not only narrow ones: both callers sit in the slide controls
// bar, which scrolls there and would clip content left in flow.
@media ${smallOnly}, ${hasPhoneDimentions} {

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.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Apply the short-viewport breakpoint to Scrollable too.

When hasPhoneDimentions matches because the viewport height is at most 479px but its width exceeds 40em, Content becomes a fixed full-screen element. Scrollable still receives overflow-y: auto and its absolute bounds only under smallOnly at Line 107-150. Long dropdown content can extend below the viewport without a scrollable region.

 const Scrollable = styled.div`
-  `@media` ${smallOnly} {
+  `@media` ${smallOnly}, ${hasPhoneDimentions} {
🤖 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/dropdown/content/styles.js` around
lines 44 - 46, Apply the hasPhoneDimentions breakpoint to the Scrollable styles
alongside smallOnly, including its overflow-y behavior and absolute positioning
bounds, so short wide viewports retain a constrained scrollable region like
Content. Keep the existing narrow-viewport behavior unchanged.

width: cameraWidth,
height: cameraHeight,
position: cameraPosition,
position: cameraDockPosition,

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.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Use the synchronized camera position to interpret the synchronized rate.

On a phone-landscape receiver, cameraDockPosition is the device-enforced output position. meetingLayoutVideoRate is calculated from the propagated position sent by useMeetingLayoutUpdater. If the synchronized position is contentTop but the local output is forced to contentRight, Lines 169-175 and 262-268 treat a vertical rate as a horizontal width ratio. The size dispatch then overwrites the input dimensions, so portrait mode cannot restore the stored layout.

When applying meetingLayoutVideoRate, derive the axis from meetingLayoutCameraPosition, with cameraDockPosition only as a fallback before meeting layout data exists.

Also applies to: 420-421

🤖 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/layout/push-layout/pushLayoutEngine.jsx`
at line 399, Update the meetingLayoutVideoRate handling in pushLayoutEngine to
derive the rate axis from meetingLayoutCameraPosition rather than
cameraDockPosition. Use cameraDockPosition only as the fallback when
synchronized meeting layout data is unavailable, including the related position
handling at the other affected occurrence, so propagated contentTop/contentRight
values retain their correct orientation.

Comment on lines +10 to +12
const isPositionEnforced = deviceInfo.isPhoneLandscape()
&& !!cameraDockOutput.position
&& cameraDockOutput.position !== cameraDockInput.position;

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.

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

target="bigbluebutton-html5/imports/ui/components/layout/layout-manager/unifiedLayout.jsx"

ast-grep outline "$target" --items all
rg -n -C 20 'isSideBySideCamerasEnforced|cameraDock|contentLeft|contentRight|SET_CAMERA_DOCK_(POSITION|SIZE)' "$target"
rg -n -C 12 'getPropagatedCameraDock|presentationVideoRate|cameraPosition' \
  bigbluebutton-html5/imports/ui/components/layout/push-layout \
  bigbluebutton-html5/imports/ui/components/layout/layout-manager

Repository: bigbluebutton/bigbluebutton

Length of output: 50383


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the rest of unified layout calculations and action reducer/output shape.
sed -n '675,880p' bigbluebutton-html5/imports/ui/components/layout/layout-manager/unifiedLayout.jsx
printf '\n--- push-layout service ---\n'
cat -n bigbluebutton-html5/imports/ui/components/layout/push-layout/service.ts
printf '\n--- relevant layout types ---\n'
rg -n -C 3 'cameraDock|presentationVideoRate|isDragging|focal' bigbluebutton-html5/imports/ui/components/layout -g 'layoutTypes.ts' -g '*.ts' -g '*.tsx' -g '*.jsx' | head -n 250

python3 - <<'PY'
from pathlib import Path
service = Path("bigbluebutton-html5/imports/ui/components/layout/push-layout/service.ts").read_text()
unified = Path("bigbluebutton-html5/imports/ui/components/layout/layout-manager/unifiedLayout.jsx").read_text()

checks = {
  "service_detects_only_position_mismatch": "cameraDockOutput.position !== cameraDockInput.position" in service,
  "service_preserves_input_position_when_not_enforced": "return cameraDockOutput" in service,
  "unified_forces_phone_landscape_position": "isSideBySideCamerasEnforced() ? CAMERADOCK_POSITION.CONTENT_RIGHT" in unified,
  "unified_outputs_camera_bounds_dimensions": "width: cameraDockBounds.width" in unified and "height: cameraDockBounds.height" in unified,
}
print(checks)
for name in checks:
    if checks[name]:
        print(name)
PY

Repository: bigbluebutton/bigbluebutton

Length of output: 36222


Detect device-enforced camera dock geometry changes.

getPropagatedCameraDock only restores input geometry when cameraDockOutput.position !== cameraDockInput.position, so a layout enforced to contentRight still propagates device-sized width and height when the input position already matches. Use the shared enforced-layout condition and restore input geometry when the whole enforced camera dock state differs.

🤖 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/layout/push-layout/service.ts`
around lines 10 - 12, Update the camera-dock change detection around
isPositionEnforced and getPropagatedCameraDock so phone-landscape layouts
enforced to contentRight also compare the complete dock state, including width
and height. Reuse the shared enforced-layout condition, and restore
cameraDockInput geometry whenever the enforced camera-dock state differs rather
than checking position alone.

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

✅ Automated tests have passed!

@prlanzarin
prlanzarin merged commit 15cdc80 into bigbluebutton:v4.0.x-develop Aug 12, 2026
36 checks passed
ramonlsouza pushed a commit that referenced this pull request Sep 1, 2026
All full-page toHaveScreenshot baselines under whiteboard, options and
presentation predate two intentional UI changes on v4.0.x-develop:

- ebb7bc9 (feat(sidebar-navigation): align sizing and notification
  badge colors with design spec) tightened the navigation sidebar gaps,
  shifting every sidebar icon vertically, and
- PR #25565 reworked presentation-toolbar styles,

so 23 @ci tests failed their visual comparison on a clean run against a
4.0.0-rc.1 server even though the rendered UI is correct - the diffs
show only the sidebar icon shift plus meeting-name noise, with shapes
and slide content identical. Regenerated on anton-1 with
--update-snapshots; the refreshed set passed a clean follow-up run.
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.

3 participants