Skip to content

fix: Unified Layout: tile count plus aggregated users does not match total participant count - #25103

Merged
antobinary merged 2 commits into
bigbluebutton:v4.0.x-developfrom
ramonlsouza:issue-25073
May 20, 2026
Merged

antobinary merged 2 commits into
bigbluebutton:v4.0.x-developfrom
ramonlsouza:issue-25073

Conversation

@ramonlsouza

Copy link
Copy Markdown
Member

What does this PR do?

Fix grid and overflow tile calculation

Screencast.from.2026-05-18.16-32-30.mp4

Closes Issue(s)

Closes #25073

How to test

  1. Create a meeting with the configuration above
  2. Join the meeting
  3. Add 31 users
  4. Minimize the presentation
  5. Observe the tile grid
  6. Share camera
  7. See grid - count the number of tiles and sum with the number of participants in the aggregated tile

@coderabbitai

coderabbitai Bot commented May 18, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (1)
  • v4.0.x-release

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: f93058e7-256d-45d8-9717-529fa76afbe7

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ 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.

@ramonlsouza
ramonlsouza requested a review from Arthurk12 May 18, 2026 19:46
@ramonlsouza ramonlsouza added this to the Release 4.0 milestone May 18, 2026
}
}
const streamsToHide = (numOfStreams - gridSize + 1) * -1;
const streamsToRender = shouldShowOverflowTile ? streams.slice(0, streamsToHide) : streams;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

For a brief moment after the current user stops sharing their camera, the grid vanishes
and only the overflow tile remains. Looking deeper into the code, this happens because
streamsToHide momentarily assumes the value 0 — when numOfStreams is 23 (one stream
has just been shut down) and gridSize is 24, causing streams.slice(0, 0) to return
an empty array.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

fixed in 0fa4ab8

@sonarqubecloud

Copy link
Copy Markdown

@ramonlsouza
ramonlsouza requested a review from Arthurk12 May 19, 2026 19:49
@github-actions

Copy link
Copy Markdown

🚨 Automated tests failed

@antobinary
antobinary merged commit 63779bd into bigbluebutton:v4.0.x-develop May 20, 2026
32 of 36 checks passed
ramonlsouza pushed a commit that referenced this pull request Jun 10, 2026
…otal participant count

Backport of #25103 (fixed #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 #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]>
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.
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.
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