Skip to content

fix(video): never let the grid overflow tile consume a camera slot, + - #25362

Merged
prlanzarin merged 5 commits into
bigbluebutton:v4.0.x-developfrom
prlanzarin:u40d/fix/grid-pagination-inconsistency
Jul 7, 2026
Merged

prlanzarin merged 5 commits into
bigbluebutton:v4.0.x-developfrom
prlanzarin:u40d/fix/grid-pagination-inconsistency

Conversation

@prlanzarin

@prlanzarin prlanzarin commented Jul 3, 2026 •

Copy link
Copy Markdown
Member

What does this PR do?

Auxiliary changes

  • test(playwright): support create modules in the POST body
    • bbb-web reads the inline clientSettingsOverride only from the create
      POST body as an XML module; the GET query param variant is silently
      ignored. Let tests pass createModules through init/createMeeting. The
      checksum still covers only the query string.
  • test(video): cover grid overflow camera precedence and pagination
    • Add regression tests that cover: full camera page stays visible,
      accurate grid+cam aggregated count, pagination reaches every camera,
      and the overflow tile keeps camera-cell geometry when it mounts on a
      static grid (a stale grid template drops it into an implicit
      auto-height row). The geometry spec provisions the smallest grid that
      exercises the mechanism to keep CI cost down.
    • Additionally, switch the grid test spec to use minimize-presentation:
      the v3.0 layout modal does not exist in v4.0, so adaptation was needed.
      The overflow tile also no longer duplicates data-test="overflowTile",
      which was incorrect and made the AI that introduced the test in fix: Unified Layout: tile count plus aggregated users does not match total participant count (3.0) #25254
      hallucinate about "two video lists being rendered".
  • build(ci): allow client settings override on create for tests
    • The grid regression specs provision their pagination config through a
      clientSettingsOverride create module, which bbb-web only honors when
      allowOverrideClientSettingsOnCreateCall is set - it defaults to false,
      so without this the specs skip on every CI run. Set it once at install
      time; bbb-conf --restart already reloads bbb-web afterwards.

Closes Issue(s)

None

How to test

  • Config:
    • grid size 4 (M) / 4 (V);
    • default pagination 0/0;
    • pagination threshold at 4 users: 4/4;
    • showAudioOnlyOnFirstPage: false (optional)
  • Scenario: 6 users

With the presentation minimized (grid active), use a fixed session that it not sharing webcams to verify:

  • 0 cameras: grid shows 3 participant avatars + "3 more users" tile.
  • 4 users sharing cameras: expect 4 cameras and overflow tile showing "2 more users".
  • 5 users sharing cameras: expect 4 cameras + "2 more users" + page buttons; switching pages should show the remaining camera and avatar placeholder for the user.

Presentation maximized (no grid): pagination works as expected with 5 cameras.

@coderabbitai

coderabbitai Bot commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 532dec72-1e67-4e71-b419-93218d6fb948

📥 Commits

Reviewing files that changed from the base of the PR and between 2e694f7 and ca8b02d.

📒 Files selected for processing (8)
  • .github/actions/install-bbb/action.yml
  • bigbluebutton-html5/imports/ui/components/video-provider/video-list/component.tsx
  • bigbluebutton-html5/imports/ui/components/video-provider/video-list/overflow-tile/component.tsx
  • bigbluebutton-tests/playwright/core/elements.ts
  • bigbluebutton-tests/playwright/core/helpers.ts
  • bigbluebutton-tests/playwright/core/page.ts
  • bigbluebutton-tests/playwright/webcam/gridTileCount.spec.ts
  • bigbluebutton-tests/playwright/webcam/gridTileCount.ts
🚧 Files skipped from review as they are similar to previous changes (8)
  • bigbluebutton-html5/imports/ui/components/video-provider/video-list/overflow-tile/component.tsx
  • .github/actions/install-bbb/action.yml
  • bigbluebutton-tests/playwright/core/page.ts
  • bigbluebutton-tests/playwright/core/elements.ts
  • bigbluebutton-tests/playwright/webcam/gridTileCount.spec.ts
  • bigbluebutton-tests/playwright/core/helpers.ts
  • bigbluebutton-html5/imports/ui/components/video-provider/video-list/component.tsx
  • bigbluebutton-tests/playwright/webcam/gridTileCount.ts

Walkthrough

This PR updates webcam overflow counting and grid selection so visible camera tiles, overflow counts, and pagination-aware rendering stay aligned. It also threads optional createModules through Playwright meeting creation, adds webcam selectors and data attributes for tests, enables override-on-create in BBB install, and expands webcam regression coverage for pagination precedence and late-join geometry.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Spec
  participant Page
  participant Helpers
  participant BBBWeb
  Spec->>Page: init(createModules)
  Page->>Helpers: createMeeting(createModules)
  Helpers->>BBBWeb: request meeting creation
  BBBWeb->>Helpers: XML response
  Helpers->>Page: meetingID
Loading

Suggested reviewers: ramonlsouza, Tainan404

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the main fix: the overflow tile no longer consumes a camera slot.
Description check ✅ Passed The description directly explains the overflow-tile fix, grid recompute, and related test/CI changes.
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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a Unified Layout regression where the “+N” overflow tile could trim the streams array in a way that hid an on-page live camera and made that camera unreachable via pagination. It adjusts both the client rendering rules (overflow tile can only replace an avatar, never a camera) and the hidden-user aggregation logic, and adds Playwright regression coverage.

Changes:

  • Update VideoList rendering to never drop a camera for the overflow tile; the tile replaces only an avatar slot, otherwise it occupies an extra slot (“grid == page”).
  • Fix overflow counting in useGridUsers to reflect users actually hidden on the current page, including the +1 correction only when an avatar is replaced.
  • Add Playwright regression tests and new data-* hooks (data-overflow-count, data-video-type, data-user-name, data-test="webcamVideoList") to make assertions more robust.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
bigbluebutton-tests/playwright/webcam/gridTileCount.ts Adds pagination override constant + new cross-page camera reachability regression helper using data-* attributes.
bigbluebutton-tests/playwright/webcam/gridTileCount.spec.ts Wires meeting creation parameters and adds a new regression spec for camera precedence + pagination reachability.
bigbluebutton-tests/playwright/core/elements.ts Adds selectors for the webcam list container and stream-only webcam items.
bigbluebutton-html5/imports/ui/components/video-provider/video-list/overflow-tile/component.tsx Removes duplicate data-test placement from the overflow-tile inner container (test hooks now come from the wrapper).
bigbluebutton-html5/imports/ui/components/video-provider/video-list/component.tsx Implements “overflow tile never hides a camera” rendering + exposes data-* attributes for tests.
bigbluebutton-html5/imports/ui/components/video-provider/hooks/index.ts Corrects overflow counting and ensures off-page render:false streams don’t affect grid/overflow math.

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

@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

Caution

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

⚠️ Outside diff range comments (1)
bigbluebutton-tests/playwright/webcam/gridTileCount.spec.ts (1)

4-19: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Stale precondition comment.

The header comment (lines 4-11) still states the server must be pre-configured with a small grid size, but line 19 now self-provisions this via PAGINATION_CLIENT_SETTINGS_OVERRIDE. This is only effective if the server honors allowOverrideClientSettingsOnCreateCall, otherwise it silently falls back to the server's base config — a caveat the new regression test documents in its own skip message but isn't reflected here.

📝 Suggested comment update
-// Precondition: the server under test must set a small grid size, e.g.
-//   public.kurento.pagination.desktopGridSizes: { moderator: 4, viewer: 4 }
-// so the overflow path can be exercised with a practical number of webcams.
-// (The issue's own reproduction likewise required a custom pagination config.)
+// Precondition: the meeting is created with PAGINATION_CLIENT_SETTINGS_OVERRIDE to
+// self-provision a small grid size (see gridTileCount.ts). This requires the server
+// to honor allowOverrideClientSettingsOnCreateCall; otherwise the base server
+// configuration applies and the test exercises whatever grid size is active.
🤖 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-tests/playwright/webcam/gridTileCount.spec.ts` around lines 4 -
19, Update the stale header comment in the Grid layout participant tile count
spec so it matches the current setup in GridTileCount.initModPage: the test now
passes PAGINATION_CLIENT_SETTINGS_OVERRIDE via createParameter instead of
relying solely on a preconfigured small server grid. Mention that this override
only applies when the server allows client settings overrides on create,
otherwise the test uses the server’s base pagination config, and keep the note
about skipping when the configured grid size exceeds MAX_GRID_SIZE.
🧹 Nitpick comments (2)
bigbluebutton-tests/playwright/webcam/gridTileCount.ts (2)

137-150: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Extract shared webcam-attendee setup helper.

This loop (create page → init → shareWebcam → collect name) duplicates the equivalent loop in checkTileCountMatchesParticipants (lines 60-73), differing only in whether names are collected. Extracting a private helper would remove the duplication for both call sites.

♻️ Proposed helper
+  private async createWebcamAttendees(count: number, namePrefix = 'Attendee'): Promise<string[]> {
+    const names: string[] = [];
+    for (let i = 0; i < count; i += 1) {
+      const name = `${namePrefix}${i + 1}`;
+      // eslint-disable-next-line no-await-in-loop
+      const viewerPage = await this.context.newPage();
+      const viewer = new Page(this.browser, viewerPage, this.modPage.testInfo);
+      // eslint-disable-next-line no-await-in-loop
+      await viewer.init(false, { fullName: name, meetingId: this.modPage.meetingId });
+      // eslint-disable-next-line no-await-in-loop
+      await viewer.shareWebcam({ shouldConfirmSharing: true });
+      names.push(name);
+    }
+    return names;
+  }

Then in checkCameraPrecedenceAcrossPages:

-    const expectedNames: string[] = [];
-
-    for (let i = 0; i < webcamUsers; i += 1) {
-      const name = `Attendee${i + 1}`;
-      const viewerPage = await this.context.newPage();
-      const viewer = new Page(this.browser, viewerPage, this.modPage.testInfo);
-      await viewer.init(false, { fullName: name, meetingId: this.modPage.meetingId });
-      await viewer.shareWebcam({ shouldConfirmSharing: true });
-      expectedNames.push(name);
-    }
+    const expectedNames = await this.createWebcamAttendees(webcamUsers);
🤖 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-tests/playwright/webcam/gridTileCount.ts` around lines 137 -
150, The webcam attendee setup in this loop is duplicated in
checkTileCountMatchesParticipants, so extract the repeated create page → init →
shareWebcam flow into a private helper on the same class. Reuse the existing
Page initialization and shareWebcam calls from checkCameraPrecedenceAcrossPages
and the other matching method, and make the helper optionally collect the
generated attendee name so both call sites can share the same implementation
while preserving their different post-loop behavior.

179-190: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Fix SonarCloud failures: use .dataset and provide a sort comparator.

Static analysis flags these as failures (not just warnings), which may block the required check:

  • Line 180: prefer .dataset.userName over getAttribute('data-user-name') on the raw DOM element inside evaluateAll.
  • Line 182 (and the equivalent at line 186): .sort() with no comparator is flagged; supply one even though correctness here only needs a stable, consistent ordering.
🔧 Proposed fix
     const cameraNames = async () =>
-      cameraTiles.evaluateAll((tiles) => tiles.map((tile) => tile.getAttribute('data-user-name') ?? ''));
+      cameraTiles.evaluateAll((tiles) => tiles.map((tile) => (tile as HTMLElement).dataset.userName ?? ''));
     const seenNames = new Set<string>(await cameraNames());
-    const page1Signature = [...seenNames].sort().join('|');
+    const page1Signature = [...seenNames].sort((a, b) => a.localeCompare(b)).join('|');

     await this.modPage.waitAndClick(e.nextPageVideoPagination);
     await expect
-      .poll(async () => (await cameraNames()).sort().join('|'), {
+      .poll(async () => (await cameraNames()).sort((a, b) => a.localeCompare(b)).join('|'), {
🤖 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-tests/playwright/webcam/gridTileCount.ts` around lines 179 -
190, The failure is in the camera name collection and comparison logic inside
cameraNames and the expect.poll signature. Update the evaluateAll callback to
read the name via each tile’s dataset.userName instead of
getAttribute('data-user-name'), and replace both unsorted sort() calls with a
comparator-based sort so SonarCloud accepts the ordering. Keep the changes
localized to the cameraNames helper and the page1Signature / poll comparison
logic in gridTileCount.

Source: Linters/SAST tools

🤖 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/video-provider/hooks/index.ts`:
- Around line 447-452: The overflow count in the video-provider hook is using
visibleStreamCount, which tracks rendered camera tiles rather than distinct
users, so multi-camera users can cause hidden users to be undercounted. Update
the hidden-user calculation in the hook logic around overflowCount.current to
base the count on users rather than stream tiles, using the existing
userCount/newGridUsers handling to derive the correct overflow label.

---

Outside diff comments:
In `@bigbluebutton-tests/playwright/webcam/gridTileCount.spec.ts`:
- Around line 4-19: Update the stale header comment in the Grid layout
participant tile count spec so it matches the current setup in
GridTileCount.initModPage: the test now passes
PAGINATION_CLIENT_SETTINGS_OVERRIDE via createParameter instead of relying
solely on a preconfigured small server grid. Mention that this override only
applies when the server allows client settings overrides on create, otherwise
the test uses the server’s base pagination config, and keep the note about
skipping when the configured grid size exceeds MAX_GRID_SIZE.

---

Nitpick comments:
In `@bigbluebutton-tests/playwright/webcam/gridTileCount.ts`:
- Around line 137-150: The webcam attendee setup in this loop is duplicated in
checkTileCountMatchesParticipants, so extract the repeated create page → init →
shareWebcam flow into a private helper on the same class. Reuse the existing
Page initialization and shareWebcam calls from checkCameraPrecedenceAcrossPages
and the other matching method, and make the helper optionally collect the
generated attendee name so both call sites can share the same implementation
while preserving their different post-loop behavior.
- Around line 179-190: The failure is in the camera name collection and
comparison logic inside cameraNames and the expect.poll signature. Update the
evaluateAll callback to read the name via each tile’s dataset.userName instead
of getAttribute('data-user-name'), and replace both unsorted sort() calls with a
comparator-based sort so SonarCloud accepts the ordering. Keep the changes
localized to the cameraNames helper and the page1Signature / poll comparison
logic in gridTileCount.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

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

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: d610262c-3a0b-4b16-ad03-2a272fbbbbae

📥 Commits

Reviewing files that changed from the base of the PR and between 75a1b18 and 67c07dd.

📒 Files selected for processing (6)
  • bigbluebutton-html5/imports/ui/components/video-provider/hooks/index.ts
  • bigbluebutton-html5/imports/ui/components/video-provider/video-list/component.tsx
  • bigbluebutton-html5/imports/ui/components/video-provider/video-list/overflow-tile/component.tsx
  • bigbluebutton-tests/playwright/core/elements.ts
  • bigbluebutton-tests/playwright/webcam/gridTileCount.spec.ts
  • bigbluebutton-tests/playwright/webcam/gridTileCount.ts

The overflow tile is created by trimming the tail of the combined
streams array. Avatars are appended after cameras, so on a page fully
occupied by cameras the trim removes a live camera: a 4-slot grid with
4 cameras shows only 3, the aggregated count gains a bogus +1, and
since pagination chunks by page size upstream of the trim, the removed
camera is unreachable on every page. Regression from the tile-count
fix (bigbluebutton#25103, bigbluebutton#25254).

The tile now only takes an avatar's slot; on a full-camera page it
occupies a new slot instead ("grid == page"). Hidden users are counted
from what the page actually shows, with the +1 correction applied only
when an avatar is really replaced.
@prlanzarin
prlanzarin force-pushed the u40d/fix/grid-pagination-inconsistency branch from 67c07dd to b2a4ef3 Compare July 3, 2026 04:18
@prlanzarin
prlanzarin requested a review from Copilot July 3, 2026 04:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Comment on lines +120 to +125
const applicable = thresholdsConf.thresholds
.filter((t: { users: number }) => t.users <= count)
.sort((a: { users: number }, b: { users: number }) => b.users - a.users)[0];
if (applicable?.desktopPageSizes?.moderator != null) {
size = Number(applicable.desktopPageSizes.moderator);
}

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

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

⚠️ Outside diff range comments (1)
bigbluebutton-html5/imports/ui/components/video-provider/video-list/component.tsx (1)

382-410: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Account for the overflow tile in numOfStreams
When the overflow tile is appended on a full-camera page, the per-item count stays at the pre-overflow stream total. That leaves isFocused and the UserActions UI thresholds (numOfStreams > 2 / < 3) one tile behind the actual layout.

🤖 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/video-provider/video-list/component.tsx`
around lines 382 - 410, The stream count in video-list/component.tsx does not
account for the overflow tile, so the layout-based thresholds are computed
against the pre-overflow total. Update the `numOfStreams` calculation in the
`streamsToRender`/`videoItems` flow to include the overflow tile when
`shouldShowOverflowTile` is true, and keep using that adjusted count for
`isFocused` and any `UserActions` visibility checks that depend on
`numOfStreams`.
🧹 Nitpick comments (2)
.github/actions/install-bbb/action.yml (1)

171-173: 🔒 Security & Privacy | 🔵 Trivial

Security default intentionally loosened for CI-only test installs.

API docs define allowOverrideClientSettingsOnCreateCall as controlling whether clientSettingsOverride can be included in the body of the create POST request, and note it defaults to false for security. Since the POST body isn't checksum-covered, enabling this removes a safeguard against unsigned settings injection. This is acceptable for a CI-only test install, but worth confirming this script/config is never reused to provision a production-facing BBB instance.

🤖 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 @.github/actions/install-bbb/action.yml around lines 171 - 173, The
install-bbb action is intentionally enabling
allowOverrideClientSettingsOnCreateCall, which weakens the default security
posture by allowing clientSettingsOverride in create requests. Keep this setting
limited to CI/test installs only by adding a clear CI-only safeguard or warning
in the action setup, and ensure the change is not applied in any production
provisioning path. Refer to the install-bbb action steps that write
bigbluebutton/bbb-web.properties and the allowOverrideClientSettingsOnCreateCall
setting to confirm the restriction.
bigbluebutton-html5/imports/ui/components/video-provider/hooks/index.ts (1)

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

Consider extracting sub-logic to reduce cognitive complexity.

SonarCloud flags useGridUsers cognitive complexity as 17 (threshold 15), largely from the current-user re-injection block (lines 400-443) plus the overflow math. Extracting the self-user insertion into a small helper would bring this under the threshold without behavior changes.

🤖 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/video-provider/hooks/index.ts` at
line 323, The useGridUsers hook is too complex, mainly because the current-user
re-injection logic and overflow calculations are all in one place. Refactor the
self-user insertion block into a small helper function and, if needed, split the
overflow math into another helper so useGridUsers stays below the cognitive
complexity threshold while preserving the existing behavior. Use the
useGridUsers symbol and the current-user re-injection section to locate the
extraction points.

Source: Linters/SAST tools

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

Outside diff comments:
In
`@bigbluebutton-html5/imports/ui/components/video-provider/video-list/component.tsx`:
- Around line 382-410: The stream count in video-list/component.tsx does not
account for the overflow tile, so the layout-based thresholds are computed
against the pre-overflow total. Update the `numOfStreams` calculation in the
`streamsToRender`/`videoItems` flow to include the overflow tile when
`shouldShowOverflowTile` is true, and keep using that adjusted count for
`isFocused` and any `UserActions` visibility checks that depend on
`numOfStreams`.

---

Nitpick comments:
In @.github/actions/install-bbb/action.yml:
- Around line 171-173: The install-bbb action is intentionally enabling
allowOverrideClientSettingsOnCreateCall, which weakens the default security
posture by allowing clientSettingsOverride in create requests. Keep this setting
limited to CI/test installs only by adding a clear CI-only safeguard or warning
in the action setup, and ensure the change is not applied in any production
provisioning path. Refer to the install-bbb action steps that write
bigbluebutton/bbb-web.properties and the allowOverrideClientSettingsOnCreateCall
setting to confirm the restriction.

In `@bigbluebutton-html5/imports/ui/components/video-provider/hooks/index.ts`:
- Line 323: The useGridUsers hook is too complex, mainly because the
current-user re-injection logic and overflow calculations are all in one place.
Refactor the self-user insertion block into a small helper function and, if
needed, split the overflow math into another helper so useGridUsers stays below
the cognitive complexity threshold while preserving the existing behavior. Use
the useGridUsers symbol and the current-user re-injection section to locate the
extraction points.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 0d6b7569-03cf-437a-85f0-9f67894aa0f1

📥 Commits

Reviewing files that changed from the base of the PR and between 67c07dd and b2a4ef3.

📒 Files selected for processing (9)
  • .github/actions/install-bbb/action.yml
  • bigbluebutton-html5/imports/ui/components/video-provider/hooks/index.ts
  • bigbluebutton-html5/imports/ui/components/video-provider/video-list/component.tsx
  • bigbluebutton-html5/imports/ui/components/video-provider/video-list/overflow-tile/component.tsx
  • bigbluebutton-tests/playwright/core/elements.ts
  • bigbluebutton-tests/playwright/core/helpers.ts
  • bigbluebutton-tests/playwright/core/page.ts
  • bigbluebutton-tests/playwright/webcam/gridTileCount.spec.ts
  • bigbluebutton-tests/playwright/webcam/gridTileCount.ts
✅ Files skipped from review due to trivial changes (1)
  • bigbluebutton-html5/imports/ui/components/video-provider/video-list/overflow-tile/component.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • bigbluebutton-tests/playwright/core/elements.ts

@prlanzarin
prlanzarin requested a review from AtilaU19 July 3, 2026 13:47

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

🧹 Nitpick comments (1)
bigbluebutton-tests/playwright/webcam/gridTileCount.ts (1)

184-194: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider extracting the overflow-vs-camera geometry check and aligning both call sites.

The geometry assertion here (Lines 187-194) is duplicated in checkOverflowTileGeometryOnLateJoin (Lines 261-272), and the two copies have diverged: this one asserts only height, while the late-join copy asserts both height and width. If width regressions are worth catching for the recompute path, they arguably matter here too. A shared helper keeps the checks in sync.

♻️ Suggested helper (add to the class, then call from both methods)
private async expectOverflowTileMatchesCameraCell(
  overflowTile: Locator,
  cameraTile: Locator,
): Promise<void> {
  const tileBox = await overflowTile.boundingBox();
  const cameraBox = await cameraTile.boundingBox();
  expect(tileBox, 'the overflow tile must have a bounding box').not.toBeNull();
  expect(cameraBox, 'camera tiles must have a bounding box').not.toBeNull();
  expect(
    Math.abs((tileBox?.height ?? 0) - (cameraBox?.height ?? 1)),
    `the overflow tile (${tileBox?.height}px) must be as tall as a camera cell (${cameraBox?.height}px)`,
  ).toBeLessThanOrEqual(2);
  expect(
    Math.abs((tileBox?.width ?? 0) - (cameraBox?.width ?? 1)),
    `the overflow tile (${tileBox?.width}px) must be as wide as a camera cell (${cameraBox?.width}px)`,
  ).toBeLessThanOrEqual(2);
}

Then replace both inline blocks with await this.expectOverflowTileMatchesCameraCell(overflowTile, cameraTiles.first());.

🤖 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-tests/playwright/webcam/gridTileCount.ts` around lines 184 -
194, The overflow-tile geometry assertion is duplicated between the current
check and checkOverflowTileGeometryOnLateJoin, and the two copies have drifted
apart. Add a shared helper on the class, such as
expectOverflowTileMatchesCameraCell, and have both call sites use it so the
overflowTile vs cameraTiles.first() checks stay aligned. Include both height and
width comparisons in the helper so the recompute path and late-join path enforce
the same geometry expectations.
🤖 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.

Nitpick comments:
In `@bigbluebutton-tests/playwright/webcam/gridTileCount.ts`:
- Around line 184-194: The overflow-tile geometry assertion is duplicated
between the current check and checkOverflowTileGeometryOnLateJoin, and the two
copies have drifted apart. Add a shared helper on the class, such as
expectOverflowTileMatchesCameraCell, and have both call sites use it so the
overflowTile vs cameraTiles.first() checks stay aligned. Include both height and
width comparisons in the helper so the recompute path and late-join path enforce
the same geometry expectations.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 6f127df4-5cf4-4491-bc27-383df4e9f821

📥 Commits

Reviewing files that changed from the base of the PR and between b2a4ef3 and 10f5d0f.

📒 Files selected for processing (3)
  • bigbluebutton-html5/imports/ui/components/video-provider/video-list/component.tsx
  • bigbluebutton-tests/playwright/webcam/gridTileCount.spec.ts
  • bigbluebutton-tests/playwright/webcam/gridTileCount.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • bigbluebutton-html5/imports/ui/components/video-provider/video-list/component.tsx

@prlanzarin prlanzarin changed the title fix(video): never let the grid overflow tile consume a camera slot fix(video): never let the grid overflow tile consume a camera slot, + Jul 3, 2026
@prlanzarin
prlanzarin force-pushed the u40d/fix/grid-pagination-inconsistency branch from 10f5d0f to 2e694f7 Compare July 3, 2026 21:26
bbb-web reads the inline clientSettingsOverride only from the create
POST body as an XML module; the GET query param variant is silently
ignored. Let tests pass createModules through init/createMeeting. The
checksum still covers only the query string.
The grid regression specs provision their pagination config through a
clientSettingsOverride create module, which bbb-web only honors when
allowOverrideClientSettingsOnCreateCall is set — it defaults to false,
so without this the specs skip on every CI run. Set it once at install
time; bbb-conf --restart already reloads bbb-web afterwards.
The grid template only recomputes when the stream count, layout, focus
or dock size changes. The overflow tile mounts and unmounts on
overflowCount transitions that change none of those (a user joins or
leaves without a camera), so the extra tile lands in an implicit
auto-height CSS grid row and renders as a thin strip instead of a
camera-sized cell. Recompute on overflowCount changes as well.
Add regression tests that cover: full camera page stays visible,
accurate grid+cam aggregated count, pagination reaches every camera,
and the overflow tile keeps camera-cell geometry when it mounts on a
static grid (a stale grid template drops it into an implicit
auto-height row). The geometry spec provisions the smallest grid that
exercises the mechanism to keep CI cost down.
The grid specs self-provision their pagination config through a
clientSettingsOverride create module, so they run under default CI
settings instead of skipping forever, and assert through data-*
attributes added to the video tiles instead of structural selectors.

Additionally, switch the grid test spec to use minimize-presentation:
the v3.0 layout modal does not exist in v4.0, so adaptation was needed.
The overflow tile also no longer duplicates data-test="overflowTile",
which was incorrect and made the AI that introduced the test in bigbluebutton#25254
hallucinate about "two video lists being rendered".

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

🧹 Nitpick comments (1)
bigbluebutton-tests/playwright/webcam/gridTileCount.spec.ts (1)

26-31: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Duplicated grid-size skip-guard across all three tests.

The test.skip(!Number.isFinite(gridSize) || gridSize < 1 || gridSize > MAX_GRID_SIZE, ...) block is copy-pasted verbatim in all three tests. Consider extracting a small shared helper (e.g. skipIfGridSizeInvalid(gridSize)) to avoid drift if the guard logic changes later.

♻️ Proposed refactor
+function skipIfGridSizeInvalid(gridSize: number) {
+  test.skip(
+    !Number.isFinite(gridSize) || gridSize < 1 || gridSize > MAX_GRID_SIZE,
+    `requires public.kurento.pagination.desktopGridSizes <= ${MAX_GRID_SIZE} ` +
+      `to exercise the overflow path with a practical number of webcams (configured: ${gridSize})`,
+  );
+}

Then replace each inline block with skipIfGridSizeInvalid(gridSize);.

Also applies to: 51-56, 84-89

🤖 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-tests/playwright/webcam/gridTileCount.spec.ts` around lines 26
- 31, The same grid-size skip guard is duplicated across the three tests in
gridTileCount.spec.ts, so refactor it into a shared helper to prevent drift. Add
a small helper such as skipIfGridSizeInvalid(gridSize) near the existing
gridTileCount test logic, move the Number.isFinite/MAX_GRID_SIZE check and
test.skip call into it, and replace each inline guard in the three test cases
with a call to that helper.
🤖 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.

Nitpick comments:
In `@bigbluebutton-tests/playwright/webcam/gridTileCount.spec.ts`:
- Around line 26-31: The same grid-size skip guard is duplicated across the
three tests in gridTileCount.spec.ts, so refactor it into a shared helper to
prevent drift. Add a small helper such as skipIfGridSizeInvalid(gridSize) near
the existing gridTileCount test logic, move the Number.isFinite/MAX_GRID_SIZE
check and test.skip call into it, and replace each inline guard in the three
test cases with a call to that helper.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 87ab97c2-558c-4574-a616-2c5fc1727011

📥 Commits

Reviewing files that changed from the base of the PR and between 10f5d0f and 2e694f7.

📒 Files selected for processing (6)
  • .github/actions/install-bbb/action.yml
  • bigbluebutton-html5/imports/ui/components/video-provider/video-list/component.tsx
  • bigbluebutton-html5/imports/ui/components/video-provider/video-list/overflow-tile/component.tsx
  • bigbluebutton-tests/playwright/core/elements.ts
  • bigbluebutton-tests/playwright/webcam/gridTileCount.spec.ts
  • bigbluebutton-tests/playwright/webcam/gridTileCount.ts
✅ Files skipped from review due to trivial changes (1)
  • bigbluebutton-html5/imports/ui/components/video-provider/video-list/overflow-tile/component.tsx
🚧 Files skipped from review as they are similar to previous changes (4)
  • .github/actions/install-bbb/action.yml
  • bigbluebutton-tests/playwright/core/elements.ts
  • bigbluebutton-html5/imports/ui/components/video-provider/video-list/component.tsx
  • bigbluebutton-tests/playwright/webcam/gridTileCount.ts

@prlanzarin
prlanzarin force-pushed the u40d/fix/grid-pagination-inconsistency branch from 2e694f7 to ca8b02d Compare July 3, 2026 21:31
@sonarqubecloud

sonarqubecloud Bot commented Jul 3, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

✅ Automated tests have passed!

@prlanzarin prlanzarin self-assigned this Jul 6, 2026
@ramonlsouza

Copy link
Copy Markdown
Member

the pull request does what it says it does, but... is it the expected behavior for the grid? with the changes made in this pull request and the setup described in the "How to test" section, we end up with 5 tiles being displayed with grid size = 4

Screenshot From 2026-07-06 10-13-48

from the grid updates issue (#24186):

Grid mode will display the first 25 items (each tile contains a webcam or avatar of the user). However, if there are 26 or more, the last item will turn into a special tile which indicates that there are users who are not displayed. Clicking on this tile opens the userslist (if hidden).

@prlanzarin

Copy link
Copy Markdown
Member Author

the pull request does what it says it does, but... is it the expected behavior for the grid? with the changes made in this pull request and the setup described in the "How to test" section, we end up with 5 tiles being displayed with grid size = 4

Screenshot From 2026-07-06 10-13-48 from the grid updates issue (#24186):

Grid mode will display the first 25 items (each tile contains a webcam or avatar of the user). However, if there are 26 or more, the last item will turn into a special tile which indicates that there are users who are not displayed. Clicking on this tile opens the userslist (if hidden).

Forwarding the internal reply for the sake of transparency:

IMO, what the PR is fixing should be the expected behavior [...]. Active camera pages should always be honored, regardless of grid sizes. If they aren't, we're breaking contracts:

  • Proctoring use cases: moderators need to see all active cameras at once (eg. pagination toggle off, size 0), or at least the total page size they (provider, costumer) agreed upon
  • The page size configuration contract, which should always have higher priority than the grid size (see above)

The alternative approach would be to make grid size supersede (supplant) page sizes. This is also not a thing that is implemented right now (see the reproduction steps above - pagination isn't activated in that scenario and we lose a camera). Additionally, implementing it would still break proctoring use cases.

@prlanzarin
prlanzarin merged commit d561193 into bigbluebutton:v4.0.x-develop Jul 7, 2026
36 checks passed
antobinary added a commit to antobinary/bigbluebutton that referenced this pull request Nov 2, 2026
Four of the 88 tests the previous commit moved to the nightly go back to
@ci, in the form they had before:

- breakout-listen membership and mic attach survive a client reload
- listening to a second room switches without two concurrent memberships
- a self-transfer to the parent meeting keeps the moderator in audio
- overflow tile never hides a camera and pagination reaches every camera

They are regression tests that came with the LiveKit listen-in work of
bigbluebutton#25638 and the grid overflow fix of bigbluebutton#25362. The first two are the only
tests that reload or switch rooms during a listen-in. The room switch
also guards e4c3dea, where the microphone could stay published in the
main room during a listen-in, so everyone there heard the moderator.

84 tests now leave the gate: about 34 of its 161 minutes of test time
instead of 36. The tests going back have no @media tag, so the legacy
media job does not change. The nightly's @nightly jobs grow to about 43
of their 150 minutes instead of 45.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants