Screen share 27: Stream context menu (#174) #249
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "screenshare-27-ui-stream-menu"
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: screenshare-23-ui-stream-tile
What this builds
The stream context menu of spec §10 "Stream context menu", cloned from
fork:fluxer_app/src/features/ui/action_menu/items/VoiceParticipantStreamMenuBuilder.tsx:72-272, on the generalwidgets::context_menu(no stream-specific code in the widget, #129).screens/main/stream_menu.rs(new):model(app, &StreamKey)gives the rows in the original's groups. Own stream: "Stop streaming" (danger), "Change stream" (the picker in switch mode), then "More options" with "Show my screen share" and "Pause preview when Fluxer isn’t focused". Someone else's stream: "Watch stream" when not watched, "Stop watching" when watched, and for a watched stream with sound (buildStreamAudioActions) a group with "Mute" and "Stream volume" (0–200 %, using the shared slider's 100 % detent). A stream that ended but is still watched only has "Stop watching". Actions close the menu; the slider and the checkboxes leave it open, as in the original.items/itemturn the model into context-menu rows, andviewdraws the menu on its own.call/stream_tile.rs: right-clicking anywhere on a stream tile emitscall::Message::OpenStreamMenu { key, position }(window coordinates, through the existingscreenshare::on_right_press).participant_menu.rs: when the participant's connection is sharing, the stream menu's groups are added as the "stream section" after the listener's own controls and before Move to/moderation, and they emitparticipant_menu::Message::Stream(..). The user-volume slider row is nowslider_row(label, percent, max, on_change)and shared with the stream volume row.The dimensions come from the existing context menu widget (
ContextMenu.module.css,MenuItem.module.css,MenuItemSlider.tsx), and the strings come from the fork's descriptors (voice_participant_menu_data/shared.ts,CommonMessageDescriptors.ts,VoiceMessageDescriptors.ts).Tests
crates/fluxer-ui/tests/stream_menu.rs:items_for_own_stream,items_for_watched_and_unwatched,volume_and_mute_emit(also covers the tile right-click and a headless sweep of the drawn slider and Mute row),participant_menu_has_stream_section_when_streaming.stream_menu_matches_golden(fixtures/golden/stream_menu.png, also indocs/screenshots/stream-menu.png, with a row in the README table). The golden was drawn on lavapipe in thefluxer-native-shots:u2204Ubuntu 22.04 image. There is no Electron reference capture: the layout follows the fork component and the CSS files named above.FLUXER_SCREENSHOT_TESTS=1 cargo xtask ciis green locally. No capture or hardware tests are involved.Deviations / notes for the reviewer
call/mod.rs(theOpenStreamMenuvariant),screens/main/mod.rs(pub mod stream_menu,Message::StreamMenu, opening and drawing it; opening one menu closes the other),app.rs(Local::stream_menu, Escape closes it), andtests/screenshots.rsplusdocs/screenshots/README.mdfor the screenshot.Closes #174
🤖 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 27 (stream context menu)
Reviewed
git diff 501e4aad..origin/screenshare-27-ui-stream-menu(c0231e1) cold, against plan Task 27, spec §10 "Stream context menu", §1/§14 omissions andfork:VoiceParticipantStreamMenuBuilder.tsx:72-272.(1) Tests named by the plan: all present in
crates/fluxer-ui/tests/stream_menu.rsand asserting the spec's values.items_for_own_stream(Stop streaming / Change stream, then More options with "Show my screen share" and "Pause preview when Fluxer isn't focused"),items_for_watched_and_unwatched(Watch stream / Stop watching, with Mute and Stream volume only for a watched stream with audio, as inbuildStreamAudioActions),volume_and_mute_emit(right-click on the tile opens it at the cursor; slider spans 0-200 with the 100 detent asserted as no value in 95..=105 except 100; Mute toggles),participant_menu_has_stream_section_when_streaming. Screenshotstream_menu_matches_golden->fixtures/golden/stream_menu.png, and the golden looks right (150 % knob at about 3/4).(2) Interfaces:
screens/main/stream_menu.rsexists and is built onwidgets::context_menu. The widget is not changed (#129). The groups and order match the fork builder exactly. "Pop out stream", "Copy stats JSON" and the DM-only "Screen share privacy" item are left out, as spec §1/§14 say.(3) Invariants: the change is UI only. It adds no new I/O path, no fluxer-core changes and no dependency, and no secrets. Nothing in
stream_menu.rscan panic (no unwrap, expect or indexing). The participant menu's stream action re-resolves the key throughstream_ofand does nothing when it is gone.(4) Review Focus: no item belongs to Task 27.
(5) Local CI:
FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci. The first run was red onfluxer-videobus_reader_never_blocks_writer("1 writes blocked for 5 ms or more (worst 14.35 ms)"). This task doesn't touch that code: it is Screen share 1's timing bound, which is sensitive to load. Three isolated reruns of that test and a second full ci run were green, includingstream_menu_matches_goldenon this host's GPU.Findings
screens/main/mod.rsview /stream_menu::model): when the stream ends while its menu is open and it is not watched,modelreturnsNone, so nothing is drawn, butlocal.stream_menustaysSome. The next Escape is used up closing an invisible menu. And if the same key starts sharing again, the menu reappears at its old position without a click. A suggested fix: clearlocal.stream_menuinupdatewhenmodelisNone.fluxer-video/tests/bus.rs:81bus_reader_never_blocks_writerfailed once under full-workspace load (14 ms against a 5 ms bound) and passed on rerun. It may flake on the runners. It's worth abugissue against Screen share 1. I did not open one from this review.OpenScreenSharePicker { switch: true }, where the fork callschangeActiveScreenShare(shareContext)directly. That fits the native picker flow from Task 25/26, so it is not a finding.Verdict: approve. There are no blocking findings, and local ci is green (one unrelated flaky failure on the first run, green on rerun).