Text chat 59: Soundboard popout parity: preview, icons, custom emoji, edit, delete confirmation, trimmer (#388) #412
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "textchat-59-ui-soundboard-popout-parity"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Text chat 59: soundboard popout parity with
SoundboardPicker.tsx,GuildSoundboardSoundModal.tsx(edit mode) andEntranceSoundTrimmerModal.tsx.Stacked on: textchat-56-core-soundboard-parity
What is built (fluxer-ui only)
PreviewSoundwith the sound's own volume; it works while sends are blocked (muted, cooldown).guild_icon_url, acronym until loaded) or the favourites star; tiles draw custom emoji (media_urls::custom_emojithroughwidgets::emoji::url) and Twemoji throughImages.soundboard::wantedfeedsmedia::wantedwhile the popout is open.PickerModel::cooldownon every snapshot (3 → 2 → 1 s test).selectors::can_manage_sound; "Upload a sound" usescan_upload_sound. The old inline rename is replaced by the edit dialog.confirm.rs(genericConfirm, reused by Task 60), the original's "Delete sound" / "Delete {name}? Members will no longer be able to play it." / Cancel / red Delete; only Delete emitsDeleteSound.edit.rs): name with the original's three errors, related emoji (EmojiField: grid of the guild's custom emoji + Unicode fromemoji_picker, search, a typed emoji offered first, Remove emoji), volume slider + Preview at the slider's volume, Save →EditSound(closes without sending when nothing changed; closes when the store's sound matches what was saved viaState::sync; shows "Couldn't save this sound" + body on failure). The upload dialog uses the same emoji field.trimmer.rs):ConfigwithSOUNDBOARD/ENTRANCE, waveform fromSoundFileReader::outline, two draggable handles (or the region; min 0.1 s, maxConfig::max, the original's clamping), readout "Selection: … (max …)", Play selection (trim →PreviewLocalSound) / Pause (StopPreview), Use selection (trim; over-size error withformatFileSize-style "1MB"/"20MB"), decode error. The upload dialog runs every file through it beforeUploadSound.FileError::Unsupported,SoundOutline,SoundFileReader::{outline, trim}with default bodies returningUnsupported(the platform implementation is Task 61).Tests
cargo test -p fluxer-ui --test soundboard: all 19 plan tests plusedit_dialog_shows_the_original_failure; existing upload tests now go through the trimmer.soundboard_popout_icons_preview,soundboard_delete_confirm,soundboard_edit_sound,sound_trimmer;soundboard_popoutregenerated (preview buttons, acronyms). Goldens rendered on lavapipe in the Ubuntu 22.04 image (fluxer-native-shots:u2204); all 55 screenshot tests pass there and on this machine's GPU.FLUXER_SCREENSHOT_TESTS=1 cargo xtask cigreen locally.Deviations / notes for review
trimmer::Outcomealso hasNoneandAction(UserAction)(for the preview and its stop);upload::Outcome::ActionbecameActions(Vec<UserAction>);State::escape/closereturn theStopPreviewof a playing trimmer.screens/main/mod.rs(outside the Files list): the popout now needs the image cache, and dialogs are drawn centred over the whole call area with a dim backdrop (soundboard::dialog), since the edit dialog is taller than the popout.apps/fluxerlib SIGABRT at exit (#338) seen once on the base.Also closes #138, closes #139, closes #140, closes #141.
Closes #388
🤖 Generated with Claude Code
Independent review: Text chat 59 (diff 8784e9c..3f1f325)
Tests (plan step 1): all 19 named tests exist in
crates/fluxer-ui/tests/soundboard.rsand assert what the plan says. I checked the strings against the fork:GuildSoundboardTab.tsx:146-150(delete confirm),GuildSoundboardSoundModal.tsx:55-92(name errors and save failure) andEntranceSoundTrimmerModal.tsx:31-57(trimmer strings). The cooldown test goes 3 → 2 → 1 s with 400 ms and 1 s ticks. The trimmer limits are 5.2 s / 1 MiB / mono and 30 s / 20 MiB / stereo, with a 0.1 s minimum. There is one extra test,edit_dialog_shows_the_original_failure. All 4 named screenshots exist with goldens.Interfaces:
FileError::Unsupported,files::SoundOutlineandSoundFileReader::{outline, trim}(default bodies return Unsupported) match the plan exactly. So dotrimmer::{Config, SOUNDBOARD, ENTRANCE}andconfirm.trimmer::OutcomeaddsNoneandAction(UserAction)to the planned variants. That is additive: Task 60 builds against the merged code, so nothing breaks.Invariants: fluxer-core is untouched and there are no new dependencies. The UI gains no new I/O path: outline and trim run only through
Task::performon the injected reader, fromapp.rs. Nothing is logged, and no path or URL is logged. The sounds built inline in the screenshot test have the same keys asfixtures/rest/soundboard_sounds.json. I checked the trimmer and waveform maths for panics: they are clamped, the slice indices stay in bounds,Duration::from_secs_f64never gets a negative value, and an empty or zero peak list is handled.Findings
AppSoundFiles(outline and trim overfluxer_audio::edit), the shipped app uses the defaultUnsupportedreader. Every soundboard upload in the real client would stop at "Could not decode this audio file." in the trimmer. The previews andPlayClipBytesalso need Task 61's runtime. The plan stages it this way, but Charles should not test uploads on a build between this merge and Task 61.trimmer::State::playingstaystrueafter a preview ends by itself, because the model ANDs it with the store'spreviewing. The next selection change or Escape then sends a harmless extraStopPreviewfor the preview tag.Review Focus: none of the items 1-7 belongs to this task. Item 7 (server data never panics) was checked above.
Local gate:
FLUXER_SCREENSHOT_TESTS=1 cargo xtask ciin a fresh review worktree: all steps passed (exit 0). All 55 golden tests passed, including the 4 new ones and the regeneratedsoundboard_popout.Verdict: APPROVE. No blocking findings.
Independent review (second pass): Text chat 59 at
d8fb09f(task commit3f1f325)Tests (plan step 1): All 19 named tests exist in
crates/fluxer-ui/tests/soundboard.rs. All 4 screenshots exist as*_matches_goldenintests/screenshots.rs, with goldens. They assert the planned values:DeleteSound;SOUNDBOARDis 30 s / 20 MiB / stereo,ENTRANCEis 5.2 s / 1 MiB / mono with the help line, and the minimum selection is 0.1 s.Interfaces: These match the plan exactly:
FileError::Unsupported,files::SoundOutline { duration, channels, peaks }andSoundFileReader::{outline, trim}with defaultUnsupportedbodies. So dotrimmer::{Config, SOUNDBOARD, ENTRANCE}andtrimmer::Outcome::{Outline, Trim, Done, Cancel}.Outcomealso hasNoneandAction, which is additive.Invariants: fluxer-core is untouched and there are no new dependencies. fluxer-ui gains no new I/O path: outline and trim run only through
Task::performon the injected reader. Nothing is logged, and no path or URL is logged. The trimmer's duration maths is clamped, sox_ofguards a zero duration andmove_endavoidsclamppanics.Findings
edit.rshasMAX_CHOICES = 80, a cap that neither the plan nor the original's picker has. With nothing typed, the grid shows at most 80 entries. A guild with 80 or more custom emoji therefore shows no Unicode emoji, and some of its own emoji can be reached only by search. Charles's relayed request "remove the cap" may mean this cap. It has not been acted on and needs his confirmation.AppSoundFiles, the shipped app's reader returnsUnsupported. Every upload goes through the trimmer, so in the real client every upload stops at "Could not decode this audio file." The plan stages it this way.fluxer-videobus_reader_never_blocks_writerfailed because one write took 5.6 ms against a 5 ms limit while the machine was loaded. This is a timing flake in a crate this PR does not touch, and it passed on the re-run.Review Focus: none of the items belongs to this task. I checked item 7 (no panics) for the trimmer maths.
Local gate:
FLUXER_SCREENSHOT_TESTS=1 cargo xtask ciatd8fb09f: all steps passed (exit 0) on the re-run.Verdict: APPROVE. There are no blocking findings.