Voice 20: Participant context menu and volume (#81) #135

Manually merged
charles merged 0 commits from voice-20-ui-participant-menu into voice 2026-11-11 23:43:29 +00:00
Owner

What

  • widgets::context_menu: the client's general context menu (actions, checkboxes, submenus, separators, custom rows such as a slider), anchored at the cursor in window coordinates and kept inside the window, closed by a click outside (left or right) or Escape. Nothing in it knows about voice. Sizes and colours from features/ui/action_menu/{ContextMenu,MenuItem}.module.css.
  • widgets::slider: the mini percent slider (features/ui/components/Slider.tsx, MenuItemSlider.tsx) with a 100 % detent (snaps within 5 %).
  • screens::main::participant_menu: the voice participant menu (VoiceParticipantContextMenu.tsx, items/VoiceParticipantMenuData.tsx, items/MoveToChannelSubmenu.tsx), opened by the sidebar's Message::OpenParticipantMenu. Other user: User volume (0-200) | Mute, Mute soundboard | Move to... (submenu) | Community mute, Community deafen, Disconnect device. Self: Mute, Deafen, Voice & video settings | Community mute/deafen. Moderation rows gated by MUTE_MEMBERS / DEAFEN_MEMBERS / MOVE_MEMBERS. Local::participant_menu holds the open menu; Escape closes it before the settings.
  • fluxer-core: UserAction::{ServerMute, ServerDeafen, DisconnectUser, MoveUser} -> ApiRequest::UpdateMemberVoice { guild_id, user_id, change: MemberVoiceChange }, answered with ApiResult::MemberVoiceUpdated (new module voice/moderation.rs).

Tests

  • crates/fluxer-ui/tests/participant_menu.rs: menu_items_for_other_user, menu_items_for_self, moderation_items_need_permissions, volume_slider_emits_set_user_volume, plus click_outside_or_escape_closes (headless widget protocol).
  • crates/fluxer-core/tests/voice_moderation.rs: server_mute_patches_member, deafen, disconnect, move, unknown guild / non-voice channel, logged out.
  • Screenshot participant_menu (golden fixtures/golden/participant_menu.png): the menu of relay opened from the sidebar during the call. No Electron reference image exists in the fork's docs/assets; dimensions come from the CSS files named above.
  • FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci green locally.

Deviations from the plan

  • apps/fluxer/src/runtime.rs (outside the Files list, needed to compile): UpdateMemberVoice answers with an HTTP 501 CLIENT_NOT_WIRED error. The member PATCH needs fluxer-proto + fluxer-api work, left to follow-up #134, so the moderation rows do not reach the server yet.
  • fluxer-core has no serde dependency, so the JSON body of the PATCH is not built or tested in core (it is described in #134).
  • Permissions are checked in the participant's voice channel (the original asks at guild level); "Move to..." lists voice channels where the user has MOVE_MEMBERS and the target has CONNECT. The original's role-hierarchy check (canManageTarget) is not ported; the server enforces it.
  • Entrance sound submenu omitted: the per-user entrance sound mute/volume is not in the store (Voice 10 left it out). Other rows of later sub-projects (profile, friends, cameras, focus, timeout, kick, ban, copy id) are omitted per spec section 9.
  • The original resets the slider with a button; here a 100 % detent, as the plan asks. "Disconnect device" is the original's label whenever the menu is for a connection.
  • A submenu opens to the right of the menu; the whole menu shifts left near the right edge instead of the submenu flipping.

Stacked on: voice-18-ui-call-view

Closes #81

🤖 Generated with Claude Code

## What - `widgets::context_menu`: the client's general context menu (actions, checkboxes, submenus, separators, custom rows such as a slider), anchored at the cursor in window coordinates and kept inside the window, closed by a click outside (left or right) or Escape. Nothing in it knows about voice. Sizes and colours from `features/ui/action_menu/{ContextMenu,MenuItem}.module.css`. - `widgets::slider`: the mini percent slider (`features/ui/components/Slider.tsx`, `MenuItemSlider.tsx`) with a 100 % detent (snaps within 5 %). - `screens::main::participant_menu`: the voice participant menu (`VoiceParticipantContextMenu.tsx`, `items/VoiceParticipantMenuData.tsx`, `items/MoveToChannelSubmenu.tsx`), opened by the sidebar's `Message::OpenParticipantMenu`. Other user: User volume (0-200) | Mute, Mute soundboard | Move to... (submenu) | Community mute, Community deafen, Disconnect device. Self: Mute, Deafen, Voice & video settings | Community mute/deafen. Moderation rows gated by MUTE_MEMBERS / DEAFEN_MEMBERS / MOVE_MEMBERS. `Local::participant_menu` holds the open menu; Escape closes it before the settings. - `fluxer-core`: `UserAction::{ServerMute, ServerDeafen, DisconnectUser, MoveUser}` -> `ApiRequest::UpdateMemberVoice { guild_id, user_id, change: MemberVoiceChange }`, answered with `ApiResult::MemberVoiceUpdated` (new module `voice/moderation.rs`). ## Tests - `crates/fluxer-ui/tests/participant_menu.rs`: `menu_items_for_other_user`, `menu_items_for_self`, `moderation_items_need_permissions`, `volume_slider_emits_set_user_volume`, plus `click_outside_or_escape_closes` (headless widget protocol). - `crates/fluxer-core/tests/voice_moderation.rs`: `server_mute_patches_member`, deafen, disconnect, move, unknown guild / non-voice channel, logged out. - Screenshot `participant_menu` (golden `fixtures/golden/participant_menu.png`): the menu of relay opened from the sidebar during the call. No Electron reference image exists in the fork's docs/assets; dimensions come from the CSS files named above. - `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` green locally. ## Deviations from the plan - `apps/fluxer/src/runtime.rs` (outside the Files list, needed to compile): `UpdateMemberVoice` answers with an HTTP 501 `CLIENT_NOT_WIRED` error. The member PATCH needs `fluxer-proto` + `fluxer-api` work, left to follow-up #134, so the moderation rows do not reach the server yet. - `fluxer-core` has no serde dependency, so the JSON body of the PATCH is not built or tested in core (it is described in #134). - Permissions are checked in the participant's voice channel (the original asks at guild level); "Move to..." lists voice channels where the user has MOVE_MEMBERS and the target has CONNECT. The original's role-hierarchy check (`canManageTarget`) is not ported; the server enforces it. - Entrance sound submenu omitted: the per-user entrance sound mute/volume is not in the store (Voice 10 left it out). Other rows of later sub-projects (profile, friends, cameras, focus, timeout, kick, ban, copy id) are omitted per spec section 9. - The original resets the slider with a button; here a 100 % detent, as the plan asks. "Disconnect device" is the original's label whenever the menu is for a connection. - A submenu opens to the right of the menu; the whole menu shifts left near the right edge instead of the submenu flipping. Stacked on: voice-18-ui-call-view Closes #81 🤖 Generated with [Claude Code](https://claude.com/claude-code)
# Conflicts:
#	crates/fluxer-core/README.md
The panel above the user area while in voice (VoiceConnectionStatusInner):
"Connecting..." / "In voice chat" / "Connection failed", the channel line,
the signal-strength icon with the original's latency thresholds and its
"Ping: {n}ms" tooltip, disconnect, Try again and Dismiss. The status line
opens the connection details (VoiceDetailsPopout): ping graph of the last
30 round trips, current and average ping, device, duration, participants,
endpoint (click copies). The user area moves to its own module and gains
the microphone and speaker buttons with the original's states and
tooltips (effective mute, moderator mute/deafen and no-speak lock); a
right-click on either opens Settings -> Voice & video.

Refs #78

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs #78

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
test(ui): voice panel goldens drawn on lavapipe
All checks were successful
ci / Linux (x86_64) (push) Successful in 13m12s
ci / Windows (x64) (push) Successful in 19m35s
8c37b507c7
voice_panel_connected and voice_panel_failed are new; main-general and
sidebar_voice are redrawn because the user area gained the microphone
and speaker buttons. All drawn on the reference renderer (Ubuntu 22.04
lavapipe, the recipe of docs/screenshots/README.md); the two new frames
are also under docs/screenshots for the PR.

Refs #78

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merge remote-tracking branch 'origin/voice' into voice-17-ui-voice-panel
All checks were successful
ci / Windows (x64) (push) Successful in 8m3s
ci / Linux (x86_64) (push) Successful in 28m17s
80c11ff71c
# Conflicts:
#	crates/fluxer-core/README.md
feat(core): soundboard and entrance sounds
All checks were successful
ci / Linux (x86_64) (push) Successful in 8m43s
ci / Windows (x64) (push) Successful in 8m5s
add3ec139a
Refs #71

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refs #79

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
feat(ui): call view and control bar
All checks were successful
ci / Windows (x64) (push) Successful in 7m58s
ci / Linux (x86_64) (push) Successful in 9m7s
a7ec434243
Refs #79

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Refs #81

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
UserAction::{ServerMute, ServerDeafen, DisconnectUser, MoveUser} become
ApiRequest::UpdateMemberVoice (guild member PATCH with only its voice
fields). The runtime answers the request with an error until the member
PATCH exists in fluxer-api (#134).

Refs #81

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
feat(ui): voice participant context menu
All checks were successful
ci / Windows (x64) (push) Successful in 7m43s
ci / Linux (x86_64) (push) Successful in 24m30s
f3c1f6932d
Refs #81

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

Independent review: Voice 20, participant context menu (diff a7ec434..f3c1f69)

Plan tests: all present, and they assert what the plan asks for.

  • UI: menu_items_for_other_user, menu_items_for_self, moderation_items_need_permissions, volume_slider_emits_set_user_volume (it clicks the real slider through the headless harness; detent at 97/104 -> 100, 90 and 200 unchanged), plus click_outside_or_escape_closes.
  • Core: server_mute_patches_member, plus tests for deafen, disconnect, move, unknown guild or non-voice channel, and logged out.
  • Screenshot participant_menu passes against its golden. I checked the image by eye and it looks right.

Interfaces:

  • UserAction::{ServerMute, ServerDeafen, DisconnectUser, MoveUser} -> ApiRequest::UpdateMemberVoice { guild_id, user_id, change: MemberVoiceChange } and ApiResult::MemberVoiceUpdated exist.
  • The sidebar's Message::OpenParticipantMenu (Voice 16) is handled.
  • widgets::context_menu has nothing voice-specific in it.

Invariants:

  • fluxer-core gains no forbidden imports and no new dependencies. Core isolation passes.
  • fluxer-ui does no I/O.
  • Server data cannot cause a panic: there is no indexing, missing names fall back to unwrap_or_default, and a target who has left voice just drops the guild rows.
  • No secrets anywhere in the diff.

Hit-testing (checked against iced_widget 0.14.2 Stack::update):

  • With the cursor over the card, the card's mouse_area reports Idle and the buttons report Pointer. Both are not None, so the backdrop and the base get a levitated cursor.
  • Outside the card, Anchored reports None. The backdrop's on_press/on_right_press then publishes Close and captures the event, so the base never sees it.
  • This is correct.

Submenu offset: correct.

  • The offset adds up each row's own height: 32 per item, 9 per separator (1 + 4 + 4), and 50 for the slider row (6 + 18 + 4 + 16 + 6).
  • Each of these heights matches the fixed height its row is actually laid out with.
  • Both cards have the same 1 px border and 6 px padding, so the submenu's first row lines up with the row that opened it.

Review Focus: none of the items applies to this task.

FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci: green in the review worktree (fmt, clippy, deny, core-isolation, parity, tests, screenshot-tests).

Findings

  1. minor: Clicking a submenu row after hovering it closes the submenu. Hovering "Move to…" sends Submenu(Some(i)). On the next render the row's on_press is on_submenu(None), so the usual "move onto the row, then click" closes what the hover just opened. Suggestion: make a click on the row open the submenu (always Some(index)) rather than toggle it.
  2. minor: Spec §9 lists "entrance sound mute/volume", but this PR leaves it out. The reason is fair: there are no per-user entrance preferences in the store. Still, no follow-up issue tracks it. CLAUDE.md requires deferred work to have a follow-up issue linked from the PR before merge.
  3. minor: Until #134 lands, the moderation rows (Community mute/deafen, Disconnect, Move to) are shown and clickable but fail without any visible effect: the runtime returns 501 CLIENT_NOT_WIRED, and core ignores the failure. This is tracked in #134 and is not blocking. #134 should land before this ships to users.
  4. minor: Near the right or bottom edge, the main card and the submenu column are clamped as one block, so opening "Move to…" makes the main card jump left or up under the cursor. The original flips the submenu instead. Already noted in the PR's deviations.
  5. minor (test coverage): The Escape path in Shell (WindowEvent::Escape closing the menu before the settings) has no test. click_outside_or_escape_closes only sends participant_menu::Message::Close.

Verdict: APPROVE. There are no blocking findings and ci is green. Findings 1 and 2 can be fixed in this PR or tracked as follow-ups.

## Independent review: Voice 20, participant context menu (diff a7ec434..f3c1f69) **Plan tests:** all present, and they assert what the plan asks for. - UI: `menu_items_for_other_user`, `menu_items_for_self`, `moderation_items_need_permissions`, `volume_slider_emits_set_user_volume` (it clicks the real slider through the headless harness; detent at 97/104 -> 100, 90 and 200 unchanged), plus `click_outside_or_escape_closes`. - Core: `server_mute_patches_member`, plus tests for deafen, disconnect, move, unknown guild or non-voice channel, and logged out. - Screenshot `participant_menu` passes against its golden. I checked the image by eye and it looks right. **Interfaces:** - `UserAction::{ServerMute, ServerDeafen, DisconnectUser, MoveUser}` -> `ApiRequest::UpdateMemberVoice { guild_id, user_id, change: MemberVoiceChange }` and `ApiResult::MemberVoiceUpdated` exist. - The sidebar's `Message::OpenParticipantMenu` (Voice 16) is handled. - `widgets::context_menu` has nothing voice-specific in it. **Invariants:** - fluxer-core gains no forbidden imports and no new dependencies. Core isolation passes. - fluxer-ui does no I/O. - Server data cannot cause a panic: there is no indexing, missing names fall back to `unwrap_or_default`, and a target who has left voice just drops the guild rows. - No secrets anywhere in the diff. **Hit-testing (checked against iced_widget 0.14.2 `Stack::update`):** - With the cursor over the card, the card's `mouse_area` reports `Idle` and the buttons report `Pointer`. Both are not `None`, so the backdrop and the base get a levitated cursor. - Outside the card, `Anchored` reports `None`. The backdrop's `on_press`/`on_right_press` then publishes Close and captures the event, so the base never sees it. - This is correct. **Submenu offset:** correct. - The offset adds up each row's own height: 32 per item, 9 per separator (1 + 4 + 4), and 50 for the slider row (6 + 18 + 4 + 16 + 6). - Each of these heights matches the fixed height its row is actually laid out with. - Both cards have the same 1 px border and 6 px padding, so the submenu's first row lines up with the row that opened it. **Review Focus:** none of the items applies to this task. **`FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci`:** green in the review worktree (fmt, clippy, deny, core-isolation, parity, tests, screenshot-tests). ### Findings 1. **minor**: Clicking a submenu row after hovering it closes the submenu. Hovering "Move to…" sends `Submenu(Some(i))`. On the next render the row's `on_press` is `on_submenu(None)`, so the usual "move onto the row, then click" closes what the hover just opened. Suggestion: make a click on the row open the submenu (always `Some(index)`) rather than toggle it. 2. **minor**: Spec §9 lists "entrance sound mute/volume", but this PR leaves it out. The reason is fair: there are no per-user entrance preferences in the store. Still, no follow-up issue tracks it. CLAUDE.md requires deferred work to have a `follow-up` issue linked from the PR before merge. 3. **minor**: Until #134 lands, the moderation rows (Community mute/deafen, Disconnect, Move to) are shown and clickable but fail without any visible effect: the runtime returns 501 `CLIENT_NOT_WIRED`, and core ignores the failure. This is tracked in #134 and is not blocking. #134 should land before this ships to users. 4. **minor**: Near the right or bottom edge, the main card and the submenu column are clamped as one block, so opening "Move to…" makes the main card jump left or up under the cursor. The original flips the submenu instead. Already noted in the PR's deviations. 5. **minor (test coverage)**: The Escape path in `Shell` (`WindowEvent::Escape` closing the menu before the settings) has no test. `click_outside_or_escape_closes` only sends `participant_menu::Message::Close`. **Verdict: APPROVE.** There are no blocking findings and ci is green. Findings 1 and 2 can be fixed in this PR or tracked as follow-ups.
charles manually merged commit 09de2137ea into voice 2026-11-11 23:43:29 +00:00
Sign in to join this conversation.
No description provided.