Repository navigation
feat(layout): arrange cameras and presentation side by side on phones in landscape - #25565
Conversation
WalkthroughThe 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
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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 valueHidden 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 onhasRoomForZoomToolinpresentation-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 valueConsider widening
hasRoomForZoomToolto account for other optional controls.
hasRoomForZoomToolcomparestoolbarWidthonly againstDEFAULT_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 instyles.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
📒 Files selected for processing (11)
bigbluebutton-html5/imports/ui/components/layout/defaultValues.jsbigbluebutton-html5/imports/ui/components/layout/layout-manager/unifiedLayout.jsxbigbluebutton-html5/imports/ui/components/layout/observer.tsxbigbluebutton-html5/imports/ui/components/layout/push-layout/hooks.tsbigbluebutton-html5/imports/ui/components/layout/push-layout/pushLayoutEngine.jsxbigbluebutton-html5/imports/ui/components/presentation/component.jsxbigbluebutton-html5/imports/ui/components/presentation/container.jsxbigbluebutton-html5/imports/ui/components/presentation/presentation-toolbar/component.jsxbigbluebutton-html5/imports/ui/components/presentation/presentation-toolbar/styles.jsbigbluebutton-html5/imports/ui/components/sidebar-navigation/component.tsxbigbluebutton-html5/imports/utils/deviceInfo.js
💤 Files with no reviewable changes (1)
- bigbluebutton-html5/imports/ui/components/presentation/container.jsx
| // 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()) { |
There was a problem hiding this comment.
🎯 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.
…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.
There was a problem hiding this comment.
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
📒 Files selected for processing (11)
bigbluebutton-html5/imports/ui/components/dropdown/content/styles.jsbigbluebutton-html5/imports/ui/components/layout/layout-manager/unifiedLayout.jsxbigbluebutton-html5/imports/ui/components/layout/observer.tsxbigbluebutton-html5/imports/ui/components/layout/push-layout/hooks.tsbigbluebutton-html5/imports/ui/components/layout/push-layout/pushLayoutEngine.jsxbigbluebutton-html5/imports/ui/components/layout/push-layout/service.tsbigbluebutton-html5/imports/ui/components/presentation/component.jsxbigbluebutton-html5/imports/ui/components/presentation/presentation-toolbar/component.jsxbigbluebutton-html5/imports/ui/components/presentation/presentation-toolbar/styles.jsbigbluebutton-html5/imports/ui/components/video-provider/hooks/index.tsbigbluebutton-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
| // 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} { |
There was a problem hiding this comment.
🎯 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, |
There was a problem hiding this comment.
🗄️ 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.
| const isPositionEnforced = deviceInfo.isPhoneLandscape() | ||
| && !!cameraDockOutput.position | ||
| && cameraDockOutput.position !== cameraDockInput.position; |
There was a problem hiding this comment.
🗄️ 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-managerRepository: 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)
PYRepository: 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.
✅ Automated tests have passed! |
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.
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).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,contentRightmirrors under RTL.contentRightto the whole meeting.Closes Issue(s)
Closes None
More
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 thepresentationBoundsguard and falls back to the presentation area width while the slide has no measured size.deviceInfo.isMobileincludes tablets, so a newisPhoneLandscape()helper was added rather than reusing it.Moderator
Participant