Screen share 23: Stream tile, watch overlay, HUD, control pill, spectators (#170) #247

Manually merged
charles merged 2 commits from screenshare-23-ui-stream-tile into screenshare 2026-11-12 10:46:05 +00:00
Owner

Stacked on: origin/screenshare-13-core-previews (already merged into screenshare since; the branch also merges the current origin/screenshare with Screen share 25, 26 and 28).

What this builds

Spec §10 "Stream tile" (fork VoiceParticipantTile.{tsx,module.css}, voice_participant_tile/WatchStreamOverlay.tsx, StreamInfoPill.{tsx,module.css}, LiveBadge.module.css .liveBadgeOnVoiceTile, StreamSpectatorsPopout.{tsx,module.css}, ScreenShareBufferingFrame, FeedHiddenOverlay, VoiceCallView.module.css:216-280 for the control pill):

  • call/stream_tile.rs: stream_tile::model(&App, channel_id) and view(&model, &FrameBus, w, h). One tile per screen share; grid::arrange puts it right after its sharer's avatar tile and grid::metrics counts it like any tile. Overlays: watch prompt ("Watch stream", "Add stream" with the "Keep watching N streams and add this one" tooltip; labels dropped at 300 / 190 px, smaller buttons at 230 px: stream_tile::buttons), the room's video while watched, "Stream ended" + "Stop watching" (kept after the sharer's voice state stops sharing, until no longer watched), the 9-dot buffering frame, "Watching failed :(" + "error code …", own tile: "Stream hidden" + "Watch stream" (turns show_my_own_screen_share on), "Preview paused to save resources" / "Your stream is still live" (unfocused window + pause_own_preview_on_unfocus), "What you're sharing isn't updating". The preview is drawn dimmed (brightness .4 as 60 % black) under the prompt; hovering an unwatched tile shows the 9.5×6 rem preview popover beside it.
  • call/info_pill.rs: HUD pill ("1080p" from the received size, closest-height rule of getClosestResolutionHeight; own share "720p 30 FPS" from the committed target) and the voice-tile LIVE badge.
  • call/spectators.rs: "{n} watching" slot and the "Spectators - {n}" popout (13.75 rem, max 20 rem) on hover.
  • Control pill: speaker (mute) + 0–200 % stream volume slider while watched with sound, then the viewer slot; persistent while someone watches, otherwise on hover (iced::widget::hover).
  • call::Message::{WatchStream, AddStream, StopWatching, SetStreamVolume, SetStreamMuted, ShowOwnStream} → the store's actions.
  • media::State gains frames: FrameBus; call::view takes &'a media::State and the tiles read the bus through widgets::video.
  • Icon Pause (Phosphor 2.1.10 pause-fill).

Tests

  • crates/fluxer-ui/tests/stream_tile.rs: overlay_buttons_collapse_at_300_and_190, watch_emits_watch_stream, states_render_their_overlays, viewer_count_excludes_owner, volume_slider_emits_set_stream_volume (store driven through App::apply with the fixtures, widgets through iced with tiny-skia); unit tests in info_pill, spectators, stream_tile.
  • Screenshots stream_tile_not_watching, stream_tile_watching, stream_tile_ended (goldens drawn on lavapipe in the Ubuntu 22.04 image; copies in docs/screenshots/stream-tile-*.png). No Electron reference was captured; dimensions come from the fork files listed above.
  • control_bar_sharing.png (Screen share 25) re-drawn: the own share now has its stream tile ("720p 30 FPS", LIVE) in that screen.
  • FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci green locally (after merging origin/screenshare); the full screenshot suite also passes on lavapipe in docker.

Deviations

  • Stream volume: a horizontal slider inside the pill instead of the original's vertical slider that pops out below the speaker.
  • Spectators popout rows show name and device only (no avatar, voice state icons, profile popout or context menu); opens without the 200 ms delay (iced tooltip).
  • The received stream's pill shows the resolution only: VideoFrameInfo carries no frame rate.
  • The hover preview popover is a tooltip, so its "Watch" is not clickable (the tile's own button is).
  • Video corners are square (no rounded clip of the shader widget).
  • LIVE badge (voice tile tone) is drawn in info_pill; Screen share 22's widgets::live_badge was not on this base. Whichever merges second can switch to the shared one.
  • "What you're sharing isn't updating" is drawn and tested, but the store does not record CaptureEvent::Stalled yet: follow-up #246.
  • screens/main/media.rs (outside the Files list) gains the frames field; the runtime still has to hand its bus to the UI (Screen share 21).

Closes #170

🤖 Generated with Claude Code

Stacked on: origin/screenshare-13-core-previews (already merged into screenshare since; the branch also merges the current origin/screenshare with Screen share 25, 26 and 28). ## What this builds Spec §10 "Stream tile" (fork `VoiceParticipantTile.{tsx,module.css}`, `voice_participant_tile/WatchStreamOverlay.tsx`, `StreamInfoPill.{tsx,module.css}`, `LiveBadge.module.css` `.liveBadgeOnVoiceTile`, `StreamSpectatorsPopout.{tsx,module.css}`, `ScreenShareBufferingFrame`, `FeedHiddenOverlay`, `VoiceCallView.module.css:216-280` for the control pill): - `call/stream_tile.rs`: `stream_tile::model(&App, channel_id)` and `view(&model, &FrameBus, w, h)`. One tile per screen share; `grid::arrange` puts it right after its sharer's avatar tile and `grid::metrics` counts it like any tile. Overlays: watch prompt ("Watch stream", "Add stream" with the "Keep watching N streams and add this one" tooltip; labels dropped at 300 / 190 px, smaller buttons at 230 px: `stream_tile::buttons`), the room's video while watched, "Stream ended" + "Stop watching" (kept after the sharer's voice state stops sharing, until no longer watched), the 9-dot buffering frame, "Watching failed :(" + "error code …", own tile: "Stream hidden" + "Watch stream" (turns `show_my_own_screen_share` on), "Preview paused to save resources" / "Your stream is still live" (unfocused window + `pause_own_preview_on_unfocus`), "What you're sharing isn't updating". The preview is drawn dimmed (brightness .4 as 60 % black) under the prompt; hovering an unwatched tile shows the 9.5×6 rem preview popover beside it. - `call/info_pill.rs`: HUD pill ("1080p" from the received size, closest-height rule of `getClosestResolutionHeight`; own share "720p 30 FPS" from the committed target) and the voice-tile LIVE badge. - `call/spectators.rs`: "{n} watching" slot and the "Spectators - {n}" popout (13.75 rem, max 20 rem) on hover. - Control pill: speaker (mute) + 0–200 % stream volume slider while watched with sound, then the viewer slot; persistent while someone watches, otherwise on hover (`iced::widget::hover`). - `call::Message::{WatchStream, AddStream, StopWatching, SetStreamVolume, SetStreamMuted, ShowOwnStream}` → the store's actions. - `media::State` gains `frames: FrameBus`; `call::view` takes `&'a media::State` and the tiles read the bus through `widgets::video`. - Icon `Pause` (Phosphor 2.1.10 `pause-fill`). ## Tests - `crates/fluxer-ui/tests/stream_tile.rs`: `overlay_buttons_collapse_at_300_and_190`, `watch_emits_watch_stream`, `states_render_their_overlays`, `viewer_count_excludes_owner`, `volume_slider_emits_set_stream_volume` (store driven through `App::apply` with the fixtures, widgets through iced with tiny-skia); unit tests in `info_pill`, `spectators`, `stream_tile`. - Screenshots `stream_tile_not_watching`, `stream_tile_watching`, `stream_tile_ended` (goldens drawn on lavapipe in the Ubuntu 22.04 image; copies in `docs/screenshots/stream-tile-*.png`). No Electron reference was captured; dimensions come from the fork files listed above. - `control_bar_sharing.png` (Screen share 25) re-drawn: the own share now has its stream tile ("720p 30 FPS", LIVE) in that screen. - `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` green locally (after merging origin/screenshare); the full screenshot suite also passes on lavapipe in docker. ## Deviations - Stream volume: a horizontal slider inside the pill instead of the original's vertical slider that pops out below the speaker. - Spectators popout rows show name and device only (no avatar, voice state icons, profile popout or context menu); opens without the 200 ms delay (iced tooltip). - The received stream's pill shows the resolution only: `VideoFrameInfo` carries no frame rate. - The hover preview popover is a tooltip, so its "Watch" is not clickable (the tile's own button is). - Video corners are square (no rounded clip of the shader widget). - LIVE badge (voice tile tone) is drawn in `info_pill`; Screen share 22's `widgets::live_badge` was not on this base. Whichever merges second can switch to the shared one. - "What you're sharing isn't updating" is drawn and tested, but the store does not record `CaptureEvent::Stalled` yet: follow-up #246. - `screens/main/media.rs` (outside the Files list) gains the `frames` field; the runtime still has to hand its bus to the UI (Screen share 21). Closes #170 🤖 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
Author
Owner

Independent review: Screen share 23 (stream tiles)

Reviewed the task's own changes: b1ececd and the merge 501e4aa (conflict resolutions in call/mod.rs, icons.rs and README keep both sides; ScreenShare(_) correctly maps to None). The rest of 16a3971..HEAD is tasks 12/13/25/26/28, already merged on origin/screenshare, so it was not reviewed here.

Plan tests. All five named tests are in crates/fluxer-ui/tests/stream_tile.rs and assert what the plan asks for. overlay_buttons_collapse_at_300_and_190 checks the 300, 230 and 190 px thresholds with their +1 px neighbours and the 2 rem / 1.875 rem heights, and confirms both buttons can still be clicked as icons at 180 px. watch_emits_watch_stream checks the arrange order and that the grid metrics count the stream tile. states_render_their_overlays covers every Overlay variant. viewer_count_excludes_owner covers a second connection of the owner. volume_slider_emits_set_stream_volume covers 0-200, mute and store round-trip. The 3 golden screenshot tests are present in screenshots.rs.

Interfaces. Spec §10 "Stream tile" is implemented: stream_tile::{model, view, Overlay, StreamTileModel, buttons}, grid::{arrange, Entry}, and grid::metrics now counts stream tiles. The new call::Message variants map to the core actions of the same names (and ShowOwnStream maps to SetVoiceSetting(ShowMyOwnScreenShare(true))). call::view now takes &'a media::State, which only one caller uses (main/mod.rs).

Invariants. No Cargo.toml changes and no new I/O. fluxer-ui reads pixels only through widgets::video over Local::media.frames (the FrameBus exception). Nothing in fluxer-core changed. No panics on server data: arrange/view use get(..)?, and an ended tile without a sharer row is skipped. No secrets.

Reviewer checks requested.

  • grid::arrange: each participant tile is followed by the streams with the same user_id and connection_id; unmatched streams go last; the ordering is stable. Correct.
  • Ended tiles after self_stream goes false: core sync_remote_streams keeps remote entries only for watched keys, so the extra "Stream ended" tile stays exactly until StopWatching. The test covers this. Correct.
  • Hover/tooltip: the control pill uses hover() when nobody is watching and a Stack when it is persistent. Spectators and the preview popover are iced tooltips (not interactive), as the PR lists.

Findings (all minor, none blocking)

  1. minor: the preview popover is a tooltip(..., Position::Right) wrapped around the whole un-watched tile. When the tile sits at the right edge of a narrow window, iced snaps it inside the viewport, so it can cover the tile's own "Watch stream" / "Add stream" buttons. The buttons stay clickable, because the overlay takes no events, but they are hidden. The popover's "Watch" is decorative, and the spectators popout can't be scrolled once it exceeds 20 rem. These are already listed as deviations; consider a follow-up to move both onto a real popover/overlay (Task 24 or 27).
  2. minor: hovering a tile does not emit UserAction::RequestStreamPreview (spec §6.3 "each hovered stream"). For tiles in the selected channel this is harmless because those previews are already fetched.
  3. minor: Overlay::OwnStalled is never produced by model (core ignores CaptureEvent::Stalled). This is tracked in #246.
  4. minor (dependency, not a defect here): media::State::frames starts as an empty bus. Video appears only once Task 21 hands the runtime's bus to Local::media.frames, so Task 21 must do that.

CI. cargo xtask ci was run locally in a clean review worktree on 501e4aa and is green: fmt, clippy, deny, isolation, parity, and all tests including the five above. The screenshot step was skipped locally (FLUXER_SCREENSHOT_TESTS was not set); I checked the stream_tile goldens by eye.

Verdict: approve. No blocking findings.

## Independent review: Screen share 23 (stream tiles) Reviewed the task's own changes: b1ececd and the merge 501e4aa (conflict resolutions in `call/mod.rs`, `icons.rs` and README keep both sides; `ScreenShare(_)` correctly maps to `None`). The rest of `16a3971..HEAD` is tasks 12/13/25/26/28, already merged on `origin/screenshare`, so it was not reviewed here. **Plan tests.** All five named tests are in `crates/fluxer-ui/tests/stream_tile.rs` and assert what the plan asks for. `overlay_buttons_collapse_at_300_and_190` checks the 300, 230 and 190 px thresholds with their +1 px neighbours and the 2 rem / 1.875 rem heights, and confirms both buttons can still be clicked as icons at 180 px. `watch_emits_watch_stream` checks the `arrange` order and that the grid metrics count the stream tile. `states_render_their_overlays` covers every Overlay variant. `viewer_count_excludes_owner` covers a second connection of the owner. `volume_slider_emits_set_stream_volume` covers 0-200, mute and store round-trip. The 3 golden screenshot tests are present in `screenshots.rs`. **Interfaces.** Spec §10 "Stream tile" is implemented: `stream_tile::{model, view, Overlay, StreamTileModel, buttons}`, `grid::{arrange, Entry}`, and `grid::metrics` now counts stream tiles. The new `call::Message` variants map to the core actions of the same names (and `ShowOwnStream` maps to `SetVoiceSetting(ShowMyOwnScreenShare(true))`). `call::view` now takes `&'a media::State`, which only one caller uses (`main/mod.rs`). **Invariants.** No Cargo.toml changes and no new I/O. `fluxer-ui` reads pixels only through `widgets::video` over `Local::media.frames` (the FrameBus exception). Nothing in fluxer-core changed. No panics on server data: `arrange`/`view` use `get(..)?`, and an ended tile without a sharer row is skipped. No secrets. **Reviewer checks requested.** - `grid::arrange`: each participant tile is followed by the streams with the same user_id and connection_id; unmatched streams go last; the ordering is stable. Correct. - Ended tiles after self_stream goes false: core `sync_remote_streams` keeps `remote` entries only for watched keys, so the extra "Stream ended" tile stays exactly until StopWatching. The test covers this. Correct. - Hover/tooltip: the control pill uses `hover()` when nobody is watching and a `Stack` when it is persistent. Spectators and the preview popover are iced tooltips (not interactive), as the PR lists. **Findings (all minor, none blocking)** 1. minor: the preview popover is a `tooltip(..., Position::Right)` wrapped around the whole un-watched tile. When the tile sits at the right edge of a narrow window, iced snaps it inside the viewport, so it can cover the tile's own "Watch stream" / "Add stream" buttons. The buttons stay clickable, because the overlay takes no events, but they are hidden. The popover's "Watch" is decorative, and the spectators popout can't be scrolled once it exceeds 20 rem. These are already listed as deviations; consider a follow-up to move both onto a real popover/overlay (Task 24 or 27). 2. minor: hovering a tile does not emit `UserAction::RequestStreamPreview` (spec §6.3 "each hovered stream"). For tiles in the selected channel this is harmless because those previews are already fetched. 3. minor: `Overlay::OwnStalled` is never produced by `model` (core ignores `CaptureEvent::Stalled`). This is tracked in #246. 4. minor (dependency, not a defect here): `media::State::frames` starts as an empty bus. Video appears only once Task 21 hands the runtime's bus to `Local::media.frames`, so Task 21 must do that. **CI.** `cargo xtask ci` was run locally in a clean review worktree on 501e4aa and is green: fmt, clippy, deny, isolation, parity, and all tests including the five above. The screenshot step was skipped locally (`FLUXER_SCREENSHOT_TESTS` was not set); I checked the stream_tile goldens by eye. **Verdict: approve.** No blocking findings.
charles manually merged commit e4e18fb99a into screenshare 2026-11-12 10:46:02 +00:00
Sign in to join this conversation.
No description provided.