Skip to content

feat: Layout System Revamp (no dialog, intro of Unified layout) - #24316

Merged
antobinary merged 12 commits into
bigbluebutton:v3.0.x-releasefrom
ramonlsouza:alt-layout-changes
Dec 9, 2025
Merged

antobinary merged 12 commits into
bigbluebutton:v3.0.x-releasefrom
ramonlsouza:alt-layout-changes

Conversation

@ramonlsouza

@ramonlsouza ramonlsouza commented Dec 4, 2025 •

Copy link
Copy Markdown
Member

What does this PR do?

This PR is similar to #24204, but uses a different approach: instead of removing the related files and settings, it preserves the deprecated behavior behind a flag in the settings file. The changes include:

  • Introducing enableDeprecatedLayoutSelection flag (default: true) which controls if the layout selection modal and push layout button should appear
  • Introducing new default layout "Unified Layout" that acts similar to Custom Layout when the presentation is active, and similar to Grid Layout when the presentation area is not active
  • Always enabled push layout if enableDeprecatedLayoutSelection: false
  • Included special tile in grid mode when theres more users than the grid size

Closes Issue(s)

Closes #24186

How to test

Test basic layout behavior:

  1. Join a meeting as a presenter
  2. Open/close presentation and verify the layout adjusts correctly
  3. Verify grid mode automatically switches based on presentation state
  4. Verify that users that join with a hidden layout (using enforceLayout custom parameter) stay in this layout and not on the default one

Test layout synchronization:

  1. Join as presenter and make layout changes (move/resize camera dock, open/close presentation)
  2. Join as viewer in another browser/device
  3. Verify viewer's layout follows presenter's changes automatically

@coderabbitai

coderabbitai Bot commented Dec 4, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

Adds a new "Unified Layout" across backend and frontend: a new layout type (UNIFIED_LAYOUT) is registered in Scala and properties; client enums, utilities, and settings include the unified option; a new UnifiedLayout layout-engine component performs responsive layout calculations and dispatches layout outputs; push-layout logic, layout manager, and video/grid code are updated to handle unified state; an overflow count is computed and threaded through video provider components to render a new OverflowTile; styles, localization, and configuration defaults updated accordingly.

Sequence Diagram

sequenceDiagram
    participant Browser as Browser/Window
    participant Unified as UnifiedLayout (layout engine)
    participant LayoutCtx as Layout Context (dispatch/select)
    participant Storage as Storage/Session
    participant UI as UI Components (VideoList, Sidebar, Presentation)

    Browser->>Unified: mount with props (input, deviceType, presentation state)
    Unified->>Storage: read persisted sizes / layoutReady flag
    Unified->>Unified: init() with device-specific defaults
    Unified->>LayoutCtx: Dispatch SET_BROWSER_SIZE and initial OUTPUTs (NAVBAR, MEDIA_AREA, CAMERA_DOCK, etc.)
    LayoutCtx->>UI: update subscribed components

    Browser->>Unified: resize / device change / input update
    Unified->>Unified: throttledCalculatesLayout()
    Unified->>Unified: calculatesMediaBounds(), calculatesCameraDockBounds(), calculatesDropAreas()
    Unified->>Storage: persist cameraDock size / presentationLastState
    Unified->>LayoutCtx: Dispatch updated OUTPUTs (MEDIA_AREA, CAMERA_DOCK, DROP_AREAS, IS_GRID_ENABLED...)
    LayoutCtx->>UI: UI updates (VideoList renders OverflowTile if overflowCount > 0)

    UI->>LayoutCtx: user actions (toggle presentation, open userlist)
    LayoutCtx->>Unified: layout input changes propagated
    Unified->>LayoutCtx: recalculate and dispatch outputs reflecting unified state
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

  • Files needing focused review:
    • bigbluebutton-html5/imports/ui/components/layout/layout-manager/unifiedLayout.jsx — extensive layout logic, storage side-effects, throttling, many dispatched outputs.
    • bigbluebutton-html5/imports/ui/components/layout/layout-manager/layoutEngine.jsx — integration and camera dock conditional behavior.
    • bigbluebutton-html5/imports/ui/components/layout/push-layout/pushLayoutEngine.jsx — push/replication logic changes, hidden-layout handling.
    • bigbluebutton-html5/imports/ui/components/video-provider/hooks/index.ts — change in useGridUsers return type and overflow calculation propagation.
    • bigbluebutton-html5/imports/ui/components/video-provider/video-list/* — new OverflowTile, rendering adjustments, container/props propagation.
    • bigbluebutton-html5/imports/ui/components/video-provider/livekit-camera-bridge/component.tsx & related containers — prop threading (overflowCount) and effect dependencies.
    • bigbluebutton-html5/imports/ui/components/layout/enums.js and utils.js — enum and supported-layouts registration and sync config.
    • akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/Layouts.scala and bigbluebutton-web/grails-app/conf/bigbluebutton.properties — backend layout type additions and accepted property values.
    • bigbluebutton-html5/private/config/settings.yml — settings changes affecting defaults and feature flags.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed The PR description provides clear context about the changes, including the new enableDeprecatedLayoutSelection flag, the Unified Layout behavior, and comprehensive testing instructions.
Linked Issues check ✅ Passed The PR addresses the core objectives from issue #24186: introduces a new Unified Layout mode, implements grid/presentation mode switching, includes overflow tile for excess users, adds configuration flags, and maintains synchronization.
Out of Scope Changes check ✅ Passed All changes are directly aligned with the layout revamp objectives. Modifications include the new Unified Layout component, grid sizing configuration, overflow tile implementation, presentation sync enhancements, and talking state highlighting—all within scope.
Title check ✅ Passed The title accurately describes the core change: a layout system revamp introducing a unified layout and removing the dialog UI.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

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

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/layout/push-layout/hooks.ts (1)

24-24: Type definition is inconsistent with usage.

The applicationSettings parameter type still declares pushLayout: boolean, but it's no longer destructured or used from this object (Line 31 only extracts selectedLayout). The pushLayout value is now passed as a parameter to setMeetingLayout instead.

Update the type to reflect actual usage:

-  applicationSettings: { pushLayout: boolean, selectedLayout: boolean },
+  applicationSettings: { selectedLayout: string },

Note: selectedLayout should likely be typed as string (layout type) rather than boolean.

🧹 Nitpick comments (15)
bigbluebutton-html5/imports/ui/components/nav-bar/options-dropdown/component.jsx (1)

356-361: Flag‑gated “Manage layout” visibility looks correct; consider globalThis for lint compliance

The additional showLayoutButton flag correctly gates the legacy layout modal behind enableDeprecatedLayoutSelection, and the extra PARTICIPANTS_AND_CHAT_ONLY guard aligns with the new layout behavior. One small follow‑up you may want for Sonar/consistency is to prefer globalThis over window here (and, if you go that route, ideally across the other window.meetingClientSettings reads in this file) to satisfy the static analysis rule and better support non‑window environments.

bigbluebutton-html5/imports/ui/components/presentation/container.jsx (2)

52-54: Previous presentation ID tracking looks correct and hook-safe

Capturing currentPresentationId from currentPresentationPage and then deriving prevPresentationId via usePreviousValue(currentPresentationId) is hook-safe (unconditional, fixed call order) and gives you the expected “one render behind” behavior for detecting presentation switches.

One subtlety to keep in mind: when there has never been a presentation, both currentPresentationId and prevPresentationId will be undefined, so equality checks will treat that as “unchanged”. That seems fine given the current usage, but worth keeping in mind if you later extend the logic to distinguish “no presentation yet” from “same presentation”.


263-292: Double‑check shouldRestoreOnUpdate semantics vs subscription behavior

shouldRestoreOnUpdate is computed as:

const shouldRestoreOnUpdate = userIsPresenter
  && currentPresentationId === prevPresentationId ? false : restoreOnUpdate;

and then passed down as the restoreOnUpdate prop. This means:

  • Viewers: behavior is unchanged (shouldRestoreOnUpdate === restoreOnUpdate).
  • Presenters:
    • When the presentation ID changes, you honor the user setting (restoreOnUpdate).
    • Once the ID stabilizes, shouldRestoreOnUpdate becomes false, effectively disabling restore-on-update for that presentation.

That seems intentional, but note that the annotation history subscription (Line 101) still checks the original restoreOnUpdate value, not shouldRestoreOnUpdate, so presenters may still have the presentation auto‑reopened from that path even when shouldRestoreOnUpdate is false.

Two suggestions:

  1. Behavior verification

    Confirm whether the subscription path should also respect the new presenter-specific behavior. If yes, you may want to either:

    • Use shouldRestoreOnUpdate in the onData condition, or
    • Extract the shared logic that decides “should we auto‑restore now?” into a helper to keep both paths consistent.
  2. Small readability/DRY tweak

    Since you already compute currentPresentationId, you could reuse it when passing the prop:

-          currentPresentationId: currentPresentationPage?.presentationId,
+          currentPresentationId,

This avoids re-reading from currentPresentationPage and makes it clearer that the prop and the local variable share semantics.

bigbluebutton-html5/imports/ui/components/video-provider/hooks/index.ts (2)

195-200: Treat getCountData as a proper custom hook for safer hook usage

getCountData internally calls useDeduplicatedSubscription, so it’s effectively a custom hook. To stay within the Rules of Hooks and keep linting reliable, it would be better to rename and expose it as something like:

const useUserCount = () => {
  const { data } = useDeduplicatedSubscription<UsersCountSubscriptionResponse>(
    USER_AGGREGATE_COUNT_SUBSCRIPTION,
  );
  return data?.user_aggregate?.aggregate?.count || 0;
};

and then call const userCount = useUserCount(); from usePageSizeDictionary and useGridUsers.


437-443: Use .some instead of .find in grid de‑duplication (Sonar recommendation)

You can simplify and align with the Sonar suggestion by using .some instead of .find when filtering out users already present in streams:

-  return {
-    streams,
-    gridUsers: gridUsers.filter((u) => !streams.find((s) => s.userId === u.userId)),
-    overflowCount,
-    totalNumberOfStreams: streams.length,
-    totalNumberOfOtherStreams,
-  };
+  return {
+    streams,
+    gridUsers: gridUsers.filter((u) => !streams.some((s) => s.userId === u.userId)),
+    overflowCount,
+    totalNumberOfStreams: streams.length,
+    totalNumberOfOtherStreams,
+  };

This is marginally clearer and avoids creating an unused object just to test existence.

bigbluebutton-html5/imports/ui/components/video-provider/video-list/video-list-item/styles.ts (1)

101-123: Talking/customHighlight background behavior for WebcamConnecting is consistent

Extending WebcamConnecting to:

  • use webcamTalkingBackgroundColor when talking is true, and
  • override with an rgba based on customHighlight when provided

keeps the connecting state visually aligned with the talking/highlighted state used elsewhere in the tile. The logic mirrors the border behavior in Content. Longer‑term, you might want to tighten the customHighlight typing (it’s used as an array but declared as boolean and the file is @ts-nocheck), but that’s non‑blocking.

bigbluebutton-html5/imports/ui/components/video-provider/video-list/overflow-tile/component.tsx (1)

4-4: Use relative import path for layout context.

SonarCloud flagged this absolute import. For consistency with the codebase conventions, consider using a relative path.

-import { layoutDispatch, layoutSelectInput } from '/imports/ui/components/layout/context';
+import { layoutDispatch, layoutSelectInput } from '../../../layout/context';
bigbluebutton-html5/imports/ui/components/layout/layout-manager/layoutEngine.jsx (1)

6-6: Use relative import path for consistency with project linting rules.

The static analysis tool flagged this absolute path import. While other imports in this file also use absolute paths (which appears to be a project convention), consider using a relative path if the linting rules require it for new imports.

-import UnifiedLayout from '/imports/ui/components/layout/layout-manager/unifiedLayout';
+import UnifiedLayout from './unifiedLayout';
bigbluebutton-html5/imports/ui/components/layout/push-layout/pushLayoutEngine.jsx (2)

149-149: Use LAYOUT_TYPE constants instead of string literals for consistency.

Line 130 correctly uses LAYOUT_TYPE.UNIFIED_LAYOUT, but this line uses the string literal 'unified'. Using constants improves maintainability and catches typos at compile time.

-    if (actualLayout === 'custom' || actualLayout === 'unified') {
+    if (actualLayout === LAYOUT_TYPE.CUSTOM_LAYOUT || actualLayout === LAYOUT_TYPE.UNIFIED_LAYOUT) {

390-401: Clarify the comment for the feature flag check.

The comment on line 398 says "always enabled for non-hidden layouts" but the condition is checking enableDeprecatedLayoutSelection. Consider rewording for clarity.

-    // always enabled for non-hidden layouts is layout manager is disabled
+    // Push layout is always enabled when deprecated layout selection is disabled
     if (!window.meetingClientSettings.public.layout.enableDeprecatedLayoutSelection) {
       return true;
     }

Also note: there's a typo "is" → "if" in the original comment.

bigbluebutton-html5/imports/ui/components/video-provider/video-list/overflow-tile/styles.ts (1)

2-6: Use relative import path for palette module.

Static analysis flagged this absolute path import. Consider using a relative path if project linting rules require it.

 import {
   colorWhite,
   webcamBackgroundColor,
   webcamPlaceholderBorder,
-} from '/imports/ui/stylesheets/styled-components/palette';
+} from '../../../../stylesheets/styled-components/palette';
bigbluebutton-html5/imports/ui/components/layout/layout-manager/unifiedLayout.jsx (4)

11-14: Consider extracting shared utility functions.

These functions (windowWidth, windowHeight, min, max) are duplicated from layoutEngine.jsx. Consider extracting them to a shared utility module to reduce code duplication and ensure consistency.


22-28: Move usePrevious hook outside the component.

Defining hooks inside the component causes them to be recreated on every render. While this works because it uses useRef internally, it's unconventional and slightly wasteful. Move it outside the component for clarity and to follow React patterns.

+function usePrevious(value) {
+  const ref = useRef();
+  useEffect(() => {
+    ref.current = value;
+  });
+  return ref.current;
+}
+
 const UnifiedLayout = (props) => {
   const {
     bannerAreaHeight, calculatesActionbarHeight, calculatesNavbarHeight, isMobile,
     prevLayout,
   } = props;
-
-  function usePrevious(value) {
-    const ref = useRef();
-    useEffect(() => {
-      ref.current = value;
-    });
-    return ref.current;
-  }

71-72: Simplify early return syntax.

return () => null is unconventional for an early exit. A simple return or return undefined is clearer when no cleanup is needed.

-    if (deviceType === null) return () => null;
+    if (deviceType === null) return;

284-431: Consider refactoring to reduce cognitive complexity.

This function has a cognitive complexity of 54 (SonarCloud flags >15). While the logic is correct, the deeply nested conditionals for each camera position make it difficult to maintain and test.

Consider extracting position-specific logic into separate helper functions:

const calculateBoundsForTopOrBottom = (params) => { /* ... */ };
const calculateBoundsForLeftOrRight = (params) => { /* ... */ };
const calculateBoundsForSidebar = (params) => { /* ... */ };

const calculatesCameraDockBounds = (sidebarNavWidth, sidebarContentWidth, mediaAreaBounds) => {
  // Common setup...
  
  if (isCameraTop || isCameraBottom) {
    return calculateBoundsForTopOrBottom({ ... });
  }
  if (isCameraLeft || isCameraRight) {
    return calculateBoundsForLeftOrRight({ ... });
  }
  if (isCameraSidebar) {
    return calculateBoundsForSidebar({ ... });
  }
  return cameraDockBounds;
};
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ba6c212 and fc262b1.

📒 Files selected for processing (24)
  • akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/Layouts.scala (1 hunks)
  • bigbluebutton-html5/imports/ui/components/layout/enums.js (2 hunks)
  • bigbluebutton-html5/imports/ui/components/layout/layout-manager/layoutEngine.jsx (3 hunks)
  • bigbluebutton-html5/imports/ui/components/layout/layout-manager/unifiedLayout.jsx (1 hunks)
  • bigbluebutton-html5/imports/ui/components/layout/push-layout/hooks.ts (1 hunks)
  • bigbluebutton-html5/imports/ui/components/layout/push-layout/pushLayoutEngine.jsx (6 hunks)
  • bigbluebutton-html5/imports/ui/components/layout/utils.js (2 hunks)
  • bigbluebutton-html5/imports/ui/components/nav-bar/options-dropdown/component.jsx (1 hunks)
  • bigbluebutton-html5/imports/ui/components/presentation/container.jsx (4 hunks)
  • bigbluebutton-html5/imports/ui/components/video-provider/component.tsx (3 hunks)
  • bigbluebutton-html5/imports/ui/components/video-provider/container.tsx (2 hunks)
  • bigbluebutton-html5/imports/ui/components/video-provider/hooks/index.ts (4 hunks)
  • bigbluebutton-html5/imports/ui/components/video-provider/livekit-camera-bridge/component.tsx (4 hunks)
  • bigbluebutton-html5/imports/ui/components/video-provider/video-list/component.tsx (4 hunks)
  • bigbluebutton-html5/imports/ui/components/video-provider/video-list/container.tsx (3 hunks)
  • bigbluebutton-html5/imports/ui/components/video-provider/video-list/overflow-tile/component.tsx (1 hunks)
  • bigbluebutton-html5/imports/ui/components/video-provider/video-list/overflow-tile/styles.ts (1 hunks)
  • bigbluebutton-html5/imports/ui/components/video-provider/video-list/video-list-item/component.tsx (2 hunks)
  • bigbluebutton-html5/imports/ui/components/video-provider/video-list/video-list-item/styles.ts (3 hunks)
  • bigbluebutton-html5/imports/ui/components/webcam/component.tsx (1 hunks)
  • bigbluebutton-html5/imports/ui/stylesheets/styled-components/palette.js (2 hunks)
  • bigbluebutton-html5/private/config/settings.yml (2 hunks)
  • bigbluebutton-html5/public/locales/en.json (1 hunks)
  • bigbluebutton-web/grails-app/conf/bigbluebutton.properties (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-10-15T17:52:37.432Z
Learnt from: guiiBecker
Repo: bigbluebutton/bigbluebutton PR: 24084
File: bigbluebutton-html5/public/locales/pt.json:323-323
Timestamp: 2025-10-15T17:52:37.432Z
Learning: Translation issues in locale files (bigbluebutton-html5/public/locales/*.json) should be updated in Transifex, the translation management platform used by the BigBlueButton project, rather than being fixed directly in pull requests.

Applied to files:

  • bigbluebutton-html5/public/locales/en.json
📚 Learning: 2024-10-10T12:15:03.265Z
Learnt from: jaapjansma
Repo: bigbluebutton/bigbluebutton PR: 21204
File: bbb-common-web/src/main/scala/org/bigbluebutton/api2/meeting/MeetingsManagerActor.scala:21-21
Timestamp: 2024-10-10T12:15:03.265Z
Learning: When reviewing code changes in BigBlueButton, particularly in case classes like `RegisterUser` in `MeetingsManagerActor.scala`, ensure to accurately distinguish between added parameters and replaced parameters to avoid incorrect assessments.

Applied to files:

  • bigbluebutton-web/grails-app/conf/bigbluebutton.properties
🧬 Code graph analysis (10)
bigbluebutton-html5/imports/ui/components/webcam/component.tsx (3)
bigbluebutton-html5/imports/ui/components/layout/enums.js (2)
  • LAYOUT_TYPE (1-12)
  • LAYOUT_TYPE (1-12)
bigbluebutton-html5/imports/ui/components/video-provider/service.ts (1)
  • isGridEnabled (192-194)
bigbluebutton-html5/imports/ui/components/presentation/container.jsx (1)
  • presentationIsOpen (39-39)
bigbluebutton-html5/imports/ui/components/presentation/container.jsx (1)
bigbluebutton-html5/imports/ui/components/whiteboard/container.jsx (1)
  • currentPresentationPage (137-137)
bigbluebutton-html5/imports/ui/components/video-provider/video-list/component.tsx (1)
bigbluebutton-html5/imports/ui/components/video-provider/service.ts (1)
  • isGridEnabled (192-194)
bigbluebutton-html5/imports/ui/components/layout/push-layout/pushLayoutEngine.jsx (3)
bigbluebutton-html5/imports/ui/components/layout/enums.js (4)
  • LAYOUT_TYPE (1-12)
  • LAYOUT_TYPE (1-12)
  • HIDDEN_LAYOUTS (35-42)
  • HIDDEN_LAYOUTS (35-42)
bigbluebutton-html5/imports/ui/components/presentation/container.jsx (1)
  • presentationIsOpen (39-39)
bigbluebutton-html5/imports/ui/components/layout/layout-manager/layoutEngine.jsx (1)
  • selectedLayout (44-44)
bigbluebutton-html5/imports/ui/components/video-provider/video-list/overflow-tile/component.tsx (1)
bigbluebutton-html5/imports/ui/components/layout/context.jsx (1)
  • layoutDispatch (1592-1592)
bigbluebutton-html5/imports/ui/components/layout/utils.js (1)
bigbluebutton-html5/imports/ui/components/layout/enums.js (6)
  • LAYOUT_TYPE (1-12)
  • LAYOUT_TYPE (1-12)
  • DEVICE_TYPE (14-20)
  • DEVICE_TYPE (14-20)
  • SYNC (52-55)
  • SYNC (52-55)
bigbluebutton-html5/imports/ui/components/layout/push-layout/hooks.ts (1)
bigbluebutton-html5/imports/ui/components/layout/push-layout/pushLayoutEngine.jsx (4)
  • applicationSettings (383-383)
  • applicationSettings (384-386)
  • setMeetingLayout (471-476)
  • pushLayout (467-467)
bigbluebutton-html5/imports/ui/components/layout/layout-manager/unifiedLayout.jsx (4)
bigbluebutton-html5/imports/ui/components/layout/layout-manager/layoutEngine.jsx (6)
  • windowWidth (50-50)
  • windowHeight (51-51)
  • min (52-52)
  • max (53-53)
  • isMobile (48-48)
  • isTablet (49-49)
bigbluebutton-html5/imports/ui/components/layout/context.jsx (2)
  • layoutSelect (1583-1585)
  • layoutDispatch (1592-1592)
bigbluebutton-html5/imports/ui/components/layout/enums.js (4)
  • ACTIONS (57-141)
  • ACTIONS (57-141)
  • CAMERADOCK_POSITION (26-32)
  • CAMERADOCK_POSITION (26-32)
bigbluebutton-html5/imports/ui/components/layout/utils.js (2)
  • isMobile (16-16)
  • isTablet (21-22)
bigbluebutton-html5/imports/ui/components/nav-bar/options-dropdown/component.jsx (2)
bigbluebutton-html5/imports/ui/components/layout/layout-manager/layoutEngine.jsx (1)
  • selectedLayout (44-44)
bigbluebutton-html5/imports/ui/components/layout/enums.js (2)
  • LAYOUT_TYPE (1-12)
  • LAYOUT_TYPE (1-12)
bigbluebutton-html5/imports/ui/components/video-provider/video-list/video-list-item/styles.ts (1)
bigbluebutton-html5/imports/ui/stylesheets/styled-components/palette.js (1)
  • webcamTalkingBackgroundColor (127-127)
🪛 GitHub Check: SonarCloud Code Analysis
bigbluebutton-html5/imports/ui/components/video-provider/video-list/overflow-tile/component.tsx

[failure] 4-4: Do not import modules using an absolute path

See more on https://sonarcloud.io/project/issues?id=bigbluebutton_bigbluebutton&issues=AZrqP1yRi1-4a2sxarYy&open=AZrqP1yRi1-4a2sxarYy&pullRequest=24316

bigbluebutton-html5/imports/ui/components/video-provider/hooks/index.ts

[warning] 441-441: Prefer .some(…) over .find(…).

See more on https://sonarcloud.io/project/issues?id=bigbluebutton_bigbluebutton&issues=AZrqP1zHi1-4a2sxarY1&open=AZrqP1zHi1-4a2sxarY1&pullRequest=24316

bigbluebutton-html5/imports/ui/components/layout/layout-manager/layoutEngine.jsx

[failure] 6-6: Do not import modules using an absolute path

See more on https://sonarcloud.io/project/issues?id=bigbluebutton_bigbluebutton&issues=AZrqP1vji1-4a2sxarYv&open=AZrqP1vji1-4a2sxarYv&pullRequest=24316

bigbluebutton-html5/imports/ui/components/video-provider/video-list/overflow-tile/styles.ts

[failure] 6-6: Do not import modules using an absolute path

See more on https://sonarcloud.io/project/issues?id=bigbluebutton_bigbluebutton&issues=AZrqP1x8i1-4a2sxarYx&open=AZrqP1x8i1-4a2sxarYx&pullRequest=24316

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

[warning] 93-93: Unexpected negated condition.

See more on https://sonarcloud.io/project/issues?id=bigbluebutton_bigbluebutton&issues=AZrqP1u2i1-4a2sxarYS&open=AZrqP1u2i1-4a2sxarYS&pullRequest=24316


[failure] 541-541: Refactor this function to reduce its Cognitive Complexity from 20 to the 15 allowed.

See more on https://sonarcloud.io/project/issues?id=bigbluebutton_bigbluebutton&issues=AZrqP1u2i1-4a2sxarYk&open=AZrqP1u2i1-4a2sxarYk&pullRequest=24316


[warning] 549-549: 'calculatesSidebarContentBounds' is missing in props validation

See more on https://sonarcloud.io/project/issues?id=bigbluebutton_bigbluebutton&issues=AZrqP1u2i1-4a2sxarYr&open=AZrqP1u2i1-4a2sxarYr&pullRequest=24316


[warning] 110-110: Unexpected negated condition.

See more on https://sonarcloud.io/project/issues?id=bigbluebutton_bigbluebutton&issues=AZrqP1u2i1-4a2sxarYU&open=AZrqP1u2i1-4a2sxarYU&pullRequest=24316


[warning] 545-545: 'calculatesSidebarNavWidth' is missing in props validation

See more on https://sonarcloud.io/project/issues?id=bigbluebutton_bigbluebutton&issues=AZrqP1u2i1-4a2sxarYn&open=AZrqP1u2i1-4a2sxarYn&pullRequest=24316


[warning] 627-627: Unexpected negated condition.

See more on https://sonarcloud.io/project/issues?id=bigbluebutton_bigbluebutton&issues=AZrqP1u2i1-4a2sxarYu&open=AZrqP1u2i1-4a2sxarYu&pullRequest=24316


[failure] 284-284: Refactor this function to reduce its Cognitive Complexity from 54 to the 15 allowed.

See more on https://sonarcloud.io/project/issues?id=bigbluebutton_bigbluebutton&issues=AZrqP1u2i1-4a2sxarYX&open=AZrqP1u2i1-4a2sxarYX&pullRequest=24316


[warning] 513-513: Unexpected negated condition.

See more on https://sonarcloud.io/project/issues?id=bigbluebutton_bigbluebutton&issues=AZrqP1u2i1-4a2sxarYh&open=AZrqP1u2i1-4a2sxarYh&pullRequest=24316


[failure] 7-7: Do not import modules using an absolute path

See more on https://sonarcloud.io/project/issues?id=bigbluebutton_bigbluebutton&issues=AZrqP1u2i1-4a2sxarYC&open=AZrqP1u2i1-4a2sxarYC&pullRequest=24316


[failure] 4-4: Do not import modules using an absolute path

See more on https://sonarcloud.io/project/issues?id=bigbluebutton_bigbluebutton&issues=AZrqP1u2i1-4a2sxarYA&open=AZrqP1u2i1-4a2sxarYA&pullRequest=24316


[warning] 13-13: Prefer Math.min() to simplify ternary expressions.

See more on https://sonarcloud.io/project/issues?id=bigbluebutton_bigbluebutton&issues=AZrqP1u2i1-4a2sxarYH&open=AZrqP1u2i1-4a2sxarYH&pullRequest=24316


[warning] 64-64: Prefer globalThis over window.

See more on https://sonarcloud.io/project/issues?id=bigbluebutton_bigbluebutton&issues=AZrqP1u2i1-4a2sxarYP&open=AZrqP1u2i1-4a2sxarYP&pullRequest=24316


[failure] 9-9: Do not import modules using an absolute path

See more on https://sonarcloud.io/project/issues?id=bigbluebutton_bigbluebutton&issues=AZrqP1u2i1-4a2sxarYE&open=AZrqP1u2i1-4a2sxarYE&pullRequest=24316


[warning] 396-396: Unexpected negated condition.

See more on https://sonarcloud.io/project/issues?id=bigbluebutton_bigbluebutton&issues=AZrqP1u2i1-4a2sxarYZ&open=AZrqP1u2i1-4a2sxarYZ&pullRequest=24316


[warning] 54-54: 'isPresentationEnabled' is missing in props validation

See more on https://sonarcloud.io/project/issues?id=bigbluebutton_bigbluebutton&issues=AZrqP1u2i1-4a2sxarYO&open=AZrqP1u2i1-4a2sxarYO&pullRequest=24316


[warning] 18-18: 'bannerAreaHeight' is missing in props validation

See more on https://sonarcloud.io/project/issues?id=bigbluebutton_bigbluebutton&issues=AZrqP1u2i1-4a2sxarYJ&open=AZrqP1u2i1-4a2sxarYJ&pullRequest=24316


[warning] 65-65: Prefer globalThis over window.

See more on https://sonarcloud.io/project/issues?id=bigbluebutton_bigbluebutton&issues=AZrqP1u2i1-4a2sxarYQ&open=AZrqP1u2i1-4a2sxarYQ&pullRequest=24316


[warning] 12-12: Prefer globalThis over window.

See more on https://sonarcloud.io/project/issues?id=bigbluebutton_bigbluebutton&issues=AZrqP1u2i1-4a2sxarYG&open=AZrqP1u2i1-4a2sxarYG&pullRequest=24316


[warning] 11-11: Prefer globalThis over window.

See more on https://sonarcloud.io/project/issues?id=bigbluebutton_bigbluebutton&issues=AZrqP1u2i1-4a2sxarYF&open=AZrqP1u2i1-4a2sxarYF&pullRequest=24316


[warning] 521-521: Unexpected negated condition.

See more on https://sonarcloud.io/project/issues?id=bigbluebutton_bigbluebutton&issues=AZrqP1u2i1-4a2sxarYi&open=AZrqP1u2i1-4a2sxarYi&pullRequest=24316


[warning] 503-503: Unexpected negated condition.

See more on https://sonarcloud.io/project/issues?id=bigbluebutton_bigbluebutton&issues=AZrqP1u2i1-4a2sxarYg&open=AZrqP1u2i1-4a2sxarYg&pullRequest=24316


[failure] 2-2: Do not import modules using an absolute path

See more on https://sonarcloud.io/project/issues?id=bigbluebutton_bigbluebutton&issues=AZrqP1u2i1-4a2sxarX-&open=AZrqP1u2i1-4a2sxarX-&pullRequest=24316


[warning] 543-543: 'calculatesNavbarBounds' is missing in props validation

See more on https://sonarcloud.io/project/issues?id=bigbluebutton_bigbluebutton&issues=AZrqP1u2i1-4a2sxarYl&open=AZrqP1u2i1-4a2sxarYl&pullRequest=24316


[warning] 495-495: Unexpected negated condition.

See more on https://sonarcloud.io/project/issues?id=bigbluebutton_bigbluebutton&issues=AZrqP1u2i1-4a2sxarYf&open=AZrqP1u2i1-4a2sxarYf&pullRequest=24316


[warning] 487-487: Unexpected negated condition.

See more on https://sonarcloud.io/project/issues?id=bigbluebutton_bigbluebutton&issues=AZrqP1u2i1-4a2sxarYe&open=AZrqP1u2i1-4a2sxarYe&pullRequest=24316

bigbluebutton-html5/imports/ui/components/nav-bar/options-dropdown/component.jsx

[warning] 356-356: Prefer globalThis over window.

See more on https://sonarcloud.io/project/issues?id=bigbluebutton_bigbluebutton&issues=AZrqP1l3i1-4a2sxarX8&open=AZrqP1l3i1-4a2sxarX8&pullRequest=24316

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: build-package (bbb-html5)
  • GitHub Check: build-package (bbb-web)
  • GitHub Check: build-package (bbb-apps-akka)
🔇 Additional comments (38)
bigbluebutton-html5/private/config/settings.yml (4)

537-537: Desktop viewer page size reduction aligns with new defaults.

The change from 5 to 4 reduces the number of visible webcams in presentation mode, consistent with the Unified Layout's presentation-focused design.


544-545: Desktop grid sizes reduced to 25 tiles.

Grid size reduced from 48 to 25 for both moderator and viewer roles, matching the PR objective of setting default max tiles to 25 for desktop. This accommodates the new "more users" special tile when grid capacity is exceeded.


548-549: Mobile grid sizes reduced to 8 tiles.

Grid size reduced from 14 to 8 for both moderator and viewer roles on mobile, aligning with the PR objective of 8 mobile tiles as the new default.


816-821: Push layout UI hidden and deprecated layout selection disabled.

Push layout buttons (showPushLayoutButton and showPushLayoutToggle) are hidden when the new Unified Layout is active. The new enableDeprecatedLayoutSelection flag (default false) disables the layout selection modal, preserving access to deprecated layouts only when explicitly enabled. This aligns with the PR intent to simplify layout choices for v3.0.

Verify that this flag is properly wired throughout the frontend code to gate the layout selection UI and preserve backward compatibility when enabled.

bigbluebutton-html5/imports/ui/components/presentation/container.jsx (1)

32-32: New usePreviousValue import is consistent with hook usage

Importing usePreviousValue from /imports/ui/hooks/usePreviousValue and using it later in the component respects the Rules of Hooks and keeps the file’s dependencies cohesive. No issues here.

bigbluebutton-html5/public/locales/en.json (1)

1257-1257: New overflow tile string looks consistent; remember to sync via Transifex

The key name and {overflowCount} placeholder align with the new overflow logic in the video grid. For non‑English locales, ensure this key is added/updated through Transifex rather than directly in JSON.

Based on learnings, translations should flow via Transifex.

akka-bbb-apps/src/main/scala/org/bigbluebutton/core/models/Layouts.scala (1)

91-98: Unified layout mapping is correct and consistent

Mapping "unified" -> "UNIFIED_LAYOUT" keeps the Scala side in sync with the HTML5 LAYOUT_TYPE.UNIFIED_LAYOUT = 'unified' and the new defaultMeetingLayout value.

bigbluebutton-html5/imports/ui/components/layout/utils.js (2)

98-108: Unified layout exposed appropriately in supported layouts

Adding LAYOUT_TYPE.UNIFIED_LAYOUT with name "Unified Layout" and support for all device types matches the PR’s goal of making this the primary default layout across devices. No issues spotted.


123-127: Sync rules for UNIFIED_LAYOUT aligned with CUSTOM_LAYOUT

Using DEFAULT and DOCK in both PROPAGATE_ELEMENTS and REPLICATE_ELEMENTS keeps unified layouts in line with the existing custom layout behavior for push/follow, which is what downstream logic expects.

bigbluebutton-html5/imports/ui/components/video-provider/hooks/index.ts (1)

295-344: Overflow calculation in useGridUsers matches “+N users” tile semantics

Using userCount - gridSize (clamped at 0) and then adding 1 when overflow exists to account for the replaced last tile is consistent with the behavior described in the PR (one grid slot becomes the "+N users" tile). Resetting overflowCount to 0 when there’s no gridData also avoids stale values.

bigbluebutton-web/grails-app/conf/bigbluebutton.properties (1)

223-225: Default layout switch to UNIFIED_LAYOUT is coherent with new layout system

Updating the accepted‑values comment and setting defaultMeetingLayout=UNIFIED_LAYOUT aligns server defaults with the new unified layout type and the Scala/HTML5 enums. Any behavioral impact is configuration‑driven and opt‑out via API, which is appropriate.

bigbluebutton-html5/imports/ui/components/layout/enums.js (2)

1-12: UNIFIED_LAYOUT constant is correctly defined

Adding UNIFIED_LAYOUT: 'unified' to LAYOUT_TYPE matches the server‑side and config values used elsewhere in this PR.


35-42: Confirm intention of treating UNIFIED_LAYOUT as a “hidden” layout

Including LAYOUT_TYPE.UNIFIED_LAYOUT in HIDDEN_LAYOUTS (join‑parameter‑only layouts) is a strong behavioral choice, especially since unified is also exposed in suportedLayouts and used as the default layout. If that’s intentional and gated by enableDeprecatedLayoutSelection, all good; otherwise, it may be worth double‑checking where HIDDEN_LAYOUTS is consulted to avoid accidentally hiding unified from the layout UI.

bigbluebutton-html5/imports/ui/components/video-provider/container.tsx (2)

92-99: Overflow count wiring into provider looks good

Extending useVideoStreams() usage to pick up overflowCount and passing it through providerProps is consistent with the new overflow tile behavior and doesn’t alter existing pagination or filtering logic. Downstream components just need to treat 0 as “no overflow”.


168-188: Provider props extended safely with overflowCount

Adding overflowCount to providerProps keeps both VideoProvider and LiveKitCameraBridge in sync without impacting existing consumers, since the rest of the prop shape is unchanged.

bigbluebutton-html5/imports/ui/components/video-provider/video-list/video-list-item/styles.ts (1)

4-12: Palette import for webcamTalkingBackgroundColor is appropriate

Importing webcamTalkingBackgroundColor from the shared palette keeps the talking‑state background in line with theme variables (and allows CSS custom property overrides).

bigbluebutton-html5/imports/ui/components/video-provider/video-list/video-list-item/component.tsx (1)

305-336: LGTM! Talking indicator props correctly threaded to styled components.

The talking and customHighlight props are properly derived from voiceUser?.talking and settings, then consistently passed to both renderWebcamConnecting and renderWebcamConnectingSqueezed render paths.

bigbluebutton-html5/imports/ui/components/video-provider/video-list/container.tsx (1)

26-27: LGTM! Clean prop threading for overflow count.

The overflowCount prop is properly typed and forwarded through the container to VideoList.

Also applies to: 42-43, 116-117

bigbluebutton-html5/imports/ui/components/video-provider/component.tsx (1)

100-101: LGTM! Overflow count prop properly integrated into VideoProvider.

The overflowCount prop is correctly added to the interface and forwarded to VideoListContainer in the render method.

Also applies to: 1376-1377, 1388-1389

bigbluebutton-html5/imports/ui/components/webcam/component.tsx (1)

344-347: LGTM! Unified layout grid logic correctly implemented.

The isGridEnabled condition properly enables grid mode when:

  1. In VIDEO_FOCUS layout, or
  2. In UNIFIED_LAYOUT when presentation is not open

This aligns with the PR objective that "Unified Layout behaves like Grid Layout when no presentation is active."

bigbluebutton-html5/imports/ui/components/video-provider/video-list/overflow-tile/component.tsx (1)

43-62: LGTM! Clean overflow tile implementation.

The component correctly:

  • Returns null when overflowCount <= 0
  • Prevents redundant panel opening when already open
  • Renders placeholder avatars with overflow count label

The hardcoded avatar placeholders provide a clear visual cue for the stacked users effect.

bigbluebutton-html5/imports/ui/components/video-provider/video-list/component.tsx (2)

421-433: LGTM! Overflow tile correctly integrated into video list rendering.

The overflow tile is properly:

  • Conditionally appended when shouldShowOverflowTile is true
  • Given a unique stable key ("overflow-tile")
  • Marked as non-focused

368-380: Verify browser compatibility requirements before suggesting findLastIndex.

The current approach using reverse().find() suggests the project may target older browsers. While findLastIndex is well-supported in modern environments (Chrome/Edge 97+, Firefox 104+, Safari 15.4+, Node.js 18+), this refactoring should only be applied if the project's minimum supported browser versions meet these requirements. Check .browserslistrc, tsconfig.json, or package.json to confirm compatibility targets before adopting this pattern.

bigbluebutton-html5/imports/ui/components/layout/layout-manager/layoutEngine.jsx (2)

83-104: LGTM!

The camera dock bounds logic correctly handles the unified layout edge cases. The conditions are well-structured: when unified layout is active with zero cameras and an open presentation, the camera dock is appropriately collapsed to zero dimensions.


368-370: LGTM!

The new switch case follows the established pattern for other layout types, correctly setting the data-layout attribute and rendering the UnifiedLayout component with the required props.

bigbluebutton-html5/imports/ui/components/video-provider/livekit-camera-bridge/component.tsx (2)

71-71: LGTM!

The overflowCount prop is properly typed and threaded through the component to the VideoListContainer.

Also applies to: 100-100, 610-610


584-592: Verify if overflowCount should be in this dependency array.

overflowCount is not used inside this effect's body, but adding it as a dependency will cause the effect to re-run whenever the overflow count changes. This could trigger unnecessary stream update logic.

If the intent is to force a re-evaluation when overflow changes, consider adding a comment explaining this. Otherwise, if this was added inadvertently, it should be removed.

bigbluebutton-html5/imports/ui/components/layout/push-layout/hooks.ts (1)

33-45: LGTM!

The refactored setMeetingLayout function correctly accepts pushLayout as a parameter, providing the caller with control over the sync behavior. This aligns with the usage in pushLayoutEngine.jsx where setMeetingLayout(pushLayout) is called.

bigbluebutton-html5/imports/ui/components/layout/push-layout/pushLayoutEngine.jsx (4)

129-134: LGTM!

The initialization logic correctly sets isGridEnabled based on whether the unified layout is active and presentation visibility, ensuring proper grid state on load.


248-248: LGTM!

Persisting presentationLastState to session ensures state consistency during layout replication.


355-355: LGTM!

The setMeetingLayout call correctly passes the pushLayout parameter, matching the updated function signature in hooks.ts.


359-368: LGTM!

The grid state update logic properly handles both unified and non-unified layouts. For unified layout, isGridEnabled is tied to presentation visibility (grid when presentation is closed), while other layouts set it based on whether VIDEO_FOCUS is selected.

bigbluebutton-html5/imports/ui/components/video-provider/video-list/overflow-tile/styles.ts (2)

8-91: LGTM!

The styled components are well-structured with appropriate use of conditional styling, CSS transitions, and pseudo-elements. The avatar stacking logic using dynamic z-index and positioning creates the intended overlapping effect.


93-101: LGTM!

The default export aggregating all styled components follows the established pattern in the codebase.

bigbluebutton-html5/imports/ui/components/layout/layout-manager/unifiedLayout.jsx (4)

138-252: Initialization logic looks well-structured.

The init function properly handles both mobile and desktop cases, merges state with defaultsDeep, and correctly overrides sidebar panels when transitioning from special layout types.


254-282: Verify consistent use of hasPresentation logic.

The hasPresentation calculation here (line 261) differs from the one in calculatesMediaBounds (line 449):

  • Here: isPresentationEnabled && slidesLength !== 0
  • Line 449: (isPresentationEnabled && slidesLength !== 0) || isOpen

This may be intentional based on different contexts, but verify this inconsistency doesn't cause unexpected behavior when isOpen is true but slides are empty.


541-801: Layout orchestration function is comprehensive but complex.

The function correctly calculates and dispatches all layout outputs. While the cognitive complexity (20) slightly exceeds the threshold, the sequential structure of "calculate then dispatch" is clear. Consider adding PropTypes validation for the destructured props (calculatesNavbarBounds, calculatesSidebarNavWidth, etc.) to address the static analysis warnings.

To address prop validation warnings, consider adding PropTypes at the end of the file:

import PropTypes from 'prop-types';

UnifiedLayout.propTypes = {
  bannerAreaHeight: PropTypes.func.isRequired,
  calculatesActionbarHeight: PropTypes.func.isRequired,
  calculatesNavbarHeight: PropTypes.func.isRequired,
  calculatesNavbarBounds: PropTypes.func.isRequired,
  calculatesSidebarNavWidth: PropTypes.func.isRequired,
  calculatesSidebarNavHeight: PropTypes.func.isRequired,
  calculatesSidebarNavBounds: PropTypes.func.isRequired,
  calculatesSidebarContentWidth: PropTypes.func.isRequired,
  calculatesSidebarContentBounds: PropTypes.func.isRequired,
  calculatesMediaAreaBounds: PropTypes.func.isRequired,
  calculatesActionbarBounds: PropTypes.func.isRequired,
  baseCameraDockBounds: PropTypes.func.isRequired,
  isMobile: PropTypes.bool.isRequired,
  isTablet: PropTypes.bool.isRequired,
  isPresentationEnabled: PropTypes.bool.isRequired,
  prevLayout: PropTypes.string,
};

803-804: LGTM!

Returning null is the correct pattern for a component that manages layout state through context without rendering any UI.

Comment on lines +56 to +57
const throttledCalculatesLayout = throttle(() => calculatesLayout(),
50, { trailing: true, leading: true });

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.

⚠️ Potential issue | 🟠 Major

Throttle function is recreated on every render, defeating its purpose.

throttledCalculatesLayout is created at the component body level without memoization. This means a new throttled function is created on every render, causing the throttle state to reset and effectively bypassing the throttle behavior entirely.

Wrap with useRef or useCallback to preserve the throttled instance:

-  const throttledCalculatesLayout = throttle(() => calculatesLayout(),
-    50, { trailing: true, leading: true });
+  const throttledCalculatesLayoutRef = useRef(null);
+  if (!throttledCalculatesLayoutRef.current) {
+    throttledCalculatesLayoutRef.current = throttle(() => calculatesLayout(),
+      50, { trailing: true, leading: true });
+  }
+  const throttledCalculatesLayout = throttledCalculatesLayoutRef.current;

Note: You may need to adjust the approach depending on how calculatesLayout captures closure variables. Consider using useCallback for calculatesLayout if needed.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const throttledCalculatesLayout = throttle(() => calculatesLayout(),
50, { trailing: true, leading: true });
const throttledCalculatesLayoutRef = useRef(null);
if (!throttledCalculatesLayoutRef.current) {
throttledCalculatesLayoutRef.current = throttle(() => calculatesLayout(),
50, { trailing: true, leading: true });
}
const throttledCalculatesLayout = throttledCalculatesLayoutRef.current;
🤖 Prompt for AI Agents
In
bigbluebutton-html5/imports/ui/components/layout/layout-manager/unifiedLayout.jsx
around lines 56-57, the throttledCalculatesLayout is recreated on every render
which resets throttle state; to fix, create and preserve a single throttled
function instance using useRef (e.g., store throttle(...) in a ref.current on
mount) or memoize it with useCallback/useMemo so the same throttled function
persists across renders, ensure calculatesLayout is stable (wrap it in
useCallback or update the ref when its dependencies change) and wire up the
preserved throttled function where currently used; keep the throttle options
(50ms, leading/trailing) as-is and clean up any timers on unmount if using refs.

Comment on lines +59 to +69
useEffect(() => {
window.addEventListener('resize', () => {
layoutContextDispatch({
type: ACTIONS.SET_BROWSER_SIZE,
value: {
width: window.document.documentElement.clientWidth,
height: window.document.documentElement.clientHeight,
},
});
});
}, []);

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.

⚠️ Potential issue | 🔴 Critical

Memory leak: resize event listener is never removed.

The useEffect adds a window resize listener but lacks a cleanup function. This causes the listener to persist after unmount, leading to memory leaks and potential stale closure issues with layoutContextDispatch.

   useEffect(() => {
-    window.addEventListener('resize', () => {
+    const handleResize = () => {
       layoutContextDispatch({
         type: ACTIONS.SET_BROWSER_SIZE,
         value: {
           width: window.document.documentElement.clientWidth,
           height: window.document.documentElement.clientHeight,
         },
       });
-    });
-  }, []);
+    };
+    window.addEventListener('resize', handleResize);
+    return () => {
+      window.removeEventListener('resize', handleResize);
+    };
+  }, [layoutContextDispatch]);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
useEffect(() => {
window.addEventListener('resize', () => {
layoutContextDispatch({
type: ACTIONS.SET_BROWSER_SIZE,
value: {
width: window.document.documentElement.clientWidth,
height: window.document.documentElement.clientHeight,
},
});
});
}, []);
useEffect(() => {
const handleResize = () => {
layoutContextDispatch({
type: ACTIONS.SET_BROWSER_SIZE,
value: {
width: window.document.documentElement.clientWidth,
height: window.document.documentElement.clientHeight,
},
});
};
window.addEventListener('resize', handleResize);
return () => {
window.removeEventListener('resize', handleResize);
};
}, [layoutContextDispatch]);
🧰 Tools
🪛 GitHub Check: SonarCloud Code Analysis

[warning] 64-64: Prefer globalThis over window.

See more on https://sonarcloud.io/project/issues?id=bigbluebutton_bigbluebutton&issues=AZrqP1u2i1-4a2sxarYP&open=AZrqP1u2i1-4a2sxarYP&pullRequest=24316


[warning] 65-65: Prefer globalThis over window.

See more on https://sonarcloud.io/project/issues?id=bigbluebutton_bigbluebutton&issues=AZrqP1u2i1-4a2sxarYQ&open=AZrqP1u2i1-4a2sxarYQ&pullRequest=24316

🤖 Prompt for AI Agents
In
bigbluebutton-html5/imports/ui/components/layout/layout-manager/unifiedLayout.jsx
around lines 59 to 69, the useEffect attaches a window 'resize' listener with an
anonymous callback and never removes it; change it to define the resize handler
function (so it can be referenced when removing), call layoutContextDispatch
inside that handler, add any necessary dependencies (e.g.,
layoutContextDispatch) to the effect dependency array, and return a cleanup
function from useEffect that calls window.removeEventListener('resize', handler)
to prevent memory leaks and stale closures.

const { height: actionBarHeight } = calculatesActionbarHeight();
const mediaAreaHeight = windowHeight() - (DEFAULT_VALUES.navBarHeight + actionBarHeight);
const mediaAreaWidth = windowWidth() - (sidebarNavWidth + sidebarContentWidth);
const DROP_ZONE_DEFAUL_SIZE = 100;

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.

⚠️ Potential issue | 🟡 Minor

Typo in constant name: DEFAUL should be DEFAULT.

-    const DROP_ZONE_DEFAUL_SIZE = 100;
+    const DROP_ZONE_DEFAULT_SIZE = 100;

Update all usages of this constant accordingly.

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In
bigbluebutton-html5/imports/ui/components/layout/layout-manager/unifiedLayout.jsx
around line 87, the constant name DROP_ZONE_DEFAUL_SIZE contains a typo; rename
it to DROP_ZONE_DEFAULT_SIZE and update all references/usages within this file
(and any imports/exports) to use the corrected name, ensuring any tests or
components that rely on the constant still import it correctly and run without
lint/type errors.

Comment on lines +525 to +527
default: {
console.log('presentation - camera default');
}

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.

⚠️ Potential issue | 🟡 Minor

Remove debug console.log statement.

Debug logging should not be present in production code. Either remove it or use a proper logging mechanism with appropriate log levels.

         default: {
-          console.log('presentation - camera default');
+          // Intentionally empty - falls through to default bounds below
         }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
default: {
console.log('presentation - camera default');
}
default: {
// Intentionally empty - falls through to default bounds below
}
🤖 Prompt for AI Agents
In
bigbluebutton-html5/imports/ui/components/layout/layout-manager/unifiedLayout.jsx
around lines 525 to 527, remove the debug console.log('presentation - camera
default') from the default case; replace it with no-op or a proper logging call
if needed (use the project's logging utility at debug level) and ensure no
console.log remains in production code.

Comment on lines +126 to +128
// rgba version of colorPrimary (0F70D7) with 15% opacity for talking indicator background
const webcamTalkingBackgroundColor = 'var(--webcam-talking-background-color, rgba(13, 109, 252, 0.15))';

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.

⚠️ Potential issue | 🟡 Minor

Comment inaccuracy: RGB values don't match colorPrimary.

The comment states this is an rgba version of colorPrimary (0F70D7), but:

  • 0F70D7 = rgb(15, 112, 215)
  • The actual value uses rgba(13, 109, 252, 0.15) = 0D6DFC

Consider updating the comment to reflect the actual color or adjusting the RGB values to match colorPrimary.

-// rgba version of colorPrimary (0F70D7) with 15% opacity for talking indicator background
-const webcamTalkingBackgroundColor = 'var(--webcam-talking-background-color, rgba(13, 109, 252, 0.15))';
+// rgba version of colorPrimary (#0F70D7) with 15% opacity for talking indicator background
+const webcamTalkingBackgroundColor = 'var(--webcam-talking-background-color, rgba(15, 112, 215, 0.15))';
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// rgba version of colorPrimary (0F70D7) with 15% opacity for talking indicator background
const webcamTalkingBackgroundColor = 'var(--webcam-talking-background-color, rgba(13, 109, 252, 0.15))';
// rgba version of colorPrimary (#0F70D7) with 15% opacity for talking indicator background
const webcamTalkingBackgroundColor = 'var(--webcam-talking-background-color, rgba(15, 112, 215, 0.15))';
🤖 Prompt for AI Agents
In bigbluebutton-html5/imports/ui/stylesheets/styled-components/palette.js
around lines 126-128, the comment incorrectly claims the RGBA is derived from
colorPrimary (0F70D7) while the actual RGBA uses rgb(13,109,252) (0D6DFC);
either update the RGBA to match colorPrimary by using rgba(15,112,215,0.15) or
change the comment to state the RGBA is based on 0D6DFC (rgba(13,109,252,0.15)),
ensuring the comment and value are consistent and keep the 0.15 opacity.

@antobinary antobinary added this to the Release 3.0 milestone Dec 4, 2025

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

🧹 Nitpick comments (1)
bigbluebutton-html5/private/config/settings.yml (1)

820-821: Clarify the comment to document both enabled and disabled states.

The comment on line 820 only explains the behavior when enableDeprecatedLayoutSelection is false. For better clarity and maintainability, consider expanding the comment to explicitly document both states:

  • When true: layout selection modal and related UI are shown (deprecated behavior)
  • When false: new Unified Layout is active (new behavior)
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fc262b1 and e5b5286.

📒 Files selected for processing (2)
  • bigbluebutton-html5/private/config/settings.yml (1 hunks)
  • bigbluebutton-web/grails-app/conf/bigbluebutton.properties (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • bigbluebutton-web/grails-app/conf/bigbluebutton.properties
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: build-package (bbb-html5)
  • GitHub Check: build-package (bbb-web)
🔇 Additional comments (2)
bigbluebutton-html5/private/config/settings.yml (2)

820-821: Verify the default value for enableDeprecatedLayoutSelection aligns with PR objectives.

The PR objectives state "Adds settings flag enableDeprecatedLayoutSelection (default: false)" to enable the new Unified Layout by default, but this file sets it to true. Confirm whether this is intentional for backward compatibility during rollout or if it should be false per the stated objectives.


816-817: Verify that push layout UI visibility changes are complete.

The PR objectives mention disabling push layout UI by setting showPushLayoutButton: false and showPushLayoutToggle: false, but both remain true at lines 816–817. Confirm whether:

  1. These changes belong in a separate file, or
  2. They should be applied here as part of this configuration update

Additionally, clarify the relationship between enableDeprecatedLayoutSelection and these push layout UI settings. The PR states: "When enableDeprecatedLayoutSelection is false, push layout is always enabled"—does this mean the UI buttons should reflect conditional visibility logic?

@sonarqubecloud

sonarqubecloud Bot commented Dec 5, 2025

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
69.1% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

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

🧹 Nitpick comments (1)
bigbluebutton-html5/imports/ui/components/layout/push-layout/pushLayoutEngine.jsx (1)

390-400: Minor typo in comment; logic is correct.

The push layout logic correctly:

  1. Disables push for hidden layouts (except unified layout)
  2. Always enables push when deprecated layout selection is disabled (per PR objectives)
-    // always enabled for non-hidden layouts is layout manager is disabled
+    // always enabled for non-hidden layouts if layout manager is disabled
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e5b5286 and a8f2ef0.

📒 Files selected for processing (1)
  • bigbluebutton-html5/imports/ui/components/layout/push-layout/pushLayoutEngine.jsx (5 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
bigbluebutton-html5/imports/ui/components/layout/push-layout/pushLayoutEngine.jsx (3)
bigbluebutton-html5/imports/ui/components/layout/enums.js (4)
  • LAYOUT_TYPE (1-12)
  • LAYOUT_TYPE (1-12)
  • HIDDEN_LAYOUTS (35-42)
  • HIDDEN_LAYOUTS (35-42)
bigbluebutton-html5/imports/ui/components/presentation/container.jsx (1)
  • presentationIsOpen (39-39)
bigbluebutton-html5/imports/ui/components/layout/layout-manager/layoutEngine.jsx (1)
  • selectedLayout (44-44)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build-package (bbb-html5)
🔇 Additional comments (5)
bigbluebutton-html5/imports/ui/components/layout/push-layout/pushLayoutEngine.jsx (5)

15-16: LGTM!

Import correctly added to support the new hidden layouts check in getKeepPushingLayout.


129-134: LGTM!

Grid state initialization correctly differentiates unified layout behavior (tied to presentation state) from other layouts (based on VIDEO_FOCUS).


149-149: LGTM!

Extending the camera dock setup to 'unified' layouts is consistent with the requirement that unified layout behaves like custom layout when presentation is active.


358-367: LGTM!

The bifurcated logic correctly handles grid state updates:

  • Non-unified layouts derive grid state from VIDEO_FOCUS comparison
  • Unified layout ties grid state to presentation visibility, updating on either layout switch or presentation toggle

354-354: Verify the useMeetingLayoutUpdater hook signature.

The call now passes pushLayout as an argument to setMeetingLayout. Confirm that the hook's returned function accepts this parameter and processes it correctly. Check the hook implementation to ensure the parameter is properly handled throughout the layout update logic.

@github-actions

github-actions Bot commented Dec 5, 2025

Copy link
Copy Markdown

Automated tests Summary

✅ All the CI tests have 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.

Layout Revamp (BBB 3.0)

3 participants