Screen share 23: Stream tile, watch overlay, HUD, control pill, spectators (#170) #247
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "screenshare-23-ui-stream-tile"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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-280for the control pill):call/stream_tile.rs:stream_tile::model(&App, channel_id)andview(&model, &FrameBus, w, h). One tile per screen share;grid::arrangeputs it right after its sharer's avatar tile andgrid::metricscounts 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" (turnsshow_my_own_screen_shareon), "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 ofgetClosestResolutionHeight; 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.iced::widget::hover).call::Message::{WatchStream, AddStream, StopWatching, SetStreamVolume, SetStreamMuted, ShowOwnStream}→ the store's actions.media::Stategainsframes: FrameBus;call::viewtakes&'a media::Stateand the tiles read the bus throughwidgets::video.Pause(Phosphor 2.1.10pause-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 throughApp::applywith the fixtures, widgets through iced with tiny-skia); unit tests ininfo_pill,spectators,stream_tile.stream_tile_not_watching,stream_tile_watching,stream_tile_ended(goldens drawn on lavapipe in the Ubuntu 22.04 image; copies indocs/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 cigreen locally (after merging origin/screenshare); the full screenshot suite also passes on lavapipe in docker.Deviations
VideoFrameInfocarries no frame rate.info_pill; Screen share 22'swidgets::live_badgewas not on this base. Whichever merges second can switch to the shared one.CaptureEvent::Stalledyet: follow-up #246.screens/main/media.rs(outside the Files list) gains theframesfield; the runtime still has to hand its bus to the UI (Screen share 21).Closes #170
🤖 Generated with 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>Independent review: Screen share 23 (stream tiles)
Reviewed the task's own changes:
b1ececdand the merge501e4aa(conflict resolutions incall/mod.rs,icons.rsand README keep both sides;ScreenShare(_)correctly maps toNone). The rest of16a3971..HEADis tasks 12/13/25/26/28, already merged onorigin/screenshare, so it was not reviewed here.Plan tests. All five named tests are in
crates/fluxer-ui/tests/stream_tile.rsand assert what the plan asks for.overlay_buttons_collapse_at_300_and_190checks 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_streamchecks thearrangeorder and that the grid metrics count the stream tile.states_render_their_overlayscovers every Overlay variant.viewer_count_excludes_ownercovers a second connection of the owner.volume_slider_emits_set_stream_volumecovers 0-200, mute and store round-trip. The 3 golden screenshot tests are present inscreenshots.rs.Interfaces. Spec §10 "Stream tile" is implemented:
stream_tile::{model, view, Overlay, StreamTileModel, buttons},grid::{arrange, Entry}, andgrid::metricsnow counts stream tiles. The newcall::Messagevariants map to the core actions of the same names (andShowOwnStreammaps toSetVoiceSetting(ShowMyOwnScreenShare(true))).call::viewnow takes&'a media::State, which only one caller uses (main/mod.rs).Invariants. No Cargo.toml changes and no new I/O.
fluxer-uireads pixels only throughwidgets::videooverLocal::media.frames(the FrameBus exception). Nothing in fluxer-core changed. No panics on server data:arrange/viewuseget(..)?, 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.sync_remote_streamskeepsremoteentries only for watched keys, so the extra "Stream ended" tile stays exactly until StopWatching. The test covers this. Correct.hover()when nobody is watching and aStackwhen it is persistent. Spectators and the preview popover are iced tooltips (not interactive), as the PR lists.Findings (all minor, none blocking)
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).UserAction::RequestStreamPreview(spec §6.3 "each hovered stream"). For tiles in the selected channel this is harmless because those previews are already fetched.Overlay::OwnStalledis never produced bymodel(core ignoresCaptureEvent::Stalled). This is tracked in #246.media::State::framesstarts as an empty bus. Video appears only once Task 21 hands the runtime's bus toLocal::media.frames, so Task 21 must do that.CI.
cargo xtask ciwas run locally in a clean review worktree on501e4aaand is green: fmt, clippy, deny, isolation, parity, and all tests including the five above. The screenshot step was skipped locally (FLUXER_SCREENSHOT_TESTSwas not set); I checked the stream_tile goldens by eye.Verdict: approve. No blocking findings.