Skip to content

fix: Unified Layout: tile count plus aggregated users does not match total participant count (3.0) - #25254

Merged
ramonlsouza merged 2 commits into
bigbluebutton:v3.0.x-developfrom
imdt-claudiop:backport-25073-grid-tile-count
Jun 10, 2026
Merged

ramonlsouza merged 2 commits into
bigbluebutton:v3.0.x-developfrom
imdt-claudiop:backport-25073-grid-tile-count

Conversation

@Tainan404

Copy link
Copy Markdown
Member

backport of #25103

imdt-claudiop and others added 2 commits June 8, 2026 14:08
…otal participant count

Backport of bigbluebutton#25103 (fixed bigbluebutton#25073 on v4.0.x-develop) to v3.0.x-develop.

In the grid (video focus) layout, when participant webcams exceed the
configured grid size, the surplus is aggregated into a "+N users" tile.
The visible tiles plus the aggregated count did not match the total
number of participants, and the grid could render more tiles than its
configured size; toggling a webcam added/removed a tile instead of
transitioning it.

Fix (identical to bigbluebutton#25103, the useGridSize hook already exists on 3.0):
- clamp numItems to gridSize when the grid is enabled;
- compute streamsToRender by trimming exactly the streams beyond the
  grid size;
- thread gridSize from useGridSize through the container.

Adds a Playwright regression test (webcam/gridTileCount.spec.ts) that
asserts visible tiles + aggregated overflow equals the participant count
and that visible tiles never exceed the grid size.

Co-authored-by: Tainan Felipe <[email protected]>
…E override

The test joins gridSize + 1 webcam users sequentially, so the per-test
timeout must scale with the grid size. MAX_GRID_SIZE can now be raised via
GRID_TILE_COUNT_MAX_GRID_SIZE to run the exact pagination config from the
issue (gridSize 24) on a host with enough capacity.

Co-authored-by: Tainan Felipe <[email protected]>
@Tainan404
Tainan404 requested a review from ramonlsouza June 10, 2026 12:57
@coderabbitai

coderabbitai Bot commented Jun 10, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: a77363ca-6a59-41bd-a45b-d71a37ece3dd

📥 Commits

Reviewing files that changed from the base of the PR and between f18829e and 92bc301.

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

Walkthrough

This PR fixes a grid tile count mismatch in the video layout. It threads a gridSize prop from the container through to the VideoList component via the useGridSize() hook. The setOptimalGrid() function now caps visible items based on gridSize when grid mode is enabled. The renderVideoList() method switches to slice-based stream selection instead of the previous index-removal approach. A regression test adds the overflowTile selector and a GridTileCount helper that verifies the number of visible tiles plus the overflow count equals the total participant count.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • ramonlsouza
  • antobinary
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: a backport of grid tile count fixes (issue 25073) for version 3.0.
Description check ✅ Passed The description is related to the changeset, identifying it as a backport of #25103 which addresses the grid tile count issue.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 and usage tips.

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

✅ Automated tests have passed!

@ramonlsouza ramonlsouza added this to the Release 3.0 milestone Jun 10, 2026
@ramonlsouza ramonlsouza changed the title Backport 25073 grid tile count for 3.0 fix: Unified Layout: tile count plus aggregated users does not match total participant count (3.0) Jun 10, 2026
@ramonlsouza
ramonlsouza merged commit 6f02660 into bigbluebutton:v3.0.x-develop Jun 10, 2026
36 checks passed
prlanzarin added a commit to prlanzarin/bigbluebutton-1 that referenced this pull request Jul 3, 2026
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.

Adds a camera-precedence regression test: full camera page stays
visible, truthful aggregated count, pagination reaches every camera.
Both grid specs self-provision their pagination config via
clientSettingsOverride, so they run under default CI settings, and
assert through data-* attributes instead of structural selectors.

The spec's grid activation switches to minimize-presentation: the v3.0
layout modal the ported flow drove does not exist in this client. The
overflow tile also no longer duplicates data-test="overflowTile" on
wrapper and content: the nested duplicate forced .first() workarounds
in tests and suppressed strict-mode violations.
prlanzarin added a commit to prlanzarin/bigbluebutton-1 that referenced this pull request Jul 3, 2026
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.

Add a regression test that covers: full camera page stays visible,
accurate grid+cam aggregated count, pagination reaches every camera.
The grid specs now self-provision their pagination config via
clientSettingsOverride, so they run under default CI settings, and
assert through data-* attributes 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".
prlanzarin added a commit to prlanzarin/bigbluebutton-1 that referenced this pull request Jul 3, 2026
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 added a commit to prlanzarin/bigbluebutton-1 that referenced this pull request Jul 3, 2026
Add a regression test that covers: full camera page stays visible,
accurate grid+cam aggregated count, pagination reaches every camera.
The grid specs now 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".
prlanzarin added a commit to prlanzarin/bigbluebutton-1 that referenced this pull request Jul 3, 2026
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".
prlanzarin added a commit to prlanzarin/bigbluebutton-1 that referenced this pull request Jul 3, 2026
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".
ramonlsouza pushed a commit that referenced this pull request Jul 9, 2026
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 (#25103, #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.
ramonlsouza pushed a commit that referenced this pull request Jul 9, 2026
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 #25254
hallucinate about "two video lists being rendered".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants