Repository navigation
Ref(html5): Make webcam show ui on hover or touch hold - #24798
Conversation
WalkthroughAdded hover-driven behavior for squeezed (small) video items: the component tracks Sequence Diagram(s)sequenceDiagram
autonumber
participant User
participant VideoListItem
participant HoverTimeout
participant Renderer
User->>VideoListItem: mouseenter (if squeezed)
VideoListItem->>Renderer: set isHovered = true (render name)
User->>VideoListItem: mouseleave
VideoListItem->>Renderer: set isHovered = false (hide name)
User->>VideoListItem: touchstart (if squeezed)
VideoListItem->>HoverTimeout: start 300ms enter-timer
Note right of HoverTimeout: after 300ms
HoverTimeout-->>VideoListItem: enter-timer fires
VideoListItem->>Renderer: set isHovered = true (render name)
VideoListItem->>HoverTimeout: start 3s auto-reset
Note right of HoverTimeout: after 3s
HoverTimeout-->>VideoListItem: auto-reset fires
VideoListItem->>Renderer: set isHovered = false (hide name)
User->>VideoListItem: touchmove
VideoListItem->>HoverTimeout: cancel timers
VideoListItem->>Renderer: set isHovered = false
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
Pull request overview
This PR updates the HTML5 webcam tile UI so that, when tiles become “squeezed” (too small for the normal overlays), the webcam overlays (incl. user name/actions) are shown on hover (and intended touch interaction) rather than always occupying space.
Changes:
- Removes the dedicated “squeezed” webcam options button and its i18n label.
- Simplifies
UserActionsby dropping the squeezed-mode rendering path. - Adds hover tracking in
VideoListItemand conditionally shows the default overlay UI when squeezed.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| bigbluebutton-html5/public/locales/en.json | Removes the squeezed webcam options button label string. |
| bigbluebutton-html5/imports/ui/components/video-provider/video-list/video-list-item/user-actions/styles.ts | Removes squeezed-button specific styled components and related imports. |
| bigbluebutton-html5/imports/ui/components/video-provider/video-list/video-list-item/user-actions/component.tsx | Removes squeezed-mode menu item/button logic; always renders the default menu trigger. |
| bigbluebutton-html5/imports/ui/components/video-provider/video-list/video-list-item/component.tsx | Adds hover state and gates overlay rendering in squeezed mode based on hover. |
Comments suppressed due to low confidence (2)
bigbluebutton-html5/imports/ui/components/video-provider/video-list/video-list-item/component.tsx:481
- When squeezed and not hovered, the UI is not rendered at all, which also makes it unreachable for keyboard-only users (there’s nothing to tab to). Please ensure the webcam UI becomes visible on keyboard focus as well (e.g., using
:focus-withinon the container oronFocus/onBlurhandlers to mirror the hover state).
</Styled.VideoContainer>
bigbluebutton-html5/imports/ui/components/video-provider/video-list/video-list-item/component.tsx:481
renderDefaultButtons()is conditionally mounted based onisHovered. When squeezed, moving the cursor from the video item to the opened BBBMenu (which is rendered in a portal/container outside the item) will triggeronMouseLeave, unmount the trigger/menu, and effectively close the menu before a selection can be made. To avoid this, keep the controls mounted and only toggle visibility via CSS (e.g., opacity/pointer-events) and/or keep them visible while the menu is open (isHovered || isMenuOpen), ideally also supporting:focus-withinfor keyboard users.
</Styled.VideoContainer>
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
🧹 Nitpick comments (2)
bigbluebutton-html5/imports/ui/components/video-provider/video-list/video-list-item/user-actions/component.tsx (1)
83-107: Remove unusedonHandleDisableCamprop.The
onHandleDisableCamprop is defined in the interface (line 94) and passed from the parent component, but it's never destructured or used. The component uses a localtoggleDisableCamfunction (lines 156-163) instead. This appears to be dead code remaining from the removed squeezed button functionality.🧹 Suggested cleanup
Remove from interface:
interface UserActionProps { name: string; stream: VideoItem; cameraId: string; numOfStreams: number; onHandleVideoFocus: ((id: string) => void) | null; focused: boolean; onHandleMirror: () => void; isMirrored: boolean; isRTL: boolean; isStream: boolean; - onHandleDisableCam: () => void; isSelfViewDisabled: boolean; amIModerator: boolean; videoContainer?: MutableRefObject<HTMLDivElement | null>, isFullscreenContext: boolean; layoutContextDispatch: (...args: unknown[]) => void; }And remove the corresponding prop from the parent call site in
component.tsx:<UserActions name={name} stream={stream} cameraId={cameraId} numOfStreams={numOfStreams} onHandleVideoFocus={onHandleVideoFocus} focused={focused} onHandleMirror={() => setIsMirrored((value) => !value)} isMirrored={isMirrored} isRTL={isRTL} isStream={isStream} - onHandleDisableCam={() => setIsSelfViewDisabled((value) => !value)} isSelfViewDisabled={isSelfViewDisabled} amIModerator={amIModerator} videoContainer={videoContainer} isFullscreenContext={isFullscreenContext} layoutContextDispatch={layoutContextDispatch} />🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@bigbluebutton-html5/imports/ui/components/video-provider/video-list/video-list-item/user-actions/component.tsx` around lines 83 - 107, The UserActionProps interface contains an unused prop onHandleDisableCam which is never destructured or referenced inside the UserActions component (component.tsx) because the component uses a local toggleDisableCam function; remove onHandleDisableCam from the UserActionProps interface and also remove the prop passed from the parent call site so there are no dangling/unreferenced props—search for UserActionProps, onHandleDisableCam, and toggleDisableCam to update the interface and the parent invocation accordingly.bigbluebutton-html5/imports/ui/components/video-provider/video-list/video-list-item/component.tsx (1)
445-454: Consider hybrid device interaction and extracting the timeout constant.Two observations:
Hybrid devices edge case: On devices supporting both mouse and touch (touchscreen laptops), if a user is hovering with the mouse and then taps, the 3-second timeout will dismiss the UI even though the cursor remains over the element.
Magic number: Consider extracting
3000to a named constant for clarity.🔧 Suggested improvement
const VIDEO_CONTAINER_WIDTH_BOUND = 125; const VIDEO_CONTAINER_PLUGIN_HELPERS_WIDTH_BOUND = 175; +const TOUCH_HOVER_TIMEOUT_MS = 3000;onTouchStart={() => { if (hoverTimeoutRef.current) clearTimeout(hoverTimeoutRef.current); setIsHovered(true); - hoverTimeoutRef.current = setTimeout(() => setIsHovered(false), 3000); + hoverTimeoutRef.current = setTimeout(() => setIsHovered(false), TOUCH_HOVER_TIMEOUT_MS); }}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@bigbluebutton-html5/imports/ui/components/video-provider/video-list/video-list-item/component.tsx` around lines 445 - 454, The touch handler uses a magic 3000ms and always sets a timeout that will hide UI even when the mouse cursor is still hovering; extract the 3000 into a named constant (e.g. HOVER_TOUCH_TIMEOUT) and change the onTouchStart logic in the component (handlers around hoverTimeoutRef, setIsHovered, onMouseEnter/onMouseLeave/onTouchStart) so it does not schedule the hide timeout when the element is already hovered (check isHovered) — only set the touch timeout when not currently hovered, and keep clearing hoverTimeoutRef on enter/touch as before.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In
`@bigbluebutton-html5/imports/ui/components/video-provider/video-list/video-list-item/component.tsx`:
- Around line 445-454: The touch handler uses a magic 3000ms and always sets a
timeout that will hide UI even when the mouse cursor is still hovering; extract
the 3000 into a named constant (e.g. HOVER_TOUCH_TIMEOUT) and change the
onTouchStart logic in the component (handlers around hoverTimeoutRef,
setIsHovered, onMouseEnter/onMouseLeave/onTouchStart) so it does not schedule
the hide timeout when the element is already hovered (check isHovered) — only
set the touch timeout when not currently hovered, and keep clearing
hoverTimeoutRef on enter/touch as before.
In
`@bigbluebutton-html5/imports/ui/components/video-provider/video-list/video-list-item/user-actions/component.tsx`:
- Around line 83-107: The UserActionProps interface contains an unused prop
onHandleDisableCam which is never destructured or referenced inside the
UserActions component (component.tsx) because the component uses a local
toggleDisableCam function; remove onHandleDisableCam from the UserActionProps
interface and also remove the prop passed from the parent call site so there are
no dangling/unreferenced props—search for UserActionProps, onHandleDisableCam,
and toggleDisableCam to update the interface and the parent invocation
accordingly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 9cb521d5-ce59-451d-bd0c-16f4b17f00b9
📒 Files selected for processing (4)
bigbluebutton-html5/imports/ui/components/video-provider/video-list/video-list-item/component.tsxbigbluebutton-html5/imports/ui/components/video-provider/video-list/video-list-item/user-actions/component.tsxbigbluebutton-html5/imports/ui/components/video-provider/video-list/video-list-item/user-actions/styles.tsbigbluebutton-html5/public/locales/en.json
💤 Files with no reviewable changes (2)
- bigbluebutton-html5/imports/ui/components/video-provider/video-list/video-list-item/user-actions/styles.ts
- bigbluebutton-html5/public/locales/en.json
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Have you considered keeping the button collapsing for everything except the user name (and maybe the presenter icon with adjusted relative size when in "squeezed" mode)? That is what issue #24786 is suggesting (>Can we have a hover state that shows the user's name?), but this PR is removing the collapsing logic entirely. A few reasons why partially keeping the previous approach might be good:
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
bigbluebutton-html5/imports/ui/components/video-provider/video-list/video-list-item/component.tsx (1)
482-489: Consider addingonTouchEndto cancel pending show timeout.If a user touches and releases before the 300ms delay completes (e.g., a quick tap), the timeout will still fire and show the hover UI briefly before auto-hiding. This might be unexpected behavior since the user already lifted their finger.
💡 Optional improvement to cancel on touch end
onTouchStart={() => { if (!isVideoSqueezed) return; if (hoverTimeoutRef.current) clearTimeout(hoverTimeoutRef.current); hoverTimeoutRef.current = setTimeout(() => { setIsHovered(true); hoverTimeoutRef.current = setTimeout(() => setIsHovered(false), 3000); }, 300); }} onTouchMove={() => { if (hoverTimeoutRef.current) clearTimeout(hoverTimeoutRef.current); setIsHovered(false); }} + onTouchEnd={() => { + if (hoverTimeoutRef.current) clearTimeout(hoverTimeoutRef.current); + }}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@bigbluebutton-html5/imports/ui/components/video-provider/video-list/video-list-item/component.tsx` around lines 482 - 489, The touch handler currently starts a 300ms show timeout and then overwrites hoverTimeoutRef.current with the hide timeout, so a quick touch-release cannot cancel the pending show; add an onTouchEnd handler that clears the pending show timeout and prevents setIsHovered from running (or introduce two refs, e.g., showTimeoutRef and hideTimeoutRef, and clear showTimeoutRef on touch end), and also clear any existing hide timeout when appropriate; update the component to use these refs when scheduling/clearing timeouts (references: hoverTimeoutRef, setIsHovered, isVideoSqueezed).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In
`@bigbluebutton-html5/imports/ui/components/video-provider/video-list/video-list-item/component.tsx`:
- Around line 482-489: The touch handler currently starts a 300ms show timeout
and then overwrites hoverTimeoutRef.current with the hide timeout, so a quick
touch-release cannot cancel the pending show; add an onTouchEnd handler that
clears the pending show timeout and prevents setIsHovered from running (or
introduce two refs, e.g., showTimeoutRef and hideTimeoutRef, and clear
showTimeoutRef on touch end), and also clear any existing hide timeout when
appropriate; update the component to use these refs when scheduling/clearing
timeouts (references: hoverTimeoutRef, setIsHovered, isVideoSqueezed).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 102d2220-db85-405d-80ce-476039dd591e
📒 Files selected for processing (4)
bigbluebutton-html5/imports/ui/components/video-provider/video-list/video-list-item/component.tsxbigbluebutton-html5/imports/ui/components/video-provider/video-list/video-list-item/styles.tsbigbluebutton-html5/imports/ui/components/video-provider/video-list/video-list-item/user-actions/component.tsxbigbluebutton-html5/imports/ui/components/video-provider/video-list/video-list-item/user-actions/styles.ts
✅ Files skipped from review due to trivial changes (2)
- bigbluebutton-html5/imports/ui/components/video-provider/video-list/video-list-item/user-actions/component.tsx
- bigbluebutton-html5/imports/ui/components/video-provider/video-list/video-list-item/user-actions/styles.ts
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
…-list/video-list-item/component.tsx Co-authored-by: Copilot <[email protected]>
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
bigbluebutton-html5/imports/ui/components/video-provider/video-list/video-list-item/component.tsx (1)
482-494: Consider addingonTouchEndto cancel pending reveal on quick taps.The current implementation triggers the hover UI 300ms after
touchstartregardless of whether the user has already lifted their finger. In typical "touch-hold" patterns, releasing before the threshold cancels the action.If a quick tap should not reveal the name, add
onTouchEndto cancel the pending timeout:♻️ Suggested change
onTouchMove={() => { if (!isVideoSqueezed) return; if (hoverTimeoutRef.current) clearTimeout(hoverTimeoutRef.current); setIsHovered(false); }} + onTouchEnd={() => { + if (!isVideoSqueezed) return; + if (hoverTimeoutRef.current) clearTimeout(hoverTimeoutRef.current); + }}If the current behavior (tap-and-release still shows the name) is intentional for discoverability, feel free to disregard.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@bigbluebutton-html5/imports/ui/components/video-provider/video-list/video-list-item/component.tsx` around lines 482 - 494, Add an onTouchEnd (and optionally onTouchCancel) handler to the VideoListItem component to cancel the pending reveal started in onTouchStart: when isVideoSqueezed is true, clear hoverTimeoutRef.current (and any nested timeout) and ensure setIsHovered(false) is called so quick taps won’t trigger the 300ms hover reveal; reference the existing onTouchStart/onTouchMove logic and the hoverTimeoutRef, setIsHovered, and isVideoSqueezed symbols when implementing the cancel behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In
`@bigbluebutton-html5/imports/ui/components/video-provider/video-list/video-list-item/component.tsx`:
- Around line 482-494: Add an onTouchEnd (and optionally onTouchCancel) handler
to the VideoListItem component to cancel the pending reveal started in
onTouchStart: when isVideoSqueezed is true, clear hoverTimeoutRef.current (and
any nested timeout) and ensure setIsHovered(false) is called so quick taps won’t
trigger the 300ms hover reveal; reference the existing onTouchStart/onTouchMove
logic and the hoverTimeoutRef, setIsHovered, and isVideoSqueezed symbols when
implementing the cancel behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: e842d6cf-899c-4e60-81d7-a6a048aa413b
📒 Files selected for processing (2)
bigbluebutton-html5/imports/ui/components/video-provider/video-list/video-list-item/component.tsxbigbluebutton-html5/public/locales/en.json
✅ Files skipped from review due to trivial changes (1)
- bigbluebutton-html5/public/locales/en.json
✅ Automated tests have passed! |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
bigbluebutton-html5/imports/ui/components/video-provider/video-list/video-list-item/component.tsx:149
isHoveredis not cleared when the item stops being squeezed (e.g., resize from squeezed -> normal). If a user hovered once while squeezed, then the tile expands and later becomes squeezed again, the name overlay can appear immediately without a new hover/hold. Consider resettingisHovered(and clearing any pending timeout) whenisVideoSqueezedbecomes false.
const [isVideoSqueezed, setIsVideoSqueezed] = useState(false);
const [isVideoPluginHelperSqueezed, setIsVideoPluginHelperSqueezed] = useState(false);
const [isSelfViewDisabled, setIsSelfViewDisabled] = useState(false);
const [isHovered, setIsHovered] = useState(false);
const pluginSqueezedResizeObserver = new ResizeObserver((entry) => {
if (entry && entry[0]?.contentRect?.width < VIDEO_CONTAINER_PLUGIN_HELPERS_WIDTH_BOUND) {
return setIsVideoPluginHelperSqueezed(true);
}
return setIsVideoPluginHelperSqueezed(false);
});
const resizeObserver = new ResizeObserver((entry) => {
if (entry && entry[0]?.contentRect?.width < VIDEO_CONTAINER_WIDTH_BOUND) {
return setIsVideoSqueezed(true);
}
return setIsVideoSqueezed(false);
});
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "app.videoDock.webcamFullscreenLabel": "Fullscreen webcam", | ||
| "app.videoDock.webcamExitFullscreenLabel": "Exit fullscreen webcam", | ||
| "app.videoDock.webcamSqueezedButtonLabel": "Webcam options", | ||
| "app.videoDock.webcamSqueezedButtonLabel": "Squeezed webcam view", |
There was a problem hiding this comment.
The value for app.videoDock.webcamSqueezedButtonLabel no longer describes the options/menu button (it’s used as the label/aria-label for the squeezed webcam options trigger). All other locales translate this key as “Webcam options”, so the new English string is inconsistent and can confuse screen readers. Consider reverting to an options-focused label (e.g., “Webcam options”).
| "app.videoDock.webcamSqueezedButtonLabel": "Squeezed webcam view", | |
| "app.videoDock.webcamSqueezedButtonLabel": "Webcam options", |
| onTouchStart={() => { | ||
| if (!isVideoSqueezed) return; | ||
| if (hoverTimeoutRef.current) clearTimeout(hoverTimeoutRef.current); | ||
| hoverTimeoutRef.current = setTimeout(() => { | ||
| setIsHovered(true); | ||
| hoverTimeoutRef.current = setTimeout(() => setIsHovered(false), 3000); | ||
| }, 300); | ||
| }} | ||
| onTouchMove={() => { | ||
| if (!isVideoSqueezed) return; | ||
| if (hoverTimeoutRef.current) clearTimeout(hoverTimeoutRef.current); | ||
| setIsHovered(false); | ||
| }} |
There was a problem hiding this comment.
The long-press implementation doesn’t handle onTouchEnd/onTouchCancel. A quick tap (touchstart then touchend with no move) can still trigger the delayed timeout and show the name after the finger is lifted, and the name auto-hides after a fixed 3s even if the user is still holding. Consider canceling the pending timeout on touch end/cancel, and hiding the overlay when the touch ends (rather than using a fixed hide timer).
|
|
||
| const renderSqueezedName = () => ( | ||
| <Styled.BottomBar> | ||
| <Styled.SqueezedName>{name}</Styled.SqueezedName> |
There was a problem hiding this comment.
The squeezed-name overlay renders name, but the rest of the webcam UI uses displayName (adds the localized “(you)” suffix for the local stream). Consider reusing the same displayName logic here so the overlay is consistent with the dropdown/menu and other name displays.
| <Styled.SqueezedName>{name}</Styled.SqueezedName> | |
| <Styled.SqueezedName>{displayName}</Styled.SqueezedName> |
ramonlsouza
left a comment
There was a problem hiding this comment.
tested on local server, desktop and mobile device - it worked well
ca1ab00
into
bigbluebutton:v3.0.x-develop



What does this PR do?
Make the changes to show webcam ui on mouse hover or touch.
Closes Issue(s)
Closes #24786
More
Screencast.from.25-03-2026.12.43.02.webm