Stream mini preview drag/expand and Grid view (#934, #935) #951

Closed
charles wants to merge 0 commits from feat-934-935-stream-view into textchat
Owner

Closes #934
Closes #935

Findings before building are in the comments on #934 and #935.

#934: the stream mini preview can be moved and expanded

What the original does: the PiP card floats over the whole window, 20 px from every edge (EDGE_PADDING). A left press on the card (not on a button) becomes a drag after 3 px. On release the card snaps to the corner of the quadrant it is in (snapPointToCorner), and the corner is stored as pip_corner (default bottom-right). The original has no expand button on this card.

Cause: the native card was a fixed container in the bottom-right corner. Nothing could move it, so it could sit on top of the member list for good.

Fix:

  • widgets/floating.rs: a widget that places the card in a corner over its area, 20 px from the edges, and handles the drag itself. The drag starts after 3 px, buttons keep their own presses, and on release the card snaps to a corner with fluxer_core::voice::call_view::PipBounds::snap. Only the drop is a message (pip::Message::Moved). A click without a drag does what it did before. The card stays where it was dropped until the store hands back the new corner.
  • The corner is a voice setting: VideoSettings::pip_corner (PipCorner), stored as pip_corner with the original's values. An unknown or mistyped value loads bottom right.
  • The expand button sits at the top right of the hover header: CornersOut, tooltip "Enter fullscreen", the wording and icon of the call's own fullscreen button. It opens the call with that stream pinned, in fullscreen. "Back to call" is unchanged. call::State::sync keeps that fullscreen while the store is still selecting the call, so a stale snapshot cannot undo it.

Deviations: the snap uses the card's position only, without the original's fling lookahead. There is no title-bar inset, because the native window uses system decorations. Resizing is still not built. The expand button is new: the original's card has none.

#935: several streams large at once

What the original does: layout mode is grid or focus. "Grid view" is a checkbox in the control bar's More options menu. In the grid every tile has the same size, the watched streams' tiles included. "Watch stream" pins the stream and switches to focus. "Add stream" leaves the layout as it is.

Cause: native pinned every newly watched stream (call::State::sync) and had no way back to the equal grid while watching.

Fix:

  • "More options" (DotsThree) in the guild call's bar, before Disconnect. Its menu (call/more_options.rs) has the "Grid view" toggle.
  • VideoSettings::call_layout (CallLayout::{Focus, Grid}, stored as call_layout, default focus). Unlike the original, the choice survives restarts.
  • call::large is the stream drawn large: the pinned stream in focus, none in grid. In grid, every stream is a tile of the existing packed grid (grid::metrics, the original's resolveVoiceGridPackedLayoutMetrics), letterboxed at its own aspect (Fit::Contain). Fullscreen in grid shows the grid over the whole window with the bar on top. The mini preview still shows the pinned stream, or else the one watched last.
  • UserAction::WatchStream (watch one stream alone) sets the layout back to focus, as in the original; AddStream keeps the grid. The PiP expand button also goes back to focus.

How subscription quality is chosen per tile: it isn't, and it doesn't need to be. Native subscriptions are on or off per track (set_subscribed). Screen shares are published without simulcast, and the room joins with adaptive_stream = false. So every watched stream arrives at its one full-quality layer, whatever the size of its tile: focus, grid, mini grid or PiP. That matches the original, which asks quality: 'high' for every watched screen share (voice_participant_tile/hooks.ts) wherever its tile is.

  • "Show non-video participants" (under "Grid view" in the same menu, as in the original; on by default, stored as show_non_video_participants, unreadable values load on). With it off, the grid leaves out the tiles of participants without a camera and keeps every stream tile, as the original's filteredCameraTracks does. With Grid view on and it off, the watched streams alone share the call area: two streams in a wide area sit side by side, three or four as 2×2, using the original's packing, which stacks two streams when the area is taller than wide. If that would leave nothing to show, everyone is shown (the original shows an avatar list). In focus, the mini grid drops them only when someone has a camera (the original's cameraBase), so here it keeps everyone. Focus without a pinned stream shows the filtered grid (focusFallbackGrid).

Deviations: when the grid has more tiles than fit, it does not fall back to focus the way the original's does. Streams stay next to their sharer instead of first.

Verification

  • Core (crates/fluxer-core/tests/call_view.rs, voice::call_view unit tests): snap corner per quadrant and at the edges, the drag clamp, the 3 px threshold, corner and layout round-trips through the settings file, tolerant loading, the corner saved on drop and loaded on the next start, and Watch versus Add stream on the layout.
  • UI (crates/fluxer-ui/tests/stream_focus.rs): dragging the card to top left and top right through the widget protocol, a twitch or click that does not move it, "Back to call" still a click, the expand button and fullscreen surviving a stale snapshot, the grid view drawing both watched streams as tiles with nothing large and no "Stop watching stream", fullscreen in grid, Add versus Watch, the More options button and menu, the expand button from the grid, the grid geometry for 2, 3 and 4 streams, and with "Show non-video participants" off: two streams plus three voice-only people give two tiles (the menu row, the stored setting, focus keeping everyone, the fallback with no stream). Core tests cover that setting's default, persistence and tolerant loading.
  • Screenshots (lavapipe, in the fluxer-native-shots:u2204 container): new stream_pip_top_left, stream_grid and stream_grid_streams_only. 18 existing goldens with the call's control bar were re-rendered for the new More options button (that is the only change in them).
  • FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci: passed ("==> xtask ci: all steps passed"; LiveKit interop skipped as usual).

🤖 Generated with Claude Code

Closes #934 Closes #935 Findings before building are in the comments on #934 and #935. ## #934: the stream mini preview can be moved and expanded **What the original does:** the PiP card floats over the whole window, 20 px from every edge (`EDGE_PADDING`). A left press on the card (not on a button) becomes a drag after 3 px. On release the card snaps to the corner of the quadrant it is in (`snapPointToCorner`), and the corner is stored as `pip_corner` (default `bottom-right`). The original has no expand button on this card. **Cause:** the native card was a fixed container in the bottom-right corner. Nothing could move it, so it could sit on top of the member list for good. **Fix:** - `widgets/floating.rs`: a widget that places the card in a corner over its area, 20 px from the edges, and handles the drag itself. The drag starts after 3 px, buttons keep their own presses, and on release the card snaps to a corner with `fluxer_core::voice::call_view::PipBounds::snap`. Only the drop is a message (`pip::Message::Moved`). A click without a drag does what it did before. The card stays where it was dropped until the store hands back the new corner. - The corner is a voice setting: `VideoSettings::pip_corner` (`PipCorner`), stored as `pip_corner` with the original's values. An unknown or mistyped value loads bottom right. - The expand button sits at the top right of the hover header: `CornersOut`, tooltip "Enter fullscreen", the wording and icon of the call's own fullscreen button. It opens the call with that stream pinned, in fullscreen. "Back to call" is unchanged. `call::State::sync` keeps that fullscreen while the store is still selecting the call, so a stale snapshot cannot undo it. **Deviations:** the snap uses the card's position only, without the original's fling lookahead. There is no title-bar inset, because the native window uses system decorations. Resizing is still not built. The expand button is new: the original's card has none. ## #935: several streams large at once **What the original does:** layout mode is `grid` or `focus`. "Grid view" is a checkbox in the control bar's More options menu. In the grid every tile has the same size, the watched streams' tiles included. "Watch stream" pins the stream and switches to focus. "Add stream" leaves the layout as it is. **Cause:** native pinned every newly watched stream (`call::State::sync`) and had no way back to the equal grid while watching. **Fix:** - "More options" (`DotsThree`) in the guild call's bar, before Disconnect. Its menu (`call/more_options.rs`) has the "Grid view" toggle. - `VideoSettings::call_layout` (`CallLayout::{Focus, Grid}`, stored as `call_layout`, default focus). Unlike the original, the choice survives restarts. - `call::large` is the stream drawn large: the pinned stream in focus, none in grid. In grid, every stream is a tile of the existing packed grid (`grid::metrics`, the original's `resolveVoiceGridPackedLayoutMetrics`), letterboxed at its own aspect (`Fit::Contain`). Fullscreen in grid shows the grid over the whole window with the bar on top. The mini preview still shows the pinned stream, or else the one watched last. - `UserAction::WatchStream` (watch one stream alone) sets the layout back to focus, as in the original; `AddStream` keeps the grid. The PiP expand button also goes back to focus. **How subscription quality is chosen per tile:** it isn't, and it doesn't need to be. Native subscriptions are on or off per track (`set_subscribed`). Screen shares are published without simulcast, and the room joins with `adaptive_stream = false`. So every watched stream arrives at its one full-quality layer, whatever the size of its tile: focus, grid, mini grid or PiP. That matches the original, which asks `quality: 'high'` for every watched screen share (`voice_participant_tile/hooks.ts`) wherever its tile is. - "Show non-video participants" (under "Grid view" in the same menu, as in the original; on by default, stored as `show_non_video_participants`, unreadable values load on). With it off, the grid leaves out the tiles of participants without a camera and keeps every stream tile, as the original's `filteredCameraTracks` does. With Grid view on and it off, the watched streams alone share the call area: two streams in a wide area sit side by side, three or four as 2×2, using the original's packing, which stacks two streams when the area is taller than wide. If that would leave nothing to show, everyone is shown (the original shows an avatar list). In focus, the mini grid drops them only when someone has a camera (the original's `cameraBase`), so here it keeps everyone. Focus without a pinned stream shows the filtered grid (`focusFallbackGrid`). **Deviations:** when the grid has more tiles than fit, it does not fall back to focus the way the original's does. Streams stay next to their sharer instead of first. ## Verification - Core (`crates/fluxer-core/tests/call_view.rs`, `voice::call_view` unit tests): snap corner per quadrant and at the edges, the drag clamp, the 3 px threshold, corner and layout round-trips through the settings file, tolerant loading, the corner saved on drop and loaded on the next start, and Watch versus Add stream on the layout. - UI (`crates/fluxer-ui/tests/stream_focus.rs`): dragging the card to top left and top right through the widget protocol, a twitch or click that does not move it, "Back to call" still a click, the expand button and fullscreen surviving a stale snapshot, the grid view drawing both watched streams as tiles with nothing large and no "Stop watching stream", fullscreen in grid, Add versus Watch, the More options button and menu, the expand button from the grid, the grid geometry for 2, 3 and 4 streams, and with "Show non-video participants" off: two streams plus three voice-only people give two tiles (the menu row, the stored setting, focus keeping everyone, the fallback with no stream). Core tests cover that setting's default, persistence and tolerant loading. - Screenshots (lavapipe, in the `fluxer-native-shots:u2204` container): new `stream_pip_top_left`, `stream_grid` and `stream_grid_streams_only`. 18 existing goldens with the call's control bar were re-rendered for the new More options button (that is the only change in them). - `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci`: passed ("==> xtask ci: all steps passed"; LiveKit interop skipped as usual). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The picture-in-picture card now floats in a corner of the window, 20 px from the
edges, and can be dragged: a press that no button takes becomes a drag after 3 px,
and on release the card snaps to the corner of the quadrant it is in, as the
original's floating pane does. The corner is stored with the voice settings as
`pip_corner` (the original's values; anything unreadable loads bottom right). A
click without a drag does what it did before.

The hover header gets an expand button ("Enter fullscreen", CornersOut) that opens
the call with the stream pinned, in fullscreen; "Back to call" stays.

Refs #934

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The guild call's control bar gets "More options" (DotsThree, before disconnect)
with the original's "Grid view" toggle. In the grid every tile is the same size,
the watched streams included, each letterboxed at its own aspect; in focus (the
default, today's layout) the pinned stream is drawn large. The choice is stored as
`call_layout`. As in the original, "Watch stream" goes back to focus and "Add
stream" keeps the grid; the mini preview's expand button also goes back to focus.
Fullscreen works from the grid (the grid over the whole window, the bar over it).

Subscription quality needs no change: screen shares are published without
simulcast and the room has adaptive stream off, so every watched stream arrives at
its single full-quality layer whatever its tile, as the original requests `high`
for every watched screen share.

The control bar's goldens are redrawn (lavapipe) for the new button.

Refs #935

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The call's More options menu gets the original's "Show non-video participants"
under "Grid view" (on by default, stored as `show_non_video_participants`,
unreadable values load on). Off, the grid leaves out the tiles of participants
without a camera and keeps every stream tile (`filteredCameraTracks`), so Grid
view shows the watched streams alone, packed as the original packs them; when that
would leave nothing, everyone is shown. In focus, the mini grid drops them only
when someone has a camera (`cameraBase`), so here it keeps everyone; focus without
a pinned stream shows the filtered grid (`focusFallbackGrid`).

New golden `stream_grid_streams_only` (lavapipe); no other golden changed.

Refs #935

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
Owner

Merged by hand into textchat (2f71b700), together with the other open stream PR; the combined tree passed the full gate locally.

Merged by hand into textchat (2f71b700), together with the other open stream PR; the combined tree passed the full gate locally.
charles closed this pull request 2026-11-19 13:47:21 +00:00

Pull request closed

Sign in to join this conversation.
No description provided.