Voice 19: Soundboard popout (#80) #137

Manually merged
charles merged 0 commits from voice-19-ui-soundboard into voice 2026-11-11 23:43:31 +00:00
Owner

Closes #80

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

The soundboard popout over the call view (Voice plan, Task 19): search, favourites, a section per guild with three sounds per row, star toggle, the original's notices when no sound can be played (permission, speak, muted, deafened, cooldown), loading/error/empty placeholders, a sound's context menu (star, rename and delete when permitted) and the upload dialog (path typed or dropped onto the window, name, volume, emoji) that emits UploadSound.

The sound file is read outside fluxer-ui: the shell hands the path to an injected files::SoundFileReader, implemented by fluxer_platform::files::SoundFiles and passed in by apps/fluxer (so this PR also touches fluxer-platform and apps/fluxer).

Tests: crates/fluxer-ui/tests/soundboard.rs (three_per_row, search_filters_across_guilds, favourite_toggle_emits, cooldown_disables_buttons, no_permission_shows_reason, upload, stale reads, Escape), crates/fluxer-platform/tests/files.rs; screenshot soundboard_popout.

Known deviations (tracked as follow-ups, linked in the review reply): the cooldown shows its whole length rather than a live countdown (#109, the store has no clock); delete has no confirmation; rename and delete only for the call's guild; preview button, guild icons and custom emoji are left out.

🤖 Generated with Claude Code

Closes #80 Stacked on: voice-18-ui-call-view The soundboard popout over the call view (Voice plan, Task 19): search, favourites, a section per guild with three sounds per row, star toggle, the original's notices when no sound can be played (permission, speak, muted, deafened, cooldown), loading/error/empty placeholders, a sound's context menu (star, rename and delete when permitted) and the upload dialog (path typed or dropped onto the window, name, volume, emoji) that emits `UploadSound`. The sound file is read outside `fluxer-ui`: the shell hands the path to an injected `files::SoundFileReader`, implemented by `fluxer_platform::files::SoundFiles` and passed in by `apps/fluxer` (so this PR also touches `fluxer-platform` and `apps/fluxer`). Tests: `crates/fluxer-ui/tests/soundboard.rs` (`three_per_row`, `search_filters_across_guilds`, `favourite_toggle_emits`, `cooldown_disables_buttons`, `no_permission_shows_reason`, upload, stale reads, Escape), `crates/fluxer-platform/tests/files.rs`; screenshot `soundboard_popout`. Known deviations (tracked as follow-ups, linked in the review reply): the cooldown shows its whole length rather than a live countdown (#109, the store has no clock); delete has no confirmation; rename and delete only for the call's guild; preview button, guild icons and custom emoji are left out. 🤖 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 #80

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The control bar's soundboard button opens a popout over the call: search,
favourites, a section per guild with three sounds per row, stars, the
original's notices (permission, speak, muted, deafened, cooldown), a
right-click menu with rename and delete when permitted, and an upload
dialog (path typed or dropped; the shell reads the file).

Refs #80

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fix: read picked sound files through an injected reader
Some checks failed
ci / Linux (x86_64) (push) Has been cancelled
ci / Windows (x64) (push) Has been cancelled
cfba6fef85
fluxer-ui no longer opens files: the shell hands the path the upload
dialog asks for to an injected files::SoundFileReader, implemented by
fluxer_platform::files::SoundFiles on the runtime's blocking pool (size
checked before reading, read capped one byte past the limit) and passed
in by apps/fluxer, like ImageLoader.

A file read answers only the opening of the dialog that asked for it
(FileRequest::answer), so a late read after Cancel and reopen is ignored.
Escape closes the upload dialog, then the sound menu, then the popout.

Refs #80

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fix: add the soundboard_popout golden, drawn on lavapipe
All checks were successful
ci / Windows (x64) (push) Successful in 12m49s
ci / Linux (x86_64) (push) Successful in 22m30s
443a3f1c27
Rendered in the ubuntu:22.04 CI image with WGPU_BACKEND=vulkan and the
lavapipe ICD; all nine screenshot tests (call_view_* included) pass there.

Refs #80

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

Review round 1, what changed per finding (commits cfba6fe, 443a3f1):

Blocking

  1. read_sound_file I/O in fluxer-ui (app.rs): fluxer-ui no longer touches the file system. New trait fluxer_ui::files::SoundFileReader (read(path, max_bytes) -> BoxFuture<Result<SoundBytes, FileError>>), implemented by fluxer_platform::files::SoundFiles, injected by apps/fluxer through fluxer_ui::run(snapshot, events, files), the same pattern as ImageLoader. The shell only runs its future in Task::perform. The README exception text is gone; the fluxer-ui README now lists both injected loaders and keeps "do not add another". This PR therefore also touches fluxer-platform and apps/fluxer (one line plus the constructor). Tests: crates/fluxer-platform/tests/files.rs (read from a non-tokio executor, size limit including exact boundary, missing file is an error).
  2. Missing golden: fixtures/golden/soundboard_popout.png committed, rendered on lavapipe in the ubuntu:22.04 CI image. cargo test -p fluxer-ui --test screenshots -- --ignored passes all 9 there, call_view_4 and call_view_compact included.
  3. Branch not pushed: pushed, this is the PR.

Minor

  • Late FileRead going to a reopened dialog (upload.rs): fixed. Each opening of the dialog gets an id; take_file_request returns an upload::FileRequest and the shell answers with FileRequest::answer; a result for another opening, or when nothing is being read, is ignored. Test a_late_file_read_does_not_reach_a_reopened_dialog (written first).
  • Blocking std::fs on the executor and metadata-then-read TOCTOU (app.rs): gone with the move. SoundFiles reads on the tokio blocking pool, checks the size on the open handle, and caps the read at max_bytes + 1.
  • Cooldown shows the whole length (picker.rs): follow-up #138 (needs the clock of #109).
  • Escape closes the whole popout: fixed. Escape now closes the upload dialog, then the sound menu, then the popout (State::escape, test escape_closes_the_innermost_layer_first). The other deviations are follow-ups: delete confirmation #139, rename/delete for other guilds #140, preview button / guild icons / custom emoji #141 (with a note that emoji currently render as empty boxes because the bundled fonts have no emoji glyphs).

cargo xtask ci is green locally (the screenshot step ran separately in the CI image, as above).

Review round 1, what changed per finding (commits cfba6fe, 443a3f1): **Blocking** 1. `read_sound_file` I/O in fluxer-ui (app.rs): fluxer-ui no longer touches the file system. New trait `fluxer_ui::files::SoundFileReader` (`read(path, max_bytes) -> BoxFuture<Result<SoundBytes, FileError>>`), implemented by `fluxer_platform::files::SoundFiles`, injected by `apps/fluxer` through `fluxer_ui::run(snapshot, events, files)`, the same pattern as `ImageLoader`. The shell only runs its future in `Task::perform`. The README exception text is gone; the fluxer-ui README now lists both injected loaders and keeps "do not add another". This PR therefore also touches `fluxer-platform` and `apps/fluxer` (one line plus the constructor). Tests: `crates/fluxer-platform/tests/files.rs` (read from a non-tokio executor, size limit including exact boundary, missing file is an error). 2. Missing golden: `fixtures/golden/soundboard_popout.png` committed, rendered on lavapipe in the ubuntu:22.04 CI image. `cargo test -p fluxer-ui --test screenshots -- --ignored` passes all 9 there, `call_view_4` and `call_view_compact` included. 3. Branch not pushed: pushed, this is the PR. **Minor** - Late FileRead going to a reopened dialog (upload.rs): fixed. Each opening of the dialog gets an id; `take_file_request` returns an `upload::FileRequest` and the shell answers with `FileRequest::answer`; a result for another opening, or when nothing is being read, is ignored. Test `a_late_file_read_does_not_reach_a_reopened_dialog` (written first). - Blocking std::fs on the executor and metadata-then-read TOCTOU (app.rs): gone with the move. `SoundFiles` reads on the tokio blocking pool, checks the size on the open handle, and caps the read at `max_bytes + 1`. - Cooldown shows the whole length (picker.rs): follow-up #138 (needs the clock of #109). - Escape closes the whole popout: fixed. Escape now closes the upload dialog, then the sound menu, then the popout (`State::escape`, test `escape_closes_the_innermost_layer_first`). The other deviations are follow-ups: delete confirmation #139, rename/delete for other guilds #140, preview button / guild icons / custom emoji #141 (with a note that emoji currently render as empty boxes because the bundled fonts have no emoji glyphs). `cargo xtask ci` is green locally (the screenshot step ran separately in the CI image, as above).
Author
Owner

Independent review (round 2) of Voice 19, head 443a3f1

Scope: git diff a7ec434..origin/voice-19-ui-soundboard.

Plan tests: three_per_row, search_filters_across_guilds, favourite_toggle_emits, cooldown_disables_buttons and no_permission_shows_reason all exist in crates/fluxer-ui/tests/soundboard.rs and assert what the plan describes. picker::COLUMNS == 3, and the drawn layout is checked by click-scan. The notice strings match the fork's SoundboardPicker.tsx word for word. The cooldown seconds use div_ceil(1000).max(1), which matches the fork's Math.max(1, Math.ceil(ms/1000)). The soundboard_popout screenshot test and its golden image (1280x720) are committed.

Interfaces: Task 19 creates no names that other tasks consume. It uses the Voice 10 UserActions and soundboard_picker as they were merged. fluxer_ui::run gains a third argument, files: Arc<dyn SoundFileReader>. Its only caller is apps/fluxer/src/main.rs, which is updated.

Invariants: fluxer-ui does no file I/O (I grepped for std::fs, File:: and tokio::fs outside testing). File reads go through the injected files::SoundFileReader, which fluxer_platform::files::SoundFiles implements on the blocking pool. It checks the size before reading and caps the read at the limit plus one byte. There are no panics on server data: no indexing or unwrap in the picker, and a missing sound simply produces no menu. No tokens or secrets were added. Commits carry Refs #80.

Review Focus: no item in the list belongs to Voice 19.

Local gate: cargo xtask ci is green (fmt, clippy, deny, tests). The screenshot step was skipped here because there is no lavapipe, so the golden image still depends on the Linux runner.

Findings

  • minor: The branch also touches fluxer-platform and apps/fluxer, while the plan's Files list names only fluxer-ui. CLAUDE.md wants a two-crate task serialised and stated in the plan. This is a reasonable answer to the round-1 no-I/O finding, but Charles should confirm the second injected loader and the README wording ("Do not add another"). Tasks 20-22 change app.rs and main.rs in parallel, so expect merge conflicts.
  • minor: local.soundboard.open is not reset when the user leaves voice or selects another channel. The popout reappears the next time a call view is shown.
  • minor: upload::model shows "Sound uploaded." as soon as submitted is set while the store's upload state is still Idle. That happens in the frame before the store's snapshot reflects the UploadSound, so the message can flash briefly before "Uploading...".
  • minor (already tracked): Emoji show as empty boxes in the golden image because the bundled fonts have no emoji glyphs (#141). The cooldown shows its full length rather than counting down (#138, #109).

No blocking findings.

Verdict: APPROVED. Local CI is green. The integrator still needs to confirm the remote Linux screenshot run.

## Independent review (round 2) of Voice 19, head 443a3f1 Scope: `git diff a7ec434..origin/voice-19-ui-soundboard`. **Plan tests**: `three_per_row`, `search_filters_across_guilds`, `favourite_toggle_emits`, `cooldown_disables_buttons` and `no_permission_shows_reason` all exist in `crates/fluxer-ui/tests/soundboard.rs` and assert what the plan describes. `picker::COLUMNS == 3`, and the drawn layout is checked by click-scan. The notice strings match the fork's `SoundboardPicker.tsx` word for word. The cooldown seconds use `div_ceil(1000).max(1)`, which matches the fork's `Math.max(1, Math.ceil(ms/1000))`. The `soundboard_popout` screenshot test and its golden image (1280x720) are committed. **Interfaces**: Task 19 creates no names that other tasks consume. It uses the Voice 10 `UserAction`s and `soundboard_picker` as they were merged. `fluxer_ui::run` gains a third argument, `files: Arc<dyn SoundFileReader>`. Its only caller is `apps/fluxer/src/main.rs`, which is updated. **Invariants**: `fluxer-ui` does no file I/O (I grepped for `std::fs`, `File::` and `tokio::fs` outside `testing`). File reads go through the injected `files::SoundFileReader`, which `fluxer_platform::files::SoundFiles` implements on the blocking pool. It checks the size before reading and caps the read at the limit plus one byte. There are no panics on server data: no indexing or unwrap in the picker, and a missing sound simply produces no menu. No tokens or secrets were added. Commits carry `Refs #80`. **Review Focus**: no item in the list belongs to Voice 19. **Local gate**: `cargo xtask ci` is green (fmt, clippy, deny, tests). The screenshot step was skipped here because there is no lavapipe, so the golden image still depends on the Linux runner. ### Findings - **minor**: The branch also touches `fluxer-platform` and `apps/fluxer`, while the plan's Files list names only `fluxer-ui`. CLAUDE.md wants a two-crate task serialised and stated in the plan. This is a reasonable answer to the round-1 no-I/O finding, but Charles should confirm the second injected loader and the README wording ("Do not add another"). Tasks 20-22 change `app.rs` and `main.rs` in parallel, so expect merge conflicts. - **minor**: `local.soundboard.open` is not reset when the user leaves voice or selects another channel. The popout reappears the next time a call view is shown. - **minor**: `upload::model` shows "Sound uploaded." as soon as `submitted` is set while the store's upload state is still `Idle`. That happens in the frame before the store's snapshot reflects the `UploadSound`, so the message can flash briefly before "Uploading...". - **minor (already tracked)**: Emoji show as empty boxes in the golden image because the bundled fonts have no emoji glyphs (#141). The cooldown shows its full length rather than counting down (#138, #109). No blocking findings. **Verdict: APPROVED.** Local CI is green. The integrator still needs to confirm the remote Linux screenshot run.
charles manually merged commit 09de2137ea into voice 2026-11-11 23:43:31 +00:00
Sign in to join this conversation.
No description provided.