Screen share 22: Sidebar LIVE badge, guild voice badge, hover card, double-click to watch (#169) #244

Manually merged
charles merged 3 commits from screenshare-22-ui-sidebar-live into screenshare 2026-11-12 10:46:01 +00:00
Owner

Stacked on: origin/screenshare-13-core-previews

What this builds (spec §10 "Sidebar")

  • widgets::live_badge::live_badge(LiveBadgeTone::{Default, VoiceTile}): the red "LIVE" pill of LiveBadge.{tsx,module.css} (rgb(220 38 38), 10 px/600, 2 × 6 px padding, pill; the voice-tile tone is 1.25 rem high, 0.4375 rem corners, the HUD's 1 px border) with the "Screen sharing" tooltip. voice_state_icons now draws it, still last of the icons (VoiceStateIcons.tsx:91). Task 23 can reuse the VoiceTile tone.
  • Guild rail: GuildRailItem::streaming (somebody in one of the guild's voice channels has self_stream) draws the original's voice badge with MonitorPlayIcon (VoiceBadge.tsx, .guildVoiceBadge* of GuildsLayout.module.css: 1.25 rem --status-online disc, 0.75 rem white icon, 0.1875 rem ring in --guild-badge-surface, −0.25 rem from the icon's upper right).
  • screens::main::stream_hover (StreamWatchHoverPopout.tsx, StreamWatchHoverCard.{tsx,module.css}): a streaming participant's row opens the card after 200 ms, the card closes 150 ms after the cursor left the row and the card (useHover delays; the cursor can cross the 16 px gap onto the card). Opening emits RequestStreamPreview. The card (15 rem wide, preview 7.5 rem high on --voice-surface-2, image dimmed to brightness .6, action row on --voice-surface-3) shows the preview from the FrameBus (VideoKey::Preview) once the store fetched one and the server still has it, else "No preview yet"; the button says "Watch stream" / "Watching stream" / "You're streaming!" and emits WatchStream (disabled on the own share and a watched one); the protip "Double-click someone to watch their stream." while not watching. Placement: right of the row, centred, offset(16), flipped/shifted with 8 px padding.
  • Double click (useStreamWatchDoubleClick.ts): two presses within 300 ms on a streaming row emit WatchStream (and close the profile).

Tests

  • tests/stream_sidebar.rs (headless, tiny-skia): live_badge_last_in_state_icons, guild_badge_when_someone_streams, hover_card_shows_preview_or_placeholder (model with/without bus and fetched/404 preview; real hover in the main view opens the card only after the delay and asks for the preview; the card's button watches; the card keeps itself open), double_click_watches (first click opens ada's profile, second click watches and closes it; bob, not streaming, never watches), own_stream_card_says_youre_streaming. Unit tests in stream_hover for the hover timer, the 300 ms window, open/close bookkeeping and placement.
  • Screenshots sidebar_live and stream_hover_card (preview = frame 42 of the test pattern on the bus) rendered on lavapipe in the Ubuntu 22.04 image; sidebar_voice redrawn (ada streams there, so Forked now has the badge). No Electron side-by-side was captured (no access to an Electron session here); dimensions come from the CSS files named above.
  • FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci green locally.

Deviations / for the reviewer

  • The state is built from the basic scenario plus ada's streaming voice state (as the other sidebar screenshots), not the devserver screenshare READY.
  • The first press on a row opens the profile popout whose backdrop then takes the second press; so the second press of a double click arrives as the profile's Close, and State::backdrop_press turns it into the watch when it comes within 300 ms of a press on that sharer's row and the open profile is the sharer's. A click elsewhere within 300 ms of opening a streamer's profile therefore also watches.
  • stream_hover::State::frames is Option<FrameBus>, None in the app until #237 hands the runtime's bus to the UI (same pattern as the picker), so the app shows "No preview yet" until then.
  • Only the screenshare variant of the guild voice badge is drawn (spec §10); the original's speaker/camera variants for plain voice/video are not.
  • The card is drawn as a layer of the main view (not an iced overlay) so the screenshot harness, which draws no overlays, includes it; the main screen is now always a two-layer stack under the menus/popouts.
  • Touched outside the Files list (minimal): app.rs (Local::stream_hover), screens/main/mod.rs (message, update, layer), screens/main/model.rs (GuildRailItem::streaming), README rows. theme/icons.rs needed no change (MonitorPlay exists).
  • No preview spinner (isPreviewLoading) and no hover overlay text on the preview.

Closes #169

🤖 Generated with Claude Code

Stacked on: origin/screenshare-13-core-previews ## What this builds (spec §10 "Sidebar") - `widgets::live_badge::live_badge(LiveBadgeTone::{Default, VoiceTile})`: the red "LIVE" pill of `LiveBadge.{tsx,module.css}` (rgb(220 38 38), 10 px/600, 2 × 6 px padding, pill; the voice-tile tone is 1.25 rem high, 0.4375 rem corners, the HUD's 1 px border) with the "Screen sharing" tooltip. `voice_state_icons` now draws it, still last of the icons (`VoiceStateIcons.tsx:91`). Task 23 can reuse the `VoiceTile` tone. - Guild rail: `GuildRailItem::streaming` (somebody in one of the guild's voice channels has `self_stream`) draws the original's voice badge with `MonitorPlayIcon` (`VoiceBadge.tsx`, `.guildVoiceBadge*` of `GuildsLayout.module.css`: 1.25 rem `--status-online` disc, 0.75 rem white icon, 0.1875 rem ring in `--guild-badge-surface`, −0.25 rem from the icon's upper right). - `screens::main::stream_hover` (`StreamWatchHoverPopout.tsx`, `StreamWatchHoverCard.{tsx,module.css}`): a streaming participant's row opens the card after 200 ms, the card closes 150 ms after the cursor left the row and the card (`useHover` delays; the cursor can cross the 16 px gap onto the card). Opening emits `RequestStreamPreview`. The card (15 rem wide, preview 7.5 rem high on `--voice-surface-2`, image dimmed to brightness .6, action row on `--voice-surface-3`) shows the preview from the `FrameBus` (`VideoKey::Preview`) once the store fetched one and the server still has it, else "No preview yet"; the button says "Watch stream" / "Watching stream" / "You're streaming!" and emits `WatchStream` (disabled on the own share and a watched one); the protip "Double-click someone to watch their stream." while not watching. Placement: right of the row, centred, `offset(16)`, flipped/shifted with 8 px padding. - Double click (`useStreamWatchDoubleClick.ts`): two presses within 300 ms on a streaming row emit `WatchStream` (and close the profile). ## Tests - `tests/stream_sidebar.rs` (headless, tiny-skia): `live_badge_last_in_state_icons`, `guild_badge_when_someone_streams`, `hover_card_shows_preview_or_placeholder` (model with/without bus and fetched/404 preview; real hover in the main view opens the card only after the delay and asks for the preview; the card's button watches; the card keeps itself open), `double_click_watches` (first click opens ada's profile, second click watches and closes it; bob, not streaming, never watches), `own_stream_card_says_youre_streaming`. Unit tests in `stream_hover` for the hover timer, the 300 ms window, open/close bookkeeping and placement. - Screenshots `sidebar_live` and `stream_hover_card` (preview = frame 42 of the test pattern on the bus) rendered on lavapipe in the Ubuntu 22.04 image; `sidebar_voice` redrawn (ada streams there, so Forked now has the badge). No Electron side-by-side was captured (no access to an Electron session here); dimensions come from the CSS files named above. - `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` green locally. ## Deviations / for the reviewer - The state is built from the basic scenario plus ada's streaming voice state (as the other sidebar screenshots), not the devserver `screenshare` READY. - The first press on a row opens the profile popout whose backdrop then takes the second press; so the second press of a double click arrives as the profile's `Close`, and `State::backdrop_press` turns it into the watch when it comes within 300 ms of a press on that sharer's row and the open profile is the sharer's. A click elsewhere within 300 ms of opening a streamer's profile therefore also watches. - `stream_hover::State::frames` is `Option<FrameBus>`, `None` in the app until #237 hands the runtime's bus to the UI (same pattern as the picker), so the app shows "No preview yet" until then. - Only the screenshare variant of the guild voice badge is drawn (spec §10); the original's speaker/camera variants for plain voice/video are not. - The card is drawn as a layer of the main view (not an iced overlay) so the screenshot harness, which draws no overlays, includes it; the main screen is now always a two-layer stack under the menus/popouts. - Touched outside the Files list (minimal): `app.rs` (`Local::stream_hover`), `screens/main/mod.rs` (message, update, layer), `screens/main/model.rs` (`GuildRailItem::streaming`), README rows. `theme/icons.rs` needed no change (`MonitorPlay` exists). - No preview spinner (`isPreviewLoading`) and no hover overlay text on the preview. Closes #169 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Refs #169

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The LIVE badge is its own widget (widgets::live_badge, Default and VoiceTile
tones, "Screen sharing" tooltip), still last of the state icons. The guild
rail shows the voice badge with the screen share icon while somebody in the
guild streams. A streaming participant's row opens the hover card after
200 ms (closes 150 ms after the cursor left row and card), asks for the
preview, shows it from the FrameBus or "No preview yet", and watches from
its button; a double click (300 ms) on the row watches. Screenshots
sidebar_live and stream_hover_card; sidebar_voice redrawn for the badge.

Refs #169

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

Independent review: Screen share 22 (diff 16a3971..48b4907)

Plan tests: live_badge_last_in_state_icons, guild_badge_when_someone_streams, hover_card_shows_preview_or_placeholder and double_click_watches are in crates/fluxer-ui/tests/stream_sidebar.rs, and the sidebar_live and stream_hover_card goldens are in tests/screenshots.rs. They use the spec §10 values: rgb(220 38 38), 10 px/600, padding 2/6 px, 1.25 rem disc with MonitorPlay, card 15 rem wide, preview 7.5 rem high dimmed to brightness .6, 200/150 ms delays, 300 ms double click, and the original's strings. The unit tests also cover the hover timer and double-click boundaries (299 ms watches, 300 ms does not).
Interfaces: widgets::live_badge::live_badge(LiveBadgeTone::{Default, VoiceTile}) is public and ready for Task 23. The card emits UserAction::RequestStreamPreview once per opening. The card's button, its preview and a double click emit UserAction::WatchStream.
Invariants: nothing changed outside fluxer-ui, and the change adds no new I/O and no new dependency. The place() clamp uses min/max, so it cannot panic even when the window is smaller than the card. Lookups of server data return Option, with no unwrap.
Local CI: FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci is green in a clean worktree. The stream_sidebar tests and the sidebar_live, stream_hover_card and sidebar_voice goldens pass on the host's adapter.

Findings

  1. minor: stream_hover::card_model reads FrameBus::generation() directly. The CLAUDE.md exception says the UI reads the bus only in widgets::video, and the README says the same while also noting the card. The read is a single lock-free atomic load, so it does not block. Either move the check behind a helper in widgets::video or widen the wording in CLAUDE.md.
  2. minor: over() draws the open card for any key, whether or not that stream still exists. If the sharer stops while the card is open and the cursor never entered the card, the row (and its Hover widget) disappears and no RowAway ever arrives. The stale card then stays open with an enabled "Watch stream" button for a dead key. Fix: drop open when stream_of/the store no longer has the key.
  3. minor (behaviour, documented): State::backdrop_press turns any profile-backdrop press within 300 ms of the first press into a watch, wherever it lands, as long as the open profile is the sharer's. The original's dblclick only fires on the row itself. Clicking the row and then quickly clicking elsewhere to dismiss the profile starts watching.
  4. minor (process): the PR has no side-by-side Electron screenshot, which the Phase 4 rules ask for. Only the screenshare variant of the guild VoiceBadge is drawn (the speaker and camera variants are not). That gap is documented in the module docs and should get a follow-up issue.

Verdict: approve. No blocking findings and local CI is green.

## Independent review: Screen share 22 (diff 16a3971..48b4907) **Plan tests:** `live_badge_last_in_state_icons`, `guild_badge_when_someone_streams`, `hover_card_shows_preview_or_placeholder` and `double_click_watches` are in `crates/fluxer-ui/tests/stream_sidebar.rs`, and the `sidebar_live` and `stream_hover_card` goldens are in `tests/screenshots.rs`. They use the spec §10 values: rgb(220 38 38), 10 px/600, padding 2/6 px, 1.25 rem disc with MonitorPlay, card 15 rem wide, preview 7.5 rem high dimmed to brightness .6, 200/150 ms delays, 300 ms double click, and the original's strings. The unit tests also cover the hover timer and double-click boundaries (299 ms watches, 300 ms does not). **Interfaces:** `widgets::live_badge::live_badge(LiveBadgeTone::{Default, VoiceTile})` is public and ready for Task 23. The card emits `UserAction::RequestStreamPreview` once per opening. The card's button, its preview and a double click emit `UserAction::WatchStream`. **Invariants:** nothing changed outside fluxer-ui, and the change adds no new I/O and no new dependency. The `place()` clamp uses min/max, so it cannot panic even when the window is smaller than the card. Lookups of server data return `Option`, with no unwrap. **Local CI:** `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` is green in a clean worktree. The stream_sidebar tests and the sidebar_live, stream_hover_card and sidebar_voice goldens pass on the host's adapter. ### Findings 1. **minor**: `stream_hover::card_model` reads `FrameBus::generation()` directly. The `CLAUDE.md` exception says the UI reads the bus only in `widgets::video`, and the README says the same while also noting the card. The read is a single lock-free atomic load, so it does not block. Either move the check behind a helper in `widgets::video` or widen the wording in `CLAUDE.md`. 2. **minor**: `over()` draws the open card for any key, whether or not that stream still exists. If the sharer stops while the card is open and the cursor never entered the card, the row (and its Hover widget) disappears and no `RowAway` ever arrives. The stale card then stays open with an enabled "Watch stream" button for a dead key. Fix: drop `open` when `stream_of`/the store no longer has the key. 3. **minor (behaviour, documented)**: `State::backdrop_press` turns any profile-backdrop press within 300 ms of the first press into a watch, wherever it lands, as long as the open profile is the sharer's. The original's dblclick only fires on the row itself. Clicking the row and then quickly clicking elsewhere to dismiss the profile starts watching. 4. **minor (process)**: the PR has no side-by-side Electron screenshot, which the Phase 4 rules ask for. Only the screenshare variant of the guild VoiceBadge is drawn (the speaker and camera variants are not). That gap is documented in the module docs and should get a `follow-up` issue. **Verdict: approve.** No blocking findings and local CI is green.
# Conflicts:
#	crates/fluxer-ui/README.md
#	crates/fluxer-ui/src/app.rs
#	crates/fluxer-ui/src/screens/main/mod.rs
#	crates/fluxer-ui/tests/screenshots.rs
#	docs/screenshots/README.md
charles manually merged commit e4e18fb99a into screenshare 2026-11-12 10:46:01 +00:00
Sign in to join this conversation.
No description provided.