Repository navigation
fix: Unified Layout: tile count plus aggregated users does not match total participant count - #25103
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| } | ||
| } | ||
| const streamsToHide = (numOfStreams - gridSize + 1) * -1; | ||
| const streamsToRender = shouldShowOverflowTile ? streams.slice(0, streamsToHide) : streams; |
There was a problem hiding this comment.
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.
|
🚨 Automated tests failed |
63779bd
into
bigbluebutton:v4.0.x-develop
…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]>
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.
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".
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.
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.



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