Daily use 36: Voice: user-limit badge, refusal and moderation modals, single tile (#526) #603

Closed
charles wants to merge 0 commits from dailyuse-36-ui-voice-badge-refusals into dailyuse
Owner

Daily use 36 (spec §3.8): the voice user-limit badge, the refusal and moderation failure modals, and the single call tile.

Stacked on: origin/dailyuse-21-core-voice-refusals, origin/dailyuse-30-ui-notification-settings-modal, origin/dailyuse-31-ui-user-dm-menus

What was built

  • User-limit badge (voice_participants.rs, sidebar.rs; VoiceChannelUserCount.{tsx,module.css}, ChannelItem.tsx:520-528, ChannelItem.module.css:366-390). The limit comes from fluxer_core::voice::user_limit (Task 21). The old user_limit() stub is gone. UserCount::cells() gives the two cells: the count is 28 px on --background-secondary, the limit is 20 px on --background-modifier-selected with padding-inline: 2px 4px, and both use minimumIntegerDigits: 2. The 5×16 px diagonal notch is an SVG triangle drawn over the right edge of the count cell. shown_user_count(&VoiceChannelModel, hovered) hides the badge while the row is hovered. The hover comes from media::Hovered::VoiceChannel(id) through a mouse_area, which only wraps rows that have a limit.

  • Refusal modals (modals/voice_refusal.rs, new). model(&App) turns voice::voice_refusal into the original's GenericErrorModal, reusing upload_errors::ErrorModal:

    • "Voice channel full": the gateway's VOICE_CHANNEL_FULL, or the local pre-check that sends no op 4.
    • "Something went wrong" with the timed-out, connection-limit, unavailable or P2P text.
    • VOICE_PERMISSION_DENIED shows nothing.

    The X, the backdrop and Escape all send UserAction::DismissVoiceError (main::Message::VoiceRefusal).

  • Moderation failure modals (participant_menu.rs). failure_model, failure_alert and failure_over show the store's moderation_failure with the same alert. They are dismissed with participant_menu::Message::DismissFailure, which sends DismissModerationFailure and works even when the menu is already closed.

  • Single tile (call/grid.rs, VoiceGridLayout.module.css:81-97). With one tile, the minimum tile size no longer applies: the tile is always shown at min(available w, available h × 16/9) and centred. The padding breakpoints (12/8/6 and 14/10/8) were already there, and now have a test.

Tests

  • tests/voice_refusal.rs (new): badge_two_digit_cells, badge_hidden_on_hover (also checks on screen that the two "02" cells disappear, and that moving the pointer over the row publishes the hover), refusal_modal_strings (the full channel, the op 12 code table, the moderation strings, and dismissal).
  • tests/call_view.rs: single_tile_centred_and_sized (metrics on tall, wide and tiny stages; layout bounds of the grid alone and on the main screen), padding_breakpoints.
  • Goldens (fixtures/golden/, references in docs/screenshots/): voice_user_limit_badge, voice_channel_full, call_view_single (1280x1024, #428). They were drawn on lavapipe in the Ubuntu 22.04 shots image, where the whole suite (143 tests) passes. FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci is green locally.
  • No FLUXER_DESKTOP_TESTS=1 tests were needed or run.

Deviations and notes for the reviewer

  • Stacked-branch merge. Daily use 29/30 and 31 both created screens/main/menus/mod.rs, and the merge conflict there was more than mechanical. I kept both sides: one Target enum (Channel, Category, Guild, User, Dm), one State (toast, notification settings modal, nickname modal), update taking shift, and open_model's "Mark as read" rule for channel and guild menus only. main/mod.rs, app.rs, the READMEs and dailyuse_ports.rs were combined the same way. The merge commit explains this. Please check it, because the dailyuse merge of 29/30 and 31 will hit the same conflict.
  • Badge visibility. The badge hides only on hover. The original also hides it while the row's context menu is open or the voice channel is selected by path (hoverAffordancesActive), because the hover buttons (open chat, invite) take its place, and the native sidebar has no such buttons.
  • Files outside the plan's list:
    • media.rs: one Hovered variant.
    • modals/mod.rs, main/mod.rs: registration only.
    • app.rs: two Escape arms.
    • docs/parity/voice.md: the badge row.
  • Panel during a gateway refusal. On a gateway refusal of a first join, the connection is Failed, so the voice panel shows "Connection failed" under the modal until it is dismissed (DismissVoiceError clears both). The original shows no panel. voice_panel.rs was out of this task's files.
  • Notch colour. The notch's colour is --background-modifier-selected composited over --background-secondary, because an iced SVG tint is opaque.

Screenshots

Native goldens: docs/screenshots/voice-user-limit-badge.png, docs/screenshots/voice-channel-full.png, docs/screenshots/call-view-single.png. The dimensions come from VoiceChannelUserCount.module.css, the modal from GenericErrorModal → ConfirmModal, and the grid from VoiceGridLayout.module.css. No Electron capture is attached (no test account was used).

Closes #526
Closes #107
Closes #108
Closes #428

🤖 Generated with Claude Code

Daily use 36 (spec §3.8): the voice user-limit badge, the refusal and moderation failure modals, and the single call tile. Stacked on: origin/dailyuse-21-core-voice-refusals, origin/dailyuse-30-ui-notification-settings-modal, origin/dailyuse-31-ui-user-dm-menus ## What was built - **User-limit badge** (`voice_participants.rs`, `sidebar.rs`; `VoiceChannelUserCount.{tsx,module.css}`, `ChannelItem.tsx:520-528`, `ChannelItem.module.css:366-390`). The limit comes from `fluxer_core::voice::user_limit` (Task 21). The old `user_limit()` stub is gone. `UserCount::cells()` gives the two cells: the count is 28 px on `--background-secondary`, the limit is 20 px on `--background-modifier-selected` with `padding-inline: 2px 4px`, and both use `minimumIntegerDigits: 2`. The 5×16 px diagonal notch is an SVG triangle drawn over the right edge of the count cell. `shown_user_count(&VoiceChannelModel, hovered)` hides the badge while the row is hovered. The hover comes from `media::Hovered::VoiceChannel(id)` through a `mouse_area`, which only wraps rows that have a limit. - **Refusal modals** (`modals/voice_refusal.rs`, new). `model(&App)` turns `voice::voice_refusal` into the original's `GenericErrorModal`, reusing `upload_errors::ErrorModal`: - "Voice channel full": the gateway's `VOICE_CHANNEL_FULL`, or the local pre-check that sends no op 4. - "Something went wrong" with the timed-out, connection-limit, unavailable or P2P text. - `VOICE_PERMISSION_DENIED` shows nothing. The X, the backdrop and Escape all send `UserAction::DismissVoiceError` (`main::Message::VoiceRefusal`). - **Moderation failure modals** (`participant_menu.rs`). `failure_model`, `failure_alert` and `failure_over` show the store's `moderation_failure` with the same alert. They are dismissed with `participant_menu::Message::DismissFailure`, which sends `DismissModerationFailure` and works even when the menu is already closed. - **Single tile** (`call/grid.rs`, `VoiceGridLayout.module.css:81-97`). With one tile, the minimum tile size no longer applies: the tile is always shown at `min(available w, available h × 16/9)` and centred. The padding breakpoints (12/8/6 and 14/10/8) were already there, and now have a test. ## Tests - `tests/voice_refusal.rs` (new): `badge_two_digit_cells`, `badge_hidden_on_hover` (also checks on screen that the two "02" cells disappear, and that moving the pointer over the row publishes the hover), `refusal_modal_strings` (the full channel, the op 12 code table, the moderation strings, and dismissal). - `tests/call_view.rs`: `single_tile_centred_and_sized` (metrics on tall, wide and tiny stages; layout bounds of the grid alone and on the main screen), `padding_breakpoints`. - Goldens (`fixtures/golden/`, references in `docs/screenshots/`): `voice_user_limit_badge`, `voice_channel_full`, `call_view_single` (1280x1024, #428). They were drawn on lavapipe in the Ubuntu 22.04 shots image, where the whole suite (143 tests) passes. `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` is green locally. - No `FLUXER_DESKTOP_TESTS=1` tests were needed or run. ## Deviations and notes for the reviewer - **Stacked-branch merge.** Daily use 29/30 and 31 both created `screens/main/menus/mod.rs`, and the merge conflict there was more than mechanical. I kept both sides: one `Target` enum (Channel, Category, Guild, User, Dm), one `State` (toast, notification settings modal, nickname modal), `update` taking `shift`, and `open_model`'s "Mark as read" rule for channel and guild menus only. `main/mod.rs`, `app.rs`, the READMEs and `dailyuse_ports.rs` were combined the same way. The merge commit explains this. Please check it, because the dailyuse merge of 29/30 and 31 will hit the same conflict. - **Badge visibility.** The badge hides only on hover. The original also hides it while the row's context menu is open or the voice channel is selected by path (`hoverAffordancesActive`), because the hover buttons (open chat, invite) take its place, and the native sidebar has no such buttons. - **Files outside the plan's list:** - `media.rs`: one `Hovered` variant. - `modals/mod.rs`, `main/mod.rs`: registration only. - `app.rs`: two Escape arms. - `docs/parity/voice.md`: the badge row. - **Panel during a gateway refusal.** On a gateway refusal of a first join, the connection is `Failed`, so the voice panel shows "Connection failed" under the modal until it is dismissed (`DismissVoiceError` clears both). The original shows no panel. `voice_panel.rs` was out of this task's files. - **Notch colour.** The notch's colour is `--background-modifier-selected` composited over `--background-secondary`, because an iced SVG tint is opaque. ## Screenshots Native goldens: `docs/screenshots/voice-user-limit-badge.png`, `docs/screenshots/voice-channel-full.png`, `docs/screenshots/call-view-single.png`. The dimensions come from `VoiceChannelUserCount.module.css`, the modal from `GenericErrorModal` → `ConfirmModal`, and the grid from `VoiceGridLayout.module.css`. No Electron capture is attached (no test account was used). Closes #526 Closes #107 Closes #108 Closes #428 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Refs #507

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
menus::{channel, category, guild} build the original's desktop menus
(AM/ChannelContextMenu.tsx, ChannelMenuData.tsx:429-632,
CategoryMenuData.tsx:263-339, GuildMenuData.tsx:314-497) with the "B"
rows of spec 3.2 (a)-(d). MarkCategoryRead and MarkGuildRead ack in
bulk through POST /read-states/ack; CopyId, CopyChannelLink and the
link channel's "Copy link" write the clipboard. Collapsed categories
are synced as the category override's `collapsed`
(UserGuildSettingsCommands.ts:198-246), written debounced 3 s with the
whole override map; "Hide muted channels" likewise. The sidebar reads
notif_settings::is_collapsed and emits UserAction::ToggleCategory
instead of keeping a local set.

New UserAction variants: CopyLinkChannelUrl, OpenNotificationSettings,
OpenFollowChannel (the last two open UI-owned modals).

Refs #503

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A right press on a guild channel's row, a category header, a guild icon
or the guild header opens the store's menu (Daily use 17) at the cursor,
drawn by widgets::context_menu with the original's icons; the mute row
mutes until turned back on when clicked and opens its durations when
hovered; the copy rows put up the original's toasts; Escape and a click
outside close it. Icons megaphone-simple-fill and arrow-square-out-regular
added from @phosphor-icons/core 2.1.1.

Refs #518

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Four new goldens from the dailyuse scenario's READY
(fixtures/gateway/dailyuse_ready.json): channel_menu (#general's menu),
channel_menu_mute_submenu (its nine durations open), category_menu
(Lobby) and guild_menu (Forked, from the rail), with their reference
images and README rows. Rendered on lavapipe in the
fluxer-native-shots:u2204 (Ubuntu 22.04) image, like the Linux runner;
the whole suite (127 tests) passes there unchanged.

Refs #518

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The copy toast was stamped with the screen's clock, the last snapshot's
time, so in a quiet session it had expired before it was first drawn. It
now waits for the copy's own snapshot to start its 3 s (as the forum's
does), and a timer in the shell clears it when the time is over.

Also: a guild menu that opened with "Mark as read" keeps the row while it
is open (preserveInitialMarkAsReadVisibility), opening a stream menu
closes the channel/guild menu, and the disabled category "Mark as read"
test now marks Lobby read so it tests something.

Refs #518

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The open menu's "Mark as read" now stays there or away as it was when the menu
opened, for channel menus as well as guild menus and both ways
(preserveInitialMarkAsReadVisibility, ChannelMenuData.tsx:217-218,
GuildMenuData.tsx:157-158), so a read-state change under an open menu no longer
moves its rows and a Pick runs the row that was drawn.

Refs #518

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The guild's "Notification settings" modal (GuildNotificationSettingsModal.tsx),
opened by the guild and channel menus; channels and categories muted by their
own override at half opacity (ChannelItem.module.css:272); the guild tooltip's
filled BellSlash and "Muted" / "Muted until {datetime}"
(GuildListItemTooltip.tsx:216-229).

Refs #519

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The user and DM menus (Daily use 31) and the channel, category and guild menus
(Daily use 29/30) both created screens/main/menus/mod.rs: kept both, one Target
enum, one State (toast, notification settings modal, nickname modal), update with
Shift, open_model's "Mark as read" rule for the channel and guild menus.

Refs #526

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The user-limit badge reads fluxer_core::voice::user_limit, draws the limit
cell's notch and hides while its row is hovered; the voice refusal modals
("Voice channel full" and the generic error ones) and the moderation failure
modals; one call tile has no minimum size and is centred at min(w, h*16/9).

Refs #526

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The badge's notch is the limit cell's colour composited over the count cell
(an SVG tint is opaque).

Refs #526

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

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

Merged into dailyuse and textchat at 1089e6a1 (combined merge).

Merged into `dailyuse` and `textchat` at 1089e6a1 (combined merge).
charles closed this pull request 2026-11-15 09:58:43 +00:00

Pull request closed

Sign in to join this conversation.
No description provided.