Screen share 27: Stream context menu (#174) #249

Manually merged
charles merged 2 commits from screenshare-27-ui-stream-menu into screenshare 2026-11-12 11:45:22 +00:00
Owner

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 general widgets::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/item turn the model into context-menu rows, and view draws the menu on its own.
  • call/stream_tile.rs: right-clicking anywhere on a stream tile emits call::Message::OpenStreamMenu { key, position } (window coordinates, through the existing screenshare::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 emit participant_menu::Message::Stream(..). The user-volume slider row is now slider_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.
  • Screenshot stream_menu_matches_golden (fixtures/golden/stream_menu.png, also in docs/screenshots/stream-menu.png, with a row in the README table). The golden was drawn on lavapipe in the fluxer-native-shots:u2204 Ubuntu 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 ci is green locally. No capture or hardware tests are involved.

Deviations / notes for the reviewer

  • To wire the menu up, this goes beyond the task's Files list, with minimal changes: call/mod.rs (the OpenStreamMenu variant), 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), and tests/screenshots.rs plus docs/screenshots/README.md for the screenshot.
  • Left out, as the spec says (§1): "Pop out stream" and "Copy stats JSON". Also left out: the own stream's "Screen share privacy" row in DM calls, which the spec's list does not include.
  • The participant menu's stream section is new: the original shows those rows only on the stream tile's menu. It is placed after the listener's own controls. On a "user as a whole" row (a user on several devices) it does not show, because there is no single connection to take the stream from.

Closes #174

🤖 Generated with Claude Code

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 general `widgets::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`/`item` turn the model into context-menu rows, and `view` draws the menu on its own. - `call/stream_tile.rs`: right-clicking anywhere on a stream tile emits `call::Message::OpenStreamMenu { key, position }` (window coordinates, through the existing `screenshare::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 emit `participant_menu::Message::Stream(..)`. The user-volume slider row is now `slider_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`. - Screenshot `stream_menu_matches_golden` (`fixtures/golden/stream_menu.png`, also in `docs/screenshots/stream-menu.png`, with a row in the README table). The golden was drawn on lavapipe in the `fluxer-native-shots:u2204` Ubuntu 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 ci` is green locally. No capture or hardware tests are involved. ## Deviations / notes for the reviewer - To wire the menu up, this goes beyond the task's Files list, with minimal changes: `call/mod.rs` (the `OpenStreamMenu` variant), `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), and `tests/screenshots.rs` plus `docs/screenshots/README.md` for the screenshot. - Left out, as the spec says (§1): "Pop out stream" and "Copy stats JSON". Also left out: the own stream's "Screen share privacy" row in DM calls, which the spec's list does not include. - The participant menu's stream section is new: the original shows those rows only on the stream tile's menu. It is placed after the listener's own controls. On a "user as a whole" row (a user on several devices) it does not show, because there is no single connection to take the stream from. Closes #174 🤖 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
Refs #174

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Author
Owner

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 and fork:VoiceParticipantStreamMenuBuilder.tsx:72-272.

(1) Tests named by the plan: all present in crates/fluxer-ui/tests/stream_menu.rs and 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 in buildStreamAudioActions), 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. Screenshot stream_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.rs exists and is built on widgets::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.rs can panic (no unwrap, expect or indexing). The participant menu's stream action re-resolves the key through stream_of and 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 on fluxer-video bus_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, including stream_menu_matches_golden on this host's GPU.

Findings

  • minor (screens/main/mod.rs view / stream_menu::model): when the stream ends while its menu is open and it is not watched, model returns None, so nothing is drawn, but local.stream_menu stays Some. 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: clear local.stream_menu in update when model is None.
  • minor (outside this task): fluxer-video/tests/bus.rs:81 bus_reader_never_blocks_writer failed 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 a bug issue against Screen share 1. I did not open one from this review.
  • note: "Change stream" sends OpenScreenSharePicker { switch: true }, where the fork calls changeActiveScreenShare(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).

## 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 and `fork:VoiceParticipantStreamMenuBuilder.tsx:72-272`. **(1) Tests named by the plan**: all present in `crates/fluxer-ui/tests/stream_menu.rs` and 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 in `buildStreamAudioActions`), `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`. Screenshot `stream_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.rs` exists and is built on `widgets::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.rs` can panic (no unwrap, expect or indexing). The participant menu's stream action re-resolves the key through `stream_of` and 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** on `fluxer-video` `bus_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**, including `stream_menu_matches_golden` on this host's GPU. ### Findings - **minor** (`screens/main/mod.rs` view / `stream_menu::model`): when the stream ends while its menu is open and it is not watched, `model` returns `None`, so nothing is drawn, but `local.stream_menu` stays `Some`. 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: clear `local.stream_menu` in `update` when `model` is `None`. - **minor** (outside this task): `fluxer-video/tests/bus.rs:81` `bus_reader_never_blocks_writer` failed 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 a `bug` issue against Screen share 1. I did not open one from this review. - **note**: "Change stream" sends `OpenScreenSharePicker { switch: true }`, where the fork calls `changeActiveScreenShare(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).
charles manually merged commit 7b903fff9b into screenshare 2026-11-12 11:45:22 +00:00
Sign in to join this conversation.
No description provided.