Soundboard 57: fluxer-core entrance-sound library, scopes and per-user entrance preferences #386

Closed
opened 2026-11-13 01:40:51 +00:00 by charles · 0 comments
Owner

Plan: docs/superpowers/plans/2026-11-12-textchat.md, section "Task 57" (Soundboard and entrance sounds, added 2026-11-12, high priority per Charles).

Task 57: fluxer-core entrance-sound library, scopes and per-user entrance preferences

Issue: (to be created)
Closes: none (the store half of #142's entrance-sound items).

Touches fluxer-core and, for the new [voice.entrance] table only, fluxer-platform's settings file (serialised in this task, as Voice did for [voice.soundboard]).

Files:

  • Modify: crates/fluxer-core/src/voice/{entrance.rs,soundboard.rs,mod.rs}, crates/fluxer-core/src/{event.rs,effect.rs,persist.rs,selectors/mod.rs}, crates/fluxer-core/README.md; crates/fluxer-platform/src/settings.rs
  • Test: crates/fluxer-core/tests/entrance_sounds.rs (new), crates/fluxer-core/tests/soundboard.rs (existing entrance playback tests keep passing), crates/fluxer-platform/tests/settings.rs

Interfaces:

  • Consumes: Task 55 (EntranceSoundScope, the request types and limits), Task 56 (ClipKind::Preview, PREVIEW_CLIP_TAG, PreviewLocalSound).
  • Produces (state): voice::EntranceLibrary { status: LibraryStatus::{NotLoaded, Loading, Loaded, Failed}, sounds: Vec<EntranceSound> /* newest first, as EntranceSoundLibrary.list */, selections: BTreeMap<String, Snowflake> /* scope id → sound */, pending: Option<EntranceOp>, error: Option<EntranceError> } in Voice::entrance_library (pub); EntranceOp::{Uploading, Selecting(String), Renaming(Snowflake), Deleting(Snowflake)}; EntranceError::{NotEnabled, LibraryFull, TooLarge, InvalidFormat, TooLong, Name, Server(String)}. The join-time fetch of Voice (announce_entrance) also fills the library, and selected_sound uses EntranceSoundScope::fallbacks.
  • Produces (actions → requests): UserAction::LoadEntranceSounds (once per session unless Failed; the settings page sends it) → ApiRequest::FetchEntranceSounds; UserAction::SetEntranceSound { scope: EntranceSoundScope, sound_id: Option<Snowflake> } → ApiRequest::PutEntranceSoundSelection { scope_id: String, sound_id: Option<Snowflake> }, applied on ApiResult::EntranceSelectionSet { scope_id, sound_id }; UserAction::UploadEntranceSound { name: String, bytes: SoundBytes, select_for: EntranceSoundScope } → checks (feature limit feature_voice_entrance_sounds from the session's limits → NotEnabled; 8 sounds → LibraryFull; > 1 MiB → TooLarge; magic bytes as sound_content_type → InvalidFormat; name trimmed, 1–32 chars, "Entrance sound" when empty, as deriveLibraryName) then ApiRequest::UploadEntranceSound { name, bytes }, and on ApiResult::EntranceSoundUploaded(EntranceSound) the selection for select_for (as uploadTrimmedResult); UserAction::RenameEntranceSound { sound_id, name } → ApiRequest::RenameEntranceSound { sound_id, name } / ApiResult::EntranceSoundRenamed(EntranceSound); UserAction::DeleteEntranceSound(Snowflake) → ApiRequest::DeleteEntranceSound { sound_id } / ApiResult::EntranceSoundDeleted(Snowflake) (drops the sound and every selection pointing at it); UserAction::PreviewEntranceSound(Snowflake) → FetchMedia under key entrance:<hash> (the playback key) then PlayClip with ClipKind::Preview at the output volume only (playPreview). Server failures set error: Server(message) and clear pending; the server's validation codes map to the matching EntranceError.
  • Produces (listener prefs, EntranceSoundListenerPrefs.ts): voice::EntranceListenerPrefs { volumes: BTreeMap<Snowflake, u8>, mutes: BTreeSet<Snowflake> } in Voice::entrance_listeners (pub), volume(user) -> u8 (default 100, clamped 0–200), is_muted(user) -> bool; `UserAction::SetEntranceListenerMute { user_id: Snowf

🤖 Generated with Claude Code

Plan: `docs/superpowers/plans/2026-11-12-textchat.md`, section "Task 57" (Soundboard and entrance sounds, added 2026-11-12, high priority per Charles). ### Task 57: `fluxer-core` entrance-sound library, scopes and per-user entrance preferences **Issue:** (to be created) **Closes:** none (the store half of #142's entrance-sound items). Touches `fluxer-core` and, for the new `[voice.entrance]` table only, `fluxer-platform`'s settings file (serialised in this task, as Voice did for `[voice.soundboard]`). **Files:** - Modify: `crates/fluxer-core/src/voice/{entrance.rs,soundboard.rs,mod.rs}`, `crates/fluxer-core/src/{event.rs,effect.rs,persist.rs,selectors/mod.rs}`, `crates/fluxer-core/README.md`; `crates/fluxer-platform/src/settings.rs` - Test: `crates/fluxer-core/tests/entrance_sounds.rs` (new), `crates/fluxer-core/tests/soundboard.rs` (existing entrance playback tests keep passing), `crates/fluxer-platform/tests/settings.rs` **Interfaces:** - Consumes: Task 55 (`EntranceSoundScope`, the request types and limits), Task 56 (`ClipKind::Preview`, `PREVIEW_CLIP_TAG`, `PreviewLocalSound`). - Produces (state): `voice::EntranceLibrary { status: LibraryStatus::{NotLoaded, Loading, Loaded, Failed}, sounds: Vec<EntranceSound> /* newest first, as `EntranceSoundLibrary.list` */, selections: BTreeMap<String, Snowflake> /* scope id → sound */, pending: Option<EntranceOp>, error: Option<EntranceError> }` in `Voice::entrance_library` (pub); `EntranceOp::{Uploading, Selecting(String), Renaming(Snowflake), Deleting(Snowflake)}`; `EntranceError::{NotEnabled, LibraryFull, TooLarge, InvalidFormat, TooLong, Name, Server(String)}`. The join-time fetch of Voice (`announce_entrance`) also fills the library, and `selected_sound` uses `EntranceSoundScope::fallbacks`. - Produces (actions → requests): `UserAction::LoadEntranceSounds` (once per session unless `Failed`; the settings page sends it) → `ApiRequest::FetchEntranceSounds`; `UserAction::SetEntranceSound { scope: EntranceSoundScope, sound_id: Option<Snowflake> }` → `ApiRequest::PutEntranceSoundSelection { scope_id: String, sound_id: Option<Snowflake> }`, applied on `ApiResult::EntranceSelectionSet { scope_id, sound_id }`; `UserAction::UploadEntranceSound { name: String, bytes: SoundBytes, select_for: EntranceSoundScope }` → checks (feature limit `feature_voice_entrance_sounds` from the session's limits → `NotEnabled`; 8 sounds → `LibraryFull`; > 1 MiB → `TooLarge`; magic bytes as `sound_content_type` → `InvalidFormat`; name trimmed, 1–32 chars, `"Entrance sound"` when empty, as `deriveLibraryName`) then `ApiRequest::UploadEntranceSound { name, bytes }`, and on `ApiResult::EntranceSoundUploaded(EntranceSound)` the selection for `select_for` (as `uploadTrimmedResult`); `UserAction::RenameEntranceSound { sound_id, name }` → `ApiRequest::RenameEntranceSound { sound_id, name }` / `ApiResult::EntranceSoundRenamed(EntranceSound)`; `UserAction::DeleteEntranceSound(Snowflake)` → `ApiRequest::DeleteEntranceSound { sound_id }` / `ApiResult::EntranceSoundDeleted(Snowflake)` (drops the sound and every selection pointing at it); `UserAction::PreviewEntranceSound(Snowflake)` → `FetchMedia` under key `entrance:<hash>` (the playback key) then `PlayClip` with `ClipKind::Preview` at the output volume only (`playPreview`). Server failures set `error: Server(message)` and clear `pending`; the server's validation codes map to the matching `EntranceError`. - Produces (listener prefs, `EntranceSoundListenerPrefs.ts`): `voice::EntranceListenerPrefs { volumes: BTreeMap<Snowflake, u8>, mutes: BTreeSet<Snowflake> }` in `Voice::entrance_listeners` (pub), `volume(user) -> u8` (default 100, clamped 0–200), `is_muted(user) -> bool`; `UserAction::SetEntranceListenerMute { user_id: Snowf 🤖 Generated with [Claude Code](https://claude.com/claude-code)
charles added this to the Text chat milestone 2026-11-13 01:40:51 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/fluxer-native#386
No description provided.