Voice 16: Sidebar voice participants (#77) #112
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "voice-16-ui-voice-sidebar"
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:
voice-6-core-voice-states(Voice 6, #67)What this builds
The voice part of the channel sidebar (spec §9 "Sidebar", facts §7), cloned from
VoiceParticipantsList,VoiceParticipantItem,GroupedVoiceParticipant,VoiceStateIcons,VoiceChannelUserCount,CollapsedCategoryVoiceParticipants,AvatarWithPresenceandAvatarStackof the fork (every size constant names its CSS rule).screens/main/voice_participants.rs:channel(&App, channel_id, &State) -> VoiceChannelModel(the testable half, fromvoice_channel_participants): one row per user with avatar, speaking ring and state icons; a user on several devices is one row with a "(N)" button that shows one row per device ("Desktop device" / "Mobile device");stack+collapsed_category/collapsed_channeldraw the avatar stack (5, then "+N") of a collapsed category;user_count_badge.widgets/speaking_ring.rs: the#22c55ering,min(3px, 10 %)wide, painted outside the avatar like the CSS outline (no layout room).widgets/voice_state_icons.rs: camera, microphone, speaker, LIVE in the original's order, colours and tooltips.sidebar.rs: a click on a voice channel emitsMessage::JoinVoice->UserAction::JoinVoice { guild_id, channel_id }, orSelectChannelwhen the user is in it; a right-click on a participant emitsMessage::OpenParticipantMenu { user_id, connection_id, position }; a click on a category collapses it (selected, unread and connected channels stay).theme/icons.rs:SpeakerSlash,VideoCamera(fill),Desktop,DeviceMobile(regular), from@phosphor-icons/react2.1.10.How it was tested
crates/fluxer-ui/tests/voice_sidebar.rs(headless, tiny-skia; not on Windows, #93):rows_show_state_icons,speaking_ring_follows_selector(also checks the drawn ring's pixel),click_joins_then_second_click_selects,grouped_devices_expand,collapsed_category_shows_who_is_in_its_voice_channels. Clicks are found by probing the sidebar with real mouse events, not by layout indexes.sidebar_voice(fixtures/golden/sidebar_voice.png), drawn on lavapipe in the Ubuntu 22.04 container ofdocs/screenshots/README.md; the three existing goldens are unchanged.FLUXER_SCREENSHOT_TESTS=1 cargo xtask cigreen locally.No reference capture of the Electron sidebar with voice participants exists in the fork's docs/assets; the dimensions come from the CSS modules named above.
Deviations from the plan
voice-16-ui-voice-sidebar;voice/16-...cannot exist on the remote next to thevoicebranch (refname conflict), same as Voice 1, 2, 3 and 6.fluxer-coretouched (one variant):UserAction::JoinVoiceis produced by Voice 7, which this task is not stacked on. It is added here with exactly the shape of Task 7's Interfaces block and no reducer. Voice 7 adds the same variant: when the two meet, keep one.connection_idisOption<String>inOpenParticipantMenu:Noneon the row of a user on several devices (the original opens the menu for the user as a whole there).fluxer_proto::Channelhas nouser_limit(#107).screens/main/{mod.rs,model.rs}(messages,category_id),app.rs(Local::sidebar),widgets/mod.rs,tests/{common/mod.rs,screenshots.rs}, READMEs.voicescenario (Voice 15 is not in the base).Closes #77
🤖 Generated with Claude Code
Independent review: Voice 16 (sidebar voice participants), head
64598a0Reviewed
d245b6f..64598a0only (3 commits, 22 files).Verdict: APPROVED. 0 blocking, 4 minor.
What was checked
crates/fluxer-ui/tests/voice_sidebar.rsand assert what the plan says:rows_show_state_icons(icons and tones per user, driven throughVOICE_STATE_UPDATE),speaking_ring_follows_selector(model follows the selector'sspeaking, suppressed when muted; ring width 2.4 / 2.8 / 3.0 px; drawn pixel is#22c55e),click_joins_then_second_click_selects(first clickJoinVoice { Some(GUILD), HANGOUT }, secondSelectChannel, someone else being there does not count),grouped_devices_expand. Screenshotsidebar_voiceexists with its golden.UserAction::JoinVoice { guild_id: Option<Snowflake>, channel_id: Snowflake }is identical to the variant onorigin/voice-7-core-voice-connection.Message::OpenParticipantMenu { user_id, connection_id, position }exists with those field names. Participants come fromvoice_channel_participants, the count fromvoice_channel_user_count.fluxer-corechange is one enum variant, no new imports or dependencies.fluxer-uidoes no I/O. Nounwrap/expect/indexing on server data in the new non-test code (tree.children[0]is the widget's own child). No secrets; connection ids in fixtures are invented words.cargo xtask ciin the review worktree: exit 0. In addition the four ignored screenshot tests pass locally (cargo test -p fluxer-ui --test screenshots -- --ignored), includingsidebar_voice_matches_golden.Behaviour was compared with the fork:
ChannelItem.handleSelect,GroupedVoiceParticipant(any/all aggregation of icons),ChannelListContent(category stack hidden when the user is connected in the group),VoiceStateIconsorder. They match.Findings
crates/fluxer-ui/src/screens/main/voice_participants.rs(Surface::update):OpenParticipantMenu.positionis documented as "in the window", but the rows sit inside the sidebar'sscrollable, and iced 0.14 hands childrencursor + scroll translation(iced_widget-0.14.2/src/scrollable.rs:800). Once the channel list is scrolled, the published position is off by the scroll offset, so Task 20's menu would open below the cursor. The test only checks the unscrolled case. Fix here or in Task 20 (for example by taking the position from a window-level cursor), but Task 20 must not trust it as is.avatar_stack: the outline colour is read fromDARK.colors.background_tertiaryinstead of the active theme (theme.colors()in the style closure), so the collapsed-category stack would keep the dark outline under another theme.voicescenario (Voice 15 not in base); the user count badge is implemented but can never show (user_limitalwaysNone, follow-up #107, open); the expander is the original's "(N)" button, not an "N more devices" row;connectedmeans "the user has a voice state in the channel", which is also true from another device, until Voice 7 (follow-up #111, open). Files outside the plan's list were needed for the wiring.crates/fluxer-core/src/event.rs:UserAction::JoinVoiceis added here and by Voice 7. The definitions are identical, so the integrator keeps one at merge; the doc comment here ("the store ignores it") goes away with that.Note for the integrator:
tests/voice_sidebar.rstakes about 25 s in debug (the click probe rebuilds the view per grid point); acceptable, but it is the slowest UI test binary now.