Screen share 22: Sidebar LIVE badge, guild voice badge, hover card, double-click to watch (#169) #244
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "screenshare-22-ui-sidebar-live"
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
What this builds (spec §10 "Sidebar")
widgets::live_badge::live_badge(LiveBadgeTone::{Default, VoiceTile}): the red "LIVE" pill ofLiveBadge.{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_iconsnow draws it, still last of the icons (VoiceStateIcons.tsx:91). Task 23 can reuse theVoiceTiletone.GuildRailItem::streaming(somebody in one of the guild's voice channels hasself_stream) draws the original's voice badge withMonitorPlayIcon(VoiceBadge.tsx,.guildVoiceBadge*ofGuildsLayout.module.css: 1.25 rem--status-onlinedisc, 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 (useHoverdelays; the cursor can cross the 16 px gap onto the card). Opening emitsRequestStreamPreview. 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 theFrameBus(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 emitsWatchStream(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.useStreamWatchDoubleClick.ts): two presses within 300 ms on a streaming row emitWatchStream(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 instream_hoverfor the hover timer, the 300 ms window, open/close bookkeeping and placement.sidebar_liveandstream_hover_card(preview = frame 42 of the test pattern on the bus) rendered on lavapipe in the Ubuntu 22.04 image;sidebar_voiceredrawn (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 cigreen locally.Deviations / for the reviewer
screenshareREADY.Close, andState::backdrop_pressturns 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::framesisOption<FrameBus>,Nonein 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.app.rs(Local::stream_hover),screens/main/mod.rs(message, update, layer),screens/main/model.rs(GuildRailItem::streaming), README rows.theme/icons.rsneeded no change (MonitorPlayexists).isPreviewLoading) and no hover overlay text on the preview.Closes #169
🤖 Generated with Claude Code
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_placeholderanddouble_click_watchesare incrates/fluxer-ui/tests/stream_sidebar.rs, and thesidebar_liveandstream_hover_cardgoldens are intests/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 emitsUserAction::RequestStreamPreviewonce per opening. The card's button, its preview and a double click emitUserAction::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 returnOption, with no unwrap.Local CI:
FLUXER_SCREENSHOT_TESTS=1 cargo xtask ciis 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
stream_hover::card_modelreadsFrameBus::generation()directly. TheCLAUDE.mdexception says the UI reads the bus only inwidgets::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 inwidgets::videoor widen the wording inCLAUDE.md.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 noRowAwayever arrives. The stale card then stays open with an enabled "Watch stream" button for a dead key. Fix: dropopenwhenstream_of/the store no longer has the key.State::backdrop_pressturns 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.follow-upissue.Verdict: approve. No blocking findings and local CI is green.