Skip to content

fix(video-provider): clear stale grid avatars when a presentation is open - #25482

Merged
antobinary merged 2 commits into
bigbluebutton:v4.0.x-developfrom
AtilaU19:task-2762
Jul 21, 2026
Merged

antobinary merged 2 commits into
bigbluebutton:v4.0.x-developfrom
AtilaU19:task-2762

Conversation

@AtilaU19

@AtilaU19 AtilaU19 commented Jul 21, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Clears the stale grid-avatar cache so camera-less "avatar" tiles stop lingering in the camera dock over a maximized presentation. Audio-only tiles are intentionally left scoped to the unified layout (not grid-only), so speaking tiles still appear alongside a shared webcam over an open presentation — per #25235/#25359.

Closes Issue(s)

Closes None

How to test

  1. Join a meeting in the unified layout with several participants; unmute mics.
  2. Share one webcam so the camera dock appears over the presentation.
  3. Minimize the presentation (grid shows cameras + avatars), then maximize it again.
    • Before: camera-less avatar tiles linger in the dock over the presentation (with showAudioOnlyOnFirstPage=false, more than maxAudioOnlyUsers appear).
    • After: only the real webcam(s) remain; grid avatars are gone.
  4. With showAudioOnlyOnFirstPage=true: speaking tiles still appear alongside the webcam over the open presentation (unchanged, per Inconsistent display of who is talking tile at the top (unified layout) #25235/Fix(html5): who is talking tiles unified #25359).

@coderabbitai

coderabbitai Bot commented Jul 21, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

useGridUsers now clears grid and overflow state and returns empty results when isGridEnabled is false, skipping subscription data processing. A comment in useAudioOnlyUsers clarifies that its gating is based on the unified layout rather than isGridEnabled.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Suggested reviewers: prlanzarin, ramonlsouza

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly summarizes the main change: clearing stale grid avatars when a presentation is open.
Description check ✅ Passed The description matches the changeset and explains the stale grid-avatar fix plus the unchanged audio-only behavior.
✨ 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 updates the video-provider hooks to prevent grid-only UI elements (audio-only tiles and grid avatars) from persisting in the camera dock when a presentation is open, by keying visibility off the isGridEnabled storage flag.

Changes:

  • Clear cached grid user/overflow state when isGridEnabled is false so avatars/overflow don’t linger.
  • Gate audio-only tile inclusion on isGridEnabled (instead of layout type) to hide them when the presentation disables the grid.
  • Update audio-only pagination limits (showAudioOnlyOnFirstPage, maxAudioOnlyUsers) to be grid-enabled only.

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


const layoutType = layoutSelect((i: Layout) => i.layoutType);
const isUnifiedLayout = layoutType === LAYOUT_TYPE.UNIFIED_LAYOUT;
const isGridEnabled = useStorageKey('isGridEnabled') as boolean;
Comment on lines 549 to 553
const { data, loading, errors } = useAudioOnlySubscription();
const layoutType = layoutSelect((i: Layout) => i.layoutType);
const isGridEnabled = useStorageKey('isGridEnabled');
const {
showAudioOnlyOnFirstPage,
} = window.meetingClientSettings.public.kurento.cameraSortingModes;
@ramonlsouza

Copy link
Copy Markdown
Member

I believe this PR changes the current expected behavior for audio-only tiles. They are not intended to be exclusively "grid-only". When a real webcam already creates a camera dock above an open presentation, audio-only speakers are expected to appear alongside it.

By gating audio-only tiles on isGridEnabled, this PR hides them whenever the presentation is open, including the established real-webcam scenario. That reverses the behavior documented by earlier issues and PRs.

There was an issue about not showing audio only tiles when no webcam is being shared, it was recently handled by #25359.

The audio-only feature is documented as "only for unified layout", not
grid-only: speaking tiles must still appear alongside a shared webcam over an
open presentation (bigbluebutton#25235/bigbluebutton#25359). Revert the isGridEnabled gating back to
isUnifiedLayout in useAudioOnlyUsers/useVideoStreams.

The tiles lingering over a maximized presentation were grid avatars from
useGridUsers' stale cache (uncapped by maxAudioOnlyUsers, and present even
with showAudioOnlyOnFirstPage=false); clearing that cache when the grid is
disabled stays as the actual fix.
@AtilaU19 AtilaU19 changed the title fix(video-provider): hide audio-only tiles and grid avatars when a presentation is open fix(video-provider): clear stale grid avatars when a presentation is open Jul 21, 2026

@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-html5/imports/ui/components/video-provider/hooks/index.ts (1)

380-390: 🎯 Functional Correctness | 🔵 Trivial | 🏗️ Heavy lift

Add regression coverage for presentation transitions.

Test that disabling the grid clears cached grid and overflow users, and that audio-only users remain visible in unified layout while a presentation is open.

🤖 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`
around lines 380 - 390, Extend regression coverage for the hook containing the
isGridEnabled branch. Add tests that disabling the grid clears gridItems,
overflowCount, and overflowUsers, and that audio-only users remain visible in
the unified layout while a presentation is open. Reuse the existing hook test
setup and assert the returned grid and overflow state after each presentation
transition.
🤖 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-html5/imports/ui/components/video-provider/hooks/index.ts`:
- Around line 380-390: Extend regression coverage for the hook containing the
isGridEnabled branch. Add tests that disabling the grid clears gridItems,
overflowCount, and overflowUsers, and that audio-only users remain visible in
the unified layout while a presentation is open. Reuse the existing hook test
setup and assert the returned grid and overflow state after each presentation
transition.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 6fb71a53-52d8-444f-8317-9cc6e22bce53

📥 Commits

Reviewing files that changed from the base of the PR and between 4441288 and 2801d60.

📒 Files selected for processing (1)
  • bigbluebutton-html5/imports/ui/components/video-provider/hooks/index.ts

@AtilaU19

Copy link
Copy Markdown
Contributor Author

Thanks @ramonlsouza, you're right. I've reverted the audio-only gating, so those tiles stay scoped to the unified layout and the #25235/#25359 behavior (speaking tiles alongside a shared webcam over an open presentation) is preserved.
The behavior we're aiming for is:

  • showAudioOnlyOnFirstPage=false → no audio-only/avatar tiles should appear at all;
  • showAudioOnlyOnFirstPage=true → audio-only tiles appear, but limited to maxAudioOnlyUsers.

In our testing this still didn't hold on top of #25359, so this PR handles a separate problem. So #25359 covers the who-is-talking/audio-only tiles; this PR only clears that stale grid-avatar cache when the grid is disabled. With both in place: false → no camera-less tiles over an open presentation, and true → only audio-only tiles, capped at maxAudioOnlyUsers.

@github-actions

Copy link
Copy Markdown

✅ Automated tests have passed!

@antobinary
antobinary merged commit f025d38 into bigbluebutton:v4.0.x-develop Jul 21, 2026
36 checks passed
ramonlsouza pushed a commit that referenced this pull request Sep 28, 2026
…open

Backport of #25482 (fixes #25861 on v3.0.x-develop) to v3.0.x-develop.

Add a Playwright regression scenario covering restore, leave/join, a second minimize/restore cycle, and the audio-only tile alongside a webcam.

Co-authored-by: Atila <[email protected]>
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.

5 participants