Text chat 61: apps/fluxer and devserver: soundboard and entrance-sound runtime, parity (#390) #438

Manually merged
charles merged 6 commits from textchat-61-app-soundboard-entrance-runtime into textchat 2026-11-13 13:10:47 +00:00
Owner

Closes #390
Refs #92 (favourites synced through user settings, with Text chat 14).

What changed

  • Devserver (fluxer-devserver): POST /users/@me/entrance-sounds (201; the ninth is 400 ENTRANCE_SOUND_QUOTA_REACHED), PATCH/DELETE /users/@me/entrance-sounds/{id} (delete clears selections), PUT /users/@me/entrance-sound-selections (204, scope checked), feature_voice_entrance_sounds on in limits; soundboard fixtures with a custom emoji (trumpet in voice_ready.json), a creator and a second guild; scenario steps relay-joins / relay-entrance.
  • Runtime (apps/fluxer): new sound_edit_rt::AppSoundFiles (reads through SoundFiles, outlines with 300 peaks and trims with fluxer_audio::edit on the blocking pool; nothing of a file or path is logged), injected into fluxer_ui::run in place of SoundFiles. AudioCommand::StopClip now calls AudioEngine::stop_clip. The entrance library ApiRequests were already wired by the merged base.
  • Tests: devserver entrance_upload_rename_delete_and_select, entrance_quota_is_eight, entrance_delete_clears_selections, selection_scope_is_validated; runtime preview_sound_reaches_the_mixer, local_preview_plays_bytes_and_stops, outline_and_trim_answer_through_the_reader, entrance_upload_select_and_join_announces_it, muted_entrance_user_plays_nothing, edit_sound_round_trip_through_gateway_update, soundboard_favourite_star_syncs_through_user_settings. fluxer-proto/tests/expressions.rs now expects the voice fixture's one emoji.
  • Parity: soundboard picker and upload rows updated. The entrance picker row and section-voice_video-entrance-sound stay later/planned: the settings section that chooses a sound is Text chat 60, which is not on textchat yet; the notes say the runtime side is done.

Local FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci: all steps passed (one earlier run hit the known exit-time SIGSEGV of the app lib tests, #304, after all 65 passed).

Steps for Charles on the desktop

  1. Soundboard popout: preview a sound, upload one with the trimmer, edit its name/volume/emoji, delete it (confirmation).
  2. Spam sounds until the cooldown countdown shows.
  3. Settings → Voice & video → Entrance sound (once Text chat 60 lands): pick, upload with trim, preview.
  4. Join a voice channel with an entrance sound; a second client hears it. On the second client, mute / change the volume of your entrance sound from the participant menu.
  5. Star a sound; check the favourite shows in the Electron app too, and that starring there updates the native client.

🤖 Generated with Claude Code

Closes #390 Refs #92 (favourites synced through user settings, with Text chat 14). ## What changed - **Devserver** (`fluxer-devserver`): `POST /users/@me/entrance-sounds` (201; the ninth is 400 `ENTRANCE_SOUND_QUOTA_REACHED`), `PATCH`/`DELETE /users/@me/entrance-sounds/{id}` (delete clears selections), `PUT /users/@me/entrance-sound-selections` (204, scope checked), `feature_voice_entrance_sounds` on in `limits`; soundboard fixtures with a custom emoji (`trumpet` in `voice_ready.json`), a creator and a second guild; scenario steps `relay-joins` / `relay-entrance`. - **Runtime** (`apps/fluxer`): new `sound_edit_rt::AppSoundFiles` (reads through `SoundFiles`, outlines with 300 peaks and trims with `fluxer_audio::edit` on the blocking pool; nothing of a file or path is logged), injected into `fluxer_ui::run` in place of `SoundFiles`. `AudioCommand::StopClip` now calls `AudioEngine::stop_clip`. The entrance library `ApiRequest`s were already wired by the merged base. - **Tests**: devserver `entrance_upload_rename_delete_and_select`, `entrance_quota_is_eight`, `entrance_delete_clears_selections`, `selection_scope_is_validated`; runtime `preview_sound_reaches_the_mixer`, `local_preview_plays_bytes_and_stops`, `outline_and_trim_answer_through_the_reader`, `entrance_upload_select_and_join_announces_it`, `muted_entrance_user_plays_nothing`, `edit_sound_round_trip_through_gateway_update`, `soundboard_favourite_star_syncs_through_user_settings`. `fluxer-proto/tests/expressions.rs` now expects the voice fixture's one emoji. - **Parity**: soundboard picker and upload rows updated. The entrance picker row and `section-voice_video-entrance-sound` stay `later`/`planned`: the settings section that chooses a sound is Text chat 60, which is not on `textchat` yet; the notes say the runtime side is done. Local `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci`: all steps passed (one earlier run hit the known exit-time SIGSEGV of the app lib tests, #304, after all 65 passed). ## Steps for Charles on the desktop 1. Soundboard popout: preview a sound, upload one with the trimmer, edit its name/volume/emoji, delete it (confirmation). 2. Spam sounds until the cooldown countdown shows. 3. Settings → Voice & video → Entrance sound (once Text chat 60 lands): pick, upload with trim, preview. 4. Join a voice channel with an entrance sound; a second client hears it. On the second client, mute / change the volume of your entrance sound from the participant menu. 5. Star a sound; check the favourite shows in the Electron app too, and that starring there updates the native client. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Devserver: POST/PATCH/DELETE /users/@me/entrance-sounds (quota 8, delete clears
selections), PUT /users/@me/entrance-sound-selections (scope checked), the
feature_voice_entrance_sounds limit, soundboard fixtures with a custom emoji,
a creator and a second guild.

Runtime: sound_edit_rt::AppSoundFiles reads through SoundFiles and outlines
(300 peaks) and trims with fluxer_audio::edit on the blocking pool; injected
into the window in place of SoundFiles. AudioCommand::StopClip now calls
AudioEngine::stop_clip. Runtime tests cover preview, local preview and stop,
outline/trim, entrance upload/select/join, muted entrance users, sound edits
and synced favourites (#92).

Parity: soundboard rows updated; the entrance picker stays planned until the
settings section (Text chat 60) lands.

Refs #390

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

Review round 2, per finding:

  • blocking: branch missing, nothing to review: the work in the worktree is now committed (db944d0, Refs #390) together with what it was missing (apps/fluxer/src/sound_edit_rt.rs, the AppSoundFiles injection in main.rs, StopClip -> AudioEngine::stop_clip, READMEs, parity notes, a race fix in preview_sound_reaches_the_mixer and the proto fixture assertion for the new emoji), merged with origin/textchat (37000d2), run through FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci (all steps passed) and pushed; this PR is the diff against textchat.

Note: the entrance-picker parity rows stay later/planned because the settings section (Text chat 60) is not on textchat yet.

Review round 2, per finding: - **blocking: branch missing, nothing to review**: the work in the worktree is now committed (db944d0, Refs #390) together with what it was missing (apps/fluxer/src/sound_edit_rt.rs, the AppSoundFiles injection in main.rs, StopClip -> AudioEngine::stop_clip, READMEs, parity notes, a race fix in preview_sound_reaches_the_mixer and the proto fixture assertion for the new emoji), merged with origin/textchat (37000d2), run through FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci (all steps passed) and pushed; this PR is the diff against textchat. Note: the entrance-picker parity rows stay later/planned because the settings section (Text chat 60) is not on textchat yet.
Author
Owner

Independent review: Text chat 61 (app-soundboard-entrance-runtime)

Reviewed git diff origin/textchat...origin/textchat-61-app-soundboard-entrance-runtime at 37000d2.

What checks out

  • All 11 tests the plan names exist. Devserver: entrance_upload_rename_delete_and_select, entrance_quota_is_eight (400, ENTRANCE_SOUND_QUOTA_REACHED, 8 sounds), entrance_delete_clears_selections, selection_scope_is_validated. Runtime: preview_sound_reaches_the_mixer, local_preview_plays_bytes_and_stops, outline_and_trim_answer_through_the_reader (300 buckets), entrance_upload_select_and_join_announces_it, muted_entrance_user_plays_nothing, edit_sound_round_trip_through_gateway_update, soundboard_favourite_star_syncs_through_user_settings. Each one asserts what the plan describes.
  • Interfaces: the four entrance ApiRequests are executed in runtime.rs (already on the base). PlayClipBytes calls play_clip with the bytes. StopClip now calls AudioEngine::stop_clip. sound_edit_rt::AppSoundFiles wraps SoundFiles, implements outline/trim with fluxer_audio::edit on the blocking pool (OUTLINE_BUCKETS = 300) and is injected in main.rs.
  • Devserver routes and status codes match EntranceSoundController.ts (201/200/204/204). The checks and error codes match EntranceSoundService.ts in the server's order. delete clears selections and returns 204 for an unknown sound.
  • The voice_ready.json emoji matches GuildEmojiResponse (id, name, animated, nsfw).
  • No changes to fluxer-core, fluxer-ui or fluxer-emoji. Nothing logs a file, path or URL. Error strings carry no path.

Findings

  1. minor: the commit message of db944d0 does not name the server file and line the fixtures were shaped from. The Global Constraints require this, and the Interfaces block asks for EntranceSoundController.ts / EntranceSoundService.ts. The code comments name them, so please add the reference to the PR body (no history rewrite needed).
  2. minor: on the real server, scope_id is rejected first by the zod ScopeIdSchema regex (packages/schema/src/domains/user/EntranceSoundSchemas.ts:13), so the ENTRANCE_SOUND_INVALID_SCOPE service code is never reached. The devserver answers with ENTRANCE_SOUND_INVALID_SCOPE instead. The status (400) matches. The client should not depend on the code.
  3. minor: docs/parity/settings.toml section-voice_video-entrance-sound stays planned instead of done as the plan says. This is justified because Text chat 60 is not on textchat yet. Flip it when 60 lands; a follow-up issue would track that.

Local CI: NOT CONFIRMED. FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci was started in the review worktree but was stopped while still in the clippy step, before it reached the tests, because the review had to return. The integrator must confirm CI is green.

Verdict: no blocking findings in the code. Not approved yet because the reviewer's local CI run did not finish.

## Independent review: Text chat 61 (app-soundboard-entrance-runtime) Reviewed `git diff origin/textchat...origin/textchat-61-app-soundboard-entrance-runtime` at 37000d2. **What checks out** - All 11 tests the plan names exist. Devserver: `entrance_upload_rename_delete_and_select`, `entrance_quota_is_eight` (400, `ENTRANCE_SOUND_QUOTA_REACHED`, 8 sounds), `entrance_delete_clears_selections`, `selection_scope_is_validated`. Runtime: `preview_sound_reaches_the_mixer`, `local_preview_plays_bytes_and_stops`, `outline_and_trim_answer_through_the_reader` (300 buckets), `entrance_upload_select_and_join_announces_it`, `muted_entrance_user_plays_nothing`, `edit_sound_round_trip_through_gateway_update`, `soundboard_favourite_star_syncs_through_user_settings`. Each one asserts what the plan describes. - Interfaces: the four entrance `ApiRequest`s are executed in `runtime.rs` (already on the base). `PlayClipBytes` calls `play_clip` with the bytes. `StopClip` now calls `AudioEngine::stop_clip`. `sound_edit_rt::AppSoundFiles` wraps `SoundFiles`, implements `outline`/`trim` with `fluxer_audio::edit` on the blocking pool (`OUTLINE_BUCKETS = 300`) and is injected in `main.rs`. - Devserver routes and status codes match `EntranceSoundController.ts` (201/200/204/204). The checks and error codes match `EntranceSoundService.ts` in the server's order. `delete` clears selections and returns 204 for an unknown sound. - The `voice_ready.json` emoji matches `GuildEmojiResponse` (`id`, `name`, `animated`, `nsfw`). - No changes to fluxer-core, fluxer-ui or fluxer-emoji. Nothing logs a file, path or URL. Error strings carry no path. **Findings** 1. minor: the commit message of db944d0 does not name the server file and line the fixtures were shaped from. The Global Constraints require this, and the Interfaces block asks for `EntranceSoundController.ts` / `EntranceSoundService.ts`. The code comments name them, so please add the reference to the PR body (no history rewrite needed). 2. minor: on the real server, `scope_id` is rejected first by the zod `ScopeIdSchema` regex (`packages/schema/src/domains/user/EntranceSoundSchemas.ts:13`), so the `ENTRANCE_SOUND_INVALID_SCOPE` service code is never reached. The devserver answers with `ENTRANCE_SOUND_INVALID_SCOPE` instead. The status (400) matches. The client should not depend on the code. 3. minor: `docs/parity/settings.toml` `section-voice_video-entrance-sound` stays `planned` instead of `done` as the plan says. This is justified because Text chat 60 is not on textchat yet. Flip it when 60 lands; a follow-up issue would track that. **Local CI:** NOT CONFIRMED. `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` was started in the review worktree but was stopped while still in the clippy step, before it reached the tests, because the review had to return. The integrator must confirm CI is green. **Verdict:** no blocking findings in the code. Not approved yet because the reviewer's local CI run did not finish.
charles changed title from Task 61: apps/fluxer and devserver: soundboard and entrance-sound runtime, parity (#390) to Text chat 61: apps/fluxer and devserver: soundboard and entrance-sound runtime, parity (#390) 2026-11-13 11:09:25 +00:00
Author
Owner

Independent review: Text chat 61 (head eba515e, diff 9cf9a68..eba515e)

Checked

  1. Tests: all 11 named tests exist. Devserver (crates/fluxer-devserver/tests/voice.rs): upload/rename/delete/select, quota of 8 (exact message "You've reached the limit of 8 saved entrance sounds."), delete clears only that sound's selections, and the scope pattern (accepts global|guilds|dms|guild:\d{1,20}, rejects the rest with ENTRANCE_SOUND_INVALID_SCOPE, also on clear). Runtime (apps/fluxer/tests/voice_runtime.rs): preview reaches the mixer, local bytes preview plus StopClip, outline (300 peaks) and trim (mono, 100 ms), entrance upload, select and join (ENTRANCE_SOUND_PLAY carries the new sound's URL), muted entrance user (not even fetched; unmuted control plays), edit round trip through GUILD_SOUNDBOARD_SOUND_UPDATE, and favourites: two stars become one debounced write, no second write, and another session's write replaces the list (#92).
  2. Interfaces: PlayClipBytes calls play_clip(&key, Some(bytes), gain, tag.0). StopClip calls AudioEngine::stop_clip(tag.0). sound_edit_rt::AppSoundFiles reads through SoundFiles, and runs outline / trim through fluxer_audio::edit on the blocking pool. It is created inside runtime.enter(), so it works when iced polls the futures, and it is injected into fluxer_ui::run. The four entrance ApiRequests were already wired on the base (runtime.rs:1123-1148).
  3. Invariants: nothing changed in fluxer-core, fluxer-ui, fluxer-emoji or any Cargo manifest.
    • sound_edit_rt logs nothing. Its errors are FileError::Unsupported or a JoinError string, with no path in either.
    • The upload body (base64 audio) goes through unobserved(), so --record never sees it.
    • The devserver endpoints follow EntranceSoundService.ts (check order name → quota → base64 → size → format → duration; normalizeName trim and 1..32; error codes and paths) and EntranceSoundController.ts (201 and 204, the serializeSound fields).
    • The new READY emoji follows GuildEmojiResponse (id, name, animated, nsfw).
    • The limits override follows the LimitConfigService rules/overrides wire format.
    • Server data cannot cause a panic: the WAV parser uses get/checked_add, and ids are parsed with a 400 on failure.
  4. Review Focus 3 (synced preferences, debounced): covered by soundboard_favourite_star_syncs_through_user_settings.
  5. Local CI: FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci in a clean review worktree passed: all steps green, livekit-interop skipped as usual.

Findings

  • minor: the fixture commit db944d0 does not name the server file and line its fixtures were copied from, which the Global Constraints require. The code comments do name EntranceSoundService / EntranceSoundConstants.ts, and I checked the shapes against the server source, so this is a process gap only.
  • minor (deviation, accepted): section-voice_video-entrance-sound stays planned with a note, and the plan said done. That is correct while Text chat 60 is not merged. Whoever lands 60 must set it to done and remove the note.
  • minor (nit): a comment in fixtures/scenarios/voice.toml says entrance scopes are "global" or "guild:<id>", but the fixture now also uses "dms".

Verdict: approved. No blocking findings and local CI is green. I did not check the remote runners.

## Independent review: Text chat 61 (head `eba515e`, diff `9cf9a68..eba515e`) **Checked** 1. **Tests:** all 11 named tests exist. Devserver (`crates/fluxer-devserver/tests/voice.rs`): upload/rename/delete/select, quota of 8 (exact message "You've reached the limit of 8 saved entrance sounds."), delete clears only that sound's selections, and the scope pattern (accepts `global|guilds|dms|guild:\d{1,20}`, rejects the rest with `ENTRANCE_SOUND_INVALID_SCOPE`, also on clear). Runtime (`apps/fluxer/tests/voice_runtime.rs`): preview reaches the mixer, local bytes preview plus `StopClip`, outline (300 peaks) and trim (mono, 100 ms), entrance upload, select and join (`ENTRANCE_SOUND_PLAY` carries the new sound's URL), muted entrance user (not even fetched; unmuted control plays), edit round trip through `GUILD_SOUNDBOARD_SOUND_UPDATE`, and favourites: two stars become one debounced write, no second write, and another session's write replaces the list (#92). 2. **Interfaces:** `PlayClipBytes` calls `play_clip(&key, Some(bytes), gain, tag.0)`. `StopClip` calls `AudioEngine::stop_clip(tag.0)`. `sound_edit_rt::AppSoundFiles` reads through `SoundFiles`, and runs `outline` / `trim` through `fluxer_audio::edit` on the blocking pool. It is created inside `runtime.enter()`, so it works when iced polls the futures, and it is injected into `fluxer_ui::run`. The four entrance `ApiRequest`s were already wired on the base (`runtime.rs:1123-1148`). 3. **Invariants:** nothing changed in fluxer-core, fluxer-ui, fluxer-emoji or any Cargo manifest. - `sound_edit_rt` logs nothing. Its errors are `FileError::Unsupported` or a `JoinError` string, with no path in either. - The upload body (base64 audio) goes through `unobserved()`, so `--record` never sees it. - The devserver endpoints follow `EntranceSoundService.ts` (check order name → quota → base64 → size → format → duration; `normalizeName` trim and 1..32; error codes and paths) and `EntranceSoundController.ts` (201 and 204, the `serializeSound` fields). - The new READY emoji follows `GuildEmojiResponse` (`id, name, animated, nsfw`). - The `limits` override follows the `LimitConfigService` rules/overrides wire format. - Server data cannot cause a panic: the WAV parser uses `get`/`checked_add`, and ids are parsed with a 400 on failure. 4. **Review Focus 3** (synced preferences, debounced): covered by `soundboard_favourite_star_syncs_through_user_settings`. 5. **Local CI:** `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` in a clean review worktree passed: all steps green, livekit-interop skipped as usual. **Findings** - **minor:** the fixture commit `db944d0` does not name the server file and line its fixtures were copied from, which the Global Constraints require. The code comments do name `EntranceSoundService` / `EntranceSoundConstants.ts`, and I checked the shapes against the server source, so this is a process gap only. - **minor (deviation, accepted):** `section-voice_video-entrance-sound` stays `planned` with a note, and the plan said `done`. That is correct while Text chat 60 is not merged. Whoever lands 60 must set it to done and remove the note. - **minor (nit):** a comment in `fixtures/scenarios/voice.toml` says entrance `scopes` are `"global"` or `"guild:<id>"`, but the fixture now also uses `"dms"`. **Verdict: approved.** No blocking findings and local CI is green. I did not check the remote runners.
charles manually merged commit 851af027ea into textchat 2026-11-13 13:10:46 +00:00
Sign in to join this conversation.
No description provided.