Text chat 60: Entrance sound section in Settings → Voice & video; "Entrance sound" participant submenu (#389) #453

Manually merged
charles merged 0 commits from textchat-60-ui-entrance-sounds into textchat 2026-11-13 13:10:53 +00:00
Owner

What

Text chat 60: the entrance-sound section of Settings → Voice & video and the "Entrance sound" submenu of the voice participant menu.

Settings → Voice & video → "Entrance sound" (crates/fluxer-ui/src/screens/settings/voice_video/entrance.rs, EntranceSoundSection.tsx + useEntranceSound.ts):

  • entrance::model(&App, &EntranceViewState) -> EntranceSectionModel over the store's entrance_settings. The scope starts at the selected guild's scope, else global, as in the original.
  • "Applies to" shows the scope's hint, the four tiles (All communities and DMs / All communities / Direct messages / the current guild with its icon or acronym) and "Community overrides" (the other guilds, compact).
  • "Sound for this scope" lists "None" plus each sound with its duration, and sends SetEntranceSound. The resolved-sound card has a preview button, the name, the duration, a "Set here" / "Inherited" badge and "Inherited from {label}". With nothing resolved it says "No entrance sound set here".
  • "Upload new" opens the file dialog, reads the file (MP3/OGG/M4A/WAV, at most 20 MiB), runs the trimmer::ENTRANCE trimmer, then sends UploadEntranceSound { select_for: scope }. When the library is full the button is disabled and says "Library full (8 sounds max). Delete one before adding another.". Next to it: "Library: {count} of {max}".
  • Library rows have a preview button (PreviewEntranceSound), the name, the duration with " · Active here", and "Delete from library", which asks for confirmation and then sends DeleteEntranceSound.
  • After the store answers, a line says "Entrance sound saved" / "Entrance sound removed", or "Couldn't save entrance sound" / "Couldn't remove entrance sound" with the reason.
  • Without feature_voice_entrance_sounds, the section shows only "Custom entrance sounds are not enabled on this instance.".
  • settings::sync(&mut State, &App) runs on every snapshot. It sends LoadEntranceSounds once each time Voice & video opens, however it was opened.
  • settings::update_with handles the section's messages. The new settings::Outcome::{PickSoundFile, ReadSoundFile, OutlineSound, TrimSound} are run by the shell (app.rs) with the injected Dialogs / SoundFileReader. No new I/O path; nothing of a file or a path is logged (FileRequest's Debug leaves the path out).
  • soundboard::ENTRANCE_PENDING and entrance_view are removed.

Participant menu (VoiceParticipantMenuData.tsx:183-193,423-440,886):

  • For another user, right after "Mute": Entry::Submenu "Entrance sound", holding "Mute entrance sound" (SetEntranceListenerMute) and the "Entrance sound volume" slider (0–200 %, default 100, the 100 % detent; SetEntranceListenerVolume).
  • It also shows in DM calls; "Mute soundboard" stays guild-only.
  • The module doc no longer lists it as left out.

How it was tested

  • cargo test -p fluxer-ui --test settings_voice adds 12 tests: opening_the_page_loads_the_library, scope_tiles_and_community_overrides, scope_starts_at_the_current_guild, dropdown_lists_none_and_library_with_durations, choosing_a_sound_sends_set_entrance_sound, choosing_none_clears_the_scope, resolved_card_shows_set_here_or_inherited_from, empty_scope_says_no_entrance_sound_set_here, upload_new_goes_through_the_entrance_trimmer, library_full_disables_upload_with_the_message, library_rows_preview_and_delete_with_confirmation, not_enabled_instance_shows_only_the_notice.
  • --test participant_menu adds 4 tests: entrance_submenu_after_mute_for_other_users, entrance_submenu_in_dm_calls, entrance_mute_and_volume_send_their_actions, entrance_volume_default_100_max_200. The existing label lists now include "Entrance sound".
  • Screenshots: new settings_entrance_sound and participant_menu_entrance_submenu. participant_menu.png is redrawn because the new row is in it. Goldens were written with UPDATE_GOLDEN=1 on this machine's Vulkan adapter (NVIDIA; lavapipe is not installed here), so the integrator may need to redraw them on lavapipe. The rest of the suite (84 tests) passes locally against the existing goldens.
  • FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci passes locally. Two earlier runs hit the known intermittent SIGSEGV of the fluxer lib tests at process exit (#304), which is unrelated to this change.
  • The participant-menu label lists in tests/stream_menu.rs gain "Entrance sound". tests/settings_screenshare.rs's match on settings::Outcome covers the new variants.
  • No FLUXER_DESKTOP_TESTS test applies: the dialog and reader are injected, and the real runtime wiring of the reader's outline/trim is Task 61.

Deviations from the plan

  • crates/fluxer-ui/src/app.rs is outside the Files list, but the shell has to run the new settings outcomes and call settings::sync. The change is minimal and in the same crate. context_menu.rs is unchanged: a slider already fits in a submenu.
  • The original deletes a library sound without asking. The plan asks for a confirmation, so the dialog uses the title "Delete from library" and a body that is not in the original ("Delete {name} from your library? It stops playing wherever it is selected.").
  • The original's toasts and error modals are a status line under "Upload new". The client has no toast system yet.
  • The plan says "read ≤ 20 MiB", so the file is read up to 20 MiB (the soundboard's limit) and the trimmer cuts it to 1 MiB. The original refuses files over 1 MiB before trimming.
  • Community overrides follow the guild list's order, as the core selector (Task 57) returns them. The original sorts them by name.
  • The dropdown's entries read "name (duration)": iced's pick_list has no description column.
  • settings::Message and settings::State lose Eq / Copy, because the trimmer's state holds f32s.

This finishes the entrance-sound items of #142. #142 stays open for its other items.

Closes #389

🤖 Generated with Claude Code

## What Text chat 60: the entrance-sound section of Settings → Voice & video and the "Entrance sound" submenu of the voice participant menu. **Settings → Voice & video → "Entrance sound"** (`crates/fluxer-ui/src/screens/settings/voice_video/entrance.rs`, `EntranceSoundSection.tsx` + `useEntranceSound.ts`): - `entrance::model(&App, &EntranceViewState) -> EntranceSectionModel` over the store's `entrance_settings`. The scope starts at the selected guild's scope, else global, as in the original. - "Applies to" shows the scope's hint, the four tiles (All communities and DMs / All communities / Direct messages / the current guild with its icon or acronym) and "Community overrides" (the other guilds, compact). - "Sound for this scope" lists "None" plus each sound with its duration, and sends `SetEntranceSound`. The resolved-sound card has a preview button, the name, the duration, a "Set here" / "Inherited" badge and "Inherited from {label}". With nothing resolved it says "No entrance sound set here". - "Upload new" opens the file dialog, reads the file (MP3/OGG/M4A/WAV, at most 20 MiB), runs the `trimmer::ENTRANCE` trimmer, then sends `UploadEntranceSound { select_for: scope }`. When the library is full the button is disabled and says "Library full (8 sounds max). Delete one before adding another.". Next to it: "Library: {count} of {max}". - Library rows have a preview button (`PreviewEntranceSound`), the name, the duration with " · Active here", and "Delete from library", which asks for confirmation and then sends `DeleteEntranceSound`. - After the store answers, a line says "Entrance sound saved" / "Entrance sound removed", or "Couldn't save entrance sound" / "Couldn't remove entrance sound" with the reason. - Without `feature_voice_entrance_sounds`, the section shows only "Custom entrance sounds are not enabled on this instance.". - `settings::sync(&mut State, &App)` runs on every snapshot. It sends `LoadEntranceSounds` once each time Voice & video opens, however it was opened. - `settings::update_with` handles the section's messages. The new `settings::Outcome::{PickSoundFile, ReadSoundFile, OutlineSound, TrimSound}` are run by the shell (`app.rs`) with the injected `Dialogs` / `SoundFileReader`. No new I/O path; nothing of a file or a path is logged (`FileRequest`'s `Debug` leaves the path out). - `soundboard::ENTRANCE_PENDING` and `entrance_view` are removed. **Participant menu** (`VoiceParticipantMenuData.tsx:183-193,423-440,886`): - For another user, right after "Mute": `Entry::Submenu` "Entrance sound", holding "Mute entrance sound" (`SetEntranceListenerMute`) and the "Entrance sound volume" slider (0–200 %, default 100, the 100 % detent; `SetEntranceListenerVolume`). - It also shows in DM calls; "Mute soundboard" stays guild-only. - The module doc no longer lists it as left out. ## How it was tested - `cargo test -p fluxer-ui --test settings_voice` adds 12 tests: `opening_the_page_loads_the_library`, `scope_tiles_and_community_overrides`, `scope_starts_at_the_current_guild`, `dropdown_lists_none_and_library_with_durations`, `choosing_a_sound_sends_set_entrance_sound`, `choosing_none_clears_the_scope`, `resolved_card_shows_set_here_or_inherited_from`, `empty_scope_says_no_entrance_sound_set_here`, `upload_new_goes_through_the_entrance_trimmer`, `library_full_disables_upload_with_the_message`, `library_rows_preview_and_delete_with_confirmation`, `not_enabled_instance_shows_only_the_notice`. - `--test participant_menu` adds 4 tests: `entrance_submenu_after_mute_for_other_users`, `entrance_submenu_in_dm_calls`, `entrance_mute_and_volume_send_their_actions`, `entrance_volume_default_100_max_200`. The existing label lists now include "Entrance sound". - Screenshots: new `settings_entrance_sound` and `participant_menu_entrance_submenu`. `participant_menu.png` is redrawn because the new row is in it. Goldens were written with `UPDATE_GOLDEN=1` on this machine's Vulkan adapter (NVIDIA; lavapipe is not installed here), so the integrator may need to redraw them on lavapipe. The rest of the suite (84 tests) passes locally against the existing goldens. - `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` passes locally. Two earlier runs hit the known intermittent SIGSEGV of the `fluxer` lib tests at process exit (#304), which is unrelated to this change. - The participant-menu label lists in `tests/stream_menu.rs` gain "Entrance sound". `tests/settings_screenshare.rs`'s match on `settings::Outcome` covers the new variants. - No `FLUXER_DESKTOP_TESTS` test applies: the dialog and reader are injected, and the real runtime wiring of the reader's outline/trim is Task 61. ## Deviations from the plan - `crates/fluxer-ui/src/app.rs` is outside the Files list, but the shell has to run the new settings outcomes and call `settings::sync`. The change is minimal and in the same crate. `context_menu.rs` is unchanged: a slider already fits in a submenu. - The original deletes a library sound without asking. The plan asks for a confirmation, so the dialog uses the title "Delete from library" and a body that is not in the original ("Delete {name} from your library? It stops playing wherever it is selected."). - The original's toasts and error modals are a status line under "Upload new". The client has no toast system yet. - The plan says "read ≤ 20 MiB", so the file is read up to 20 MiB (the soundboard's limit) and the trimmer cuts it to 1 MiB. The original refuses files over 1 MiB before trimming. - Community overrides follow the guild list's order, as the core selector (Task 57) returns them. The original sorts them by name. - The dropdown's entries read "name (duration)": iced's `pick_list` has no description column. - `settings::Message` and `settings::State` lose `Eq` / `Copy`, because the trimmer's state holds `f32`s. This finishes the entrance-sound items of #142. #142 stays open for its other items. Closes #389 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Settings → Voice & video → "Entrance sound" (EntranceSoundSection.tsx,
useEntranceSound.ts): scope tiles and community overrides, the
"Sound for this scope" dropdown, the resolved card (Set here /
Inherited from), "Upload new" through the file dialog, the reader and
the entrance trimmer, the library with preview and a confirmed
"Delete from library", the saved / removed / couldn't lines and the
"not enabled on this instance" notice. The library is loaded once each
time the page opens (settings::sync).

The voice participant menu gains the "Entrance sound" submenu after
"Mute" (VoiceParticipantMenuData.tsx:423-440,886): "Mute entrance
sound" and the 0-200 % volume slider, in DM calls too.

Refs #389

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

Independent review: Text chat 60 (ui-entrance-sounds)

Reviewed git diff 9cf9a68..origin/textchat-60-ui-entrance-sounds (deb73db) cold.

Tests (plan Step 1): all 16 named tests exist (12 in tests/settings_voice.rs::entrance_section, 4 in tests/participant_menu.rs), plus the screenshots settings_entrance_sound_matches_golden and participant_menu_entrance_submenu_matches_golden. They assert the spec's strings verbatim (checked against EntranceSoundSection.tsx and VoiceParticipantMenuData.tsx:183-193,423-440,886): the tiles and descriptions, the scope hints, "None" + "Door (1.3s)", "Set here" / "Inherited from All communities and DMs", "Library: 2 of 8", "Library full (8 sounds max). Delete one before adding another.", the 20 MiB read limit, trimmer::ENTRANCE → UploadEntranceSound { select_for: scope }, the four toast texts, the not-enabled notice only, the submenu right after "Mute" and in DM calls, and volume 0–200 % with 100 as the default.

Interfaces: entrance::model(app, &EntranceViewState) -> EntranceSectionModel exists as written. Scope starts at the current guild, else global. It uses Task 57's entrance_settings/entrance_listeners/entrance UserActions and Task 59's trimmer/confirm/SoundFileReader::{outline, trim}. The new settings::Outcome variants are run in app.rs through the injected dialogs/files via Task::perform.

Invariants: the diff does not touch fluxer-core, so it adds no core dependency and no file bytes in core. fluxer-ui adds no new I/O path. FileRequest, PickedFile and Outcome Debug output leaves out paths and bytes. Every new Message/Outcome variant is reachable without panics on server data (no indexing or unwraps in non-test code). The test helper's limits rule has the same shape as well_known.json's rules[].

Findings

  • minor: the goldens were rendered on the implementer's NVIDIA adapter. They pass locally on this machine, but the integrator should confirm participant_menu, participant_menu_entrance_submenu and settings_entrance_sound on the lavapipe Linux runner (re-render there if they drift).
  • minor: the delete confirmation's body ("Delete {name} from your library? It stops playing wherever it is selected.") is new text, not in the original, which deletes without asking. The plan asks for the confirmation, so this is acceptable. Charles may want to word it.
  • minor: FileError::Io(message) is shown verbatim in the status line. It goes to the UI only, never to logs. Task 61's reader should make sure that message does not embed the file path.

Local gate: FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci in a fresh review worktree: all steps passed (exit 0). Both new screenshot tests and participant_menu passed. No #304 SIGSEGV on this run.

Verdict: approve (no blocking findings, ci green locally).

## Independent review: Text chat 60 (ui-entrance-sounds) Reviewed `git diff 9cf9a68..origin/textchat-60-ui-entrance-sounds` (deb73db) cold. **Tests (plan Step 1):** all 16 named tests exist (12 in `tests/settings_voice.rs::entrance_section`, 4 in `tests/participant_menu.rs`), plus the screenshots `settings_entrance_sound_matches_golden` and `participant_menu_entrance_submenu_matches_golden`. They assert the spec's strings verbatim (checked against `EntranceSoundSection.tsx` and `VoiceParticipantMenuData.tsx:183-193,423-440,886`): the tiles and descriptions, the scope hints, "None" + "Door (1.3s)", "Set here" / "Inherited from All communities and DMs", "Library: 2 of 8", "Library full (8 sounds max). Delete one before adding another.", the 20 MiB read limit, `trimmer::ENTRANCE` → `UploadEntranceSound { select_for: scope }`, the four toast texts, the not-enabled notice only, the submenu right after "Mute" and in DM calls, and volume 0–200 % with 100 as the default. **Interfaces:** `entrance::model(app, &EntranceViewState) -> EntranceSectionModel` exists as written. Scope starts at the current guild, else global. It uses Task 57's `entrance_settings`/`entrance_listeners`/entrance `UserAction`s and Task 59's `trimmer`/`confirm`/`SoundFileReader::{outline, trim}`. The new `settings::Outcome` variants are run in `app.rs` through the injected `dialogs`/`files` via `Task::perform`. **Invariants:** the diff does not touch fluxer-core, so it adds no core dependency and no file bytes in core. fluxer-ui adds no new I/O path. `FileRequest`, `PickedFile` and `Outcome` Debug output leaves out paths and bytes. Every new `Message`/`Outcome` variant is reachable without panics on server data (no indexing or unwraps in non-test code). The test helper's limits rule has the same shape as `well_known.json`'s `rules[]`. **Findings** - minor: the goldens were rendered on the implementer's NVIDIA adapter. They pass locally on this machine, but the integrator should confirm `participant_menu`, `participant_menu_entrance_submenu` and `settings_entrance_sound` on the lavapipe Linux runner (re-render there if they drift). - minor: the delete confirmation's body ("Delete {name} from your library? It stops playing wherever it is selected.") is new text, not in the original, which deletes without asking. The plan asks for the confirmation, so this is acceptable. Charles may want to word it. - minor: `FileError::Io(message)` is shown verbatim in the status line. It goes to the UI only, never to logs. Task 61's reader should make sure that message does not embed the file path. **Local gate:** `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` in a fresh review worktree: all steps passed (exit 0). Both new screenshot tests and `participant_menu` passed. No #304 SIGSEGV on this run. **Verdict: approve** (no blocking findings, ci green locally).
charles manually merged commit 851af027ea into textchat 2026-11-13 13:10:53 +00:00
Sign in to join this conversation.
No description provided.