Screen share 24: Focus layout, fullscreen, corner controls, stop watching, picture-in-picture (#171) #250

Manually merged
charles merged 3 commits from screenshare-24-ui-focus-layout into screenshare 2026-11-12 11:45:18 +00:00
Owner

Stacked on: screenshare-23-ui-stream-tile

What this builds (spec §10 "Focus layout" and "In-window picture-in-picture")

  • Watching pins the stream. call::State::sync(&App) (called by the shell on every snapshot) pins a stream as soon as it starts being watched, from anywhere (its tile, the sidebar, a menu), and unpins it when it is no longer watched. focus::focused(&CallModel, &State) is the pinned tile.
  • Focus layout (call/focus.rs): the stream in a 16:9 area with square corners, max height min(76 % of window, area − 3 rem) (focus::main_size); others in a mini grid under it (gap 0.75 rem, tiles ≤ 23.75 rem); "Show participants" / "Hide participants" toggle; header line "{name}'s screen" with the info pill (no LIVE badge) and up to 5 spectator avatars (20 px).
  • Fullscreen: Message::ToggleFullscreen flips State::fullscreen; app.rs turns the window mode with window::latest().and_then(|id| window::set_mode(id, mode)) whenever it changes. Escape leaves it (after menus close), and so does leaving the call view. In fullscreen the main screen is the call view alone and the others go to a bottom row clamp(4rem, clamp(5.375rem, 13cqh, 7rem), 40cqh) high above the bar's 4.5 rem ("Show members" / "Hide members").
  • Corner controls (call/corner_controls.rs, 2.625 rem, radius 0.875 rem): focused stream volume (speaker + 0–200 % slider) and "Enter fullscreen" / "Exit fullscreen". They show while a stream is focused or in fullscreen, and they lift above the bar when the bar would reach them (--voice-call-corner-lift).
  • Stop watching stream in the control bar (EyeSlash, --vc-danger-bg, after disconnect) while someone else's stream is focused: call::controls(&CallModel, &State) sets ControlBarModel::stop_watching.
  • Picture-in-picture (call/pip.rs): pip::model(&App, &State) returns the overlay while a stream of the call is watched and another channel is open, unless disable_pip_popout. The card is 20 rem, 16:9, at least 240 px and at most 70 % of the window, radius 0.75 rem, 20 px from the bottom-right corner, drawn over the main screen. On hover it shows "Back to call" (channel name, SelectChannel), the streamer and the viewer count. Right-click opens a menu with "Disable screen share picture-in-picture popouts".
  • New icons (Phosphor 2.1.10 path data, as the bundled set): caret-up-bold, corners-out-bold, corners-in-bold, arrow-left-bold, users-bold.

Tests

  • crates/fluxer-ui/tests/stream_focus.rs: focus_area_max_height_rule (also checks that watching pins), fullscreen_moves_members_to_bottom_row (also covers the toggle, Escape, and the participant labels), stop_watching_button_only_when_focused, pip_shows_away_from_call_and_back_to_call_returns, pip_disabled_by_setting. Unit tests for the mini grid, the corner lift, the fullscreen label and the PiP messages.
  • Screenshots stream_focus and stream_pip: goldens drawn with UPDATE_GOLDEN=1 on lavapipe in the Ubuntu 22.04 image (fluxer-native-shots:u2204). They also match on this machine's GPU. There is no Electron reference capture. Dimensions come from VoiceCallView.module.css (471-622, 735-800, 1330-1360, 1408-1460), VoiceCallCornerControls.tsx, StreamFocusHeaderInfo.tsx, VoiceCallLayoutContent.tsx, PiPOverlay.module.css, pip_overlay/{PiPHeader,PiPFooter,PiPOverlayContextMenu,shared}.tsx and features/ui/state/PiP.ts.
  • FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci is green locally.

Deviations from the plan and spec

  • The pin, fullscreen, the participants toggle and the PiP menu are view-local state in Local::call, not store state. The original keeps them in a UI store too.
  • The "{name}'s screen" header line is at the top of the focus area, not in the main header. Fullscreen hides the main header, and this keeps header.rs out of the task.
  • Outside fullscreen, the window height for the 76 % rule is estimated as the call area plus the header and the bar. The shell does not track the window size.
  • The screen-share PiP card has no disconnect button. That follows the original (PiPFooter hides it for screen shares), not spec §10's wording. The card cannot be dragged or resized. Disabling PiP from its menu skips the original's confirmation dialog.
  • The corner volume control shows its slider inline next to the speaker. The original opens a slider from the button.
  • Small changes outside the Files list: stream_tile.rs gets view_with_radius (square corners for the focused tile, 0.5 rem in the members row), info_pill.rs gets pill (no LIVE badge), plus theme/icons.rs, icon SVGs, the crate README and docs/screenshots/README.md.

Closes #171

🤖 Generated with Claude Code

Stacked on: screenshare-23-ui-stream-tile ## What this builds (spec §10 "Focus layout" and "In-window picture-in-picture") - **Watching pins the stream.** `call::State::sync(&App)` (called by the shell on every snapshot) pins a stream as soon as it starts being watched, from anywhere (its tile, the sidebar, a menu), and unpins it when it is no longer watched. `focus::focused(&CallModel, &State)` is the pinned tile. - **Focus layout** (`call/focus.rs`): the stream in a 16:9 area with square corners, max height `min(76 % of window, area − 3 rem)` (`focus::main_size`); others in a mini grid under it (gap 0.75 rem, tiles ≤ 23.75 rem); "Show participants" / "Hide participants" toggle; header line "{name}'s screen" with the info pill (no LIVE badge) and up to 5 spectator avatars (20 px). - **Fullscreen**: `Message::ToggleFullscreen` flips `State::fullscreen`; `app.rs` turns the window mode with `window::latest().and_then(|id| window::set_mode(id, mode))` whenever it changes. Escape leaves it (after menus close), and so does leaving the call view. In fullscreen the main screen is the call view alone and the others go to a bottom row `clamp(4rem, clamp(5.375rem, 13cqh, 7rem), 40cqh)` high above the bar's 4.5 rem ("Show members" / "Hide members"). - **Corner controls** (`call/corner_controls.rs`, 2.625 rem, radius 0.875 rem): focused stream volume (speaker + 0–200 % slider) and "Enter fullscreen" / "Exit fullscreen". They show while a stream is focused or in fullscreen, and they lift above the bar when the bar would reach them (`--voice-call-corner-lift`). - **Stop watching stream** in the control bar (`EyeSlash`, `--vc-danger-bg`, after disconnect) while someone else's stream is focused: `call::controls(&CallModel, &State)` sets `ControlBarModel::stop_watching`. - **Picture-in-picture** (`call/pip.rs`): `pip::model(&App, &State)` returns the overlay while a stream of the call is watched and another channel is open, unless `disable_pip_popout`. The card is 20 rem, 16:9, at least 240 px and at most 70 % of the window, radius 0.75 rem, 20 px from the bottom-right corner, drawn over the main screen. On hover it shows "Back to call" (channel name, `SelectChannel`), the streamer and the viewer count. Right-click opens a menu with "Disable screen share picture-in-picture popouts". - New icons (Phosphor 2.1.10 path data, as the bundled set): caret-up-bold, corners-out-bold, corners-in-bold, arrow-left-bold, users-bold. ## Tests - `crates/fluxer-ui/tests/stream_focus.rs`: `focus_area_max_height_rule` (also checks that watching pins), `fullscreen_moves_members_to_bottom_row` (also covers the toggle, Escape, and the participant labels), `stop_watching_button_only_when_focused`, `pip_shows_away_from_call_and_back_to_call_returns`, `pip_disabled_by_setting`. Unit tests for the mini grid, the corner lift, the fullscreen label and the PiP messages. - Screenshots `stream_focus` and `stream_pip`: goldens drawn with `UPDATE_GOLDEN=1` on lavapipe in the Ubuntu 22.04 image (`fluxer-native-shots:u2204`). They also match on this machine's GPU. There is no Electron reference capture. Dimensions come from `VoiceCallView.module.css` (471-622, 735-800, 1330-1360, 1408-1460), `VoiceCallCornerControls.tsx`, `StreamFocusHeaderInfo.tsx`, `VoiceCallLayoutContent.tsx`, `PiPOverlay.module.css`, `pip_overlay/{PiPHeader,PiPFooter,PiPOverlayContextMenu,shared}.tsx` and `features/ui/state/PiP.ts`. - `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` is green locally. ## Deviations from the plan and spec - The pin, fullscreen, the participants toggle and the PiP menu are view-local state in `Local::call`, not store state. The original keeps them in a UI store too. - The "{name}'s screen" header line is at the top of the focus area, not in the main header. Fullscreen hides the main header, and this keeps `header.rs` out of the task. - Outside fullscreen, the window height for the 76 % rule is estimated as the call area plus the header and the bar. The shell does not track the window size. - The screen-share PiP card has no disconnect button. That follows the original (`PiPFooter` hides it for screen shares), not spec §10's wording. The card cannot be dragged or resized. Disabling PiP from its menu skips the original's confirmation dialog. - The corner volume control shows its slider inline next to the speaker. The original opens a slider from the button. - Small changes outside the Files list: `stream_tile.rs` gets `view_with_radius` (square corners for the focused tile, 0.5 rem in the members row), `info_pill.rs` gets `pill` (no LIVE badge), plus `theme/icons.rs`, icon SVGs, the crate README and `docs/screenshots/README.md`. Closes #171 🤖 Generated with [Claude Code](https://claude.com/claude-code)
One tile per screen share next to its sharer's avatar tile, sized by the
grid like any other: the watch prompt over the dimmed preview ("Watch
stream", "Add stream", collapsing at 300/230/190 px), the room's video
while watched, the ended, buffering and failed overlays, the own tile's
hidden and paused states, the info pill with the LIVE badge, and the
control pill with the stream volume and the spectators popout. The
call view reads frames from Local::media.frames.

Refs #170

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
# Conflicts:
#	crates/fluxer-ui/README.md
#	crates/fluxer-ui/src/screens/main/call/mod.rs
#	crates/fluxer-ui/src/theme/icons.rs
Watching a stream pins it: the call view draws it in a 16:9 focus area
over the others, with its header, the participants toggle, the corner
controls (stream volume, fullscreen through window::set_mode, Escape
leaves) and "Stop watching stream" in the control bar. Fullscreen moves
the others to a bottom row. Away from the call, a picture-in-picture
card keeps the watched stream on screen unless disable_pip_popout.

Refs #171

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Author
Owner

Independent review: Screen share 24 (focus layout, fullscreen, corner controls, stop watching, PiP)

Scope: git diff 501e4aad..origin/screenshare-24-ui-focus-layout (bac08b9).

Plan tests: all five named tests are in crates/fluxer-ui/tests/stream_focus.rs and check what the plan asks for. focus_area_max_height_rule covers min(76 % of the window, area − 3 rem) at 16:9 (760 / 452 / 337.5 px), NaN input and watch-pins. fullscreen_moves_members_to_bottom_row covers the mini grid tiles ≤ 23.75 rem, the bottom row from the fork's clamp(4rem, clamp(5.375rem, 13cqh, 7rem), 40cqh), Hide participants, and Escape. stop_watching_button_only_when_focused, pip_shows_away_from_call_and_back_to_call_returns and pip_disabled_by_setting round out the set. The goldens stream_focus and stream_pip are present and pass locally.

Interfaces:

  • Watching pins the stream (State::sync).
  • "Show/Hide participants" is there.
  • Fullscreen goes through window::latest().and_then(set_mode), and Escape leaves it.
  • PiP shows when away from the call with a stream watched, and disable_pip_popout turns it off.
  • The Stop watching button is in the control bar.

All of these are present, and nothing another task consumes was renamed.

Invariants: no Cargo.toml change, no new dependency or I/O path in fluxer-ui (window tasks are iced tasks, frames come only through FrameBus), no LiveKit types. Server data gets no unchecked indexing or unwraps, and sizes are sanitised. No secrets.

Local CI: FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci in a fresh worktree: all steps passed (exit 0), including the stream_focus/stream_pip goldens.

Findings

  1. minor – app.rs Escape handling: the Escape if self.local.call.escape() arm sits before the "close the top popout" arms. In fullscreen with the soundboard popout open, Escape leaves fullscreen first instead of closing the popout. The fork's LayerManager closes layers first.
  2. minor – Fullscreen is view-local and is never read back from the window. If the WM or OS takes the window out of fullscreen (for example the WM's own key), local.call.fullscreen stays true. The header and sidebar stay hidden until the user presses the corner button twice.
  3. minor (documented deviations) – The PiP card cannot be dragged or resized, and disabling it skips the confirm dialog. The "{name}'s screen" header sits in the focus area, and the 76 % rule outside fullscreen uses an estimated window height (call area + 48 + bar room). This is acceptable, but per CLAUDE.md the drag/resize and confirm-dialog gaps should become a follow-up issue linked from this PR before merge. Leaving out the disconnect button follows the fork (PiPFooter: !isScreenShare), so that is fine.

Verdict: APPROVED (no blocking findings, local CI green).

## Independent review: Screen share 24 (focus layout, fullscreen, corner controls, stop watching, PiP) Scope: `git diff 501e4aad..origin/screenshare-24-ui-focus-layout` (bac08b9). **Plan tests:** all five named tests are in `crates/fluxer-ui/tests/stream_focus.rs` and check what the plan asks for. `focus_area_max_height_rule` covers min(76 % of the window, area − 3 rem) at 16:9 (760 / 452 / 337.5 px), NaN input and watch-pins. `fullscreen_moves_members_to_bottom_row` covers the mini grid tiles ≤ 23.75 rem, the bottom row from the fork's `clamp(4rem, clamp(5.375rem, 13cqh, 7rem), 40cqh)`, Hide participants, and Escape. `stop_watching_button_only_when_focused`, `pip_shows_away_from_call_and_back_to_call_returns` and `pip_disabled_by_setting` round out the set. The goldens `stream_focus` and `stream_pip` are present and pass locally. **Interfaces:** - Watching pins the stream (`State::sync`). - "Show/Hide participants" is there. - Fullscreen goes through `window::latest().and_then(set_mode)`, and Escape leaves it. - PiP shows when away from the call with a stream watched, and `disable_pip_popout` turns it off. - The Stop watching button is in the control bar. All of these are present, and nothing another task consumes was renamed. **Invariants:** no Cargo.toml change, no new dependency or I/O path in fluxer-ui (window tasks are iced tasks, frames come only through `FrameBus`), no LiveKit types. Server data gets no unchecked indexing or unwraps, and sizes are sanitised. No secrets. **Local CI:** `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` in a fresh worktree: all steps passed (exit 0), including the stream_focus/stream_pip goldens. ### Findings 1. **minor** – `app.rs` Escape handling: the `Escape if self.local.call.escape()` arm sits before the "close the top popout" arms. In fullscreen with the soundboard popout open, Escape leaves fullscreen first instead of closing the popout. The fork's LayerManager closes layers first. 2. **minor** – Fullscreen is view-local and is never read back from the window. If the WM or OS takes the window out of fullscreen (for example the WM's own key), `local.call.fullscreen` stays true. The header and sidebar stay hidden until the user presses the corner button twice. 3. **minor** (documented deviations) – The PiP card cannot be dragged or resized, and disabling it skips the confirm dialog. The "{name}'s screen" header sits in the focus area, and the 76 % rule outside fullscreen uses an estimated window height (call area + 48 + bar room). This is acceptable, but per CLAUDE.md the drag/resize and confirm-dialog gaps should become a `follow-up` issue linked from this PR before merge. Leaving out the disconnect button follows the fork (`PiPFooter`: `!isScreenShare`), so that is fine. **Verdict: APPROVED** (no blocking findings, local CI green).
charles manually merged commit 7b903fff9b into screenshare 2026-11-12 11:45:18 +00:00
Sign in to join this conversation.
No description provided.