Skip to content

feat(voice): surface soundboard in the in-call voice control bar#172

Merged
krazyjakee merged 2 commits into
masterfrom
claude/happy-chatterjee-2095da
Jun 25, 2026
Merged

feat(voice): surface soundboard in the in-call voice control bar#172
krazyjakee merged 2 commits into
masterfrom
claude/happy-chatterjee-2095da

Conversation

@krazyjakee

Copy link
Copy Markdown
Contributor

What

Adds a Soundboard button to the in-call voice control bar, so users can play sounds without leaving the call.

Closes #150.

Why

The soundboard is fully implemented — SDK support in accordkit (REST + gateway events + AccordSound model), a standalone management/play UI (showAccordSoundboard), and use_soundboard / manage_soundboard permissions. But it was only reachable through Space Settings → Soundboard. The voice control bar had no soundboard button, so while connected to a voice channel there was no way to play a clip — the docs even promise it as a voice control (docs/voice-and-video/voice-channels.md:28).

Changes

  • lib/features/voice/views/voice_bar.dart
    • New soundboard button (Icons.graphic_eq) in the control row, placed after Screen share, before the trailing Spacer() (the spot called out in the issue).
    • Gated on the use_soundboard permission, computed via the same accordEffectivePermissions / accordHasPermission path Space Settings uses (admin/owner/role-preview aware).
    • Opens the existing showAccordSoundboard() picker, reusing its server-side client.soundboard.play() path, and passes through manage_soundboard so managers keep add/edit/delete/volume controls.
    • The picker uses responsive dialog constraints, so it works on both desktop and mobile.
  • test/features/voice/voice_bar_test.dart
    • Regression tests: the button shows when use_soundboard is granted and is hidden without it.

Acceptance criteria

  • Soundboard button added to the voice control bar, after Screen share, gated on use_soundboard
  • Opens a quick soundboard picker reusing the play path (client.soundboard.play())
  • Works on both desktop and mobile layouts

Testing

  • flutter analyze --no-fatal-infos on the changed files → No issues found
  • flutter test test/features/voice/voice_bar_test.dart → all 3 tests pass

🤖 Generated with Claude Code

krazyjakee and others added 2 commits June 20, 2026 10:55
The soundboard was fully implemented (SDK + standalone UI) but only
reachable through Space Settings, so there was no way to play a sound
while in a voice call (closes #150).

Add a soundboard button to the voice control bar, after Screen share and
before the trailing Spacer, gated on the use_soundboard permission via
the same accordEffectivePermissions/accordHasPermission path Space
Settings uses. It opens the existing showAccordSoundboard() picker,
reusing its server-side play path, and passes through manageSoundboard
so managers keep add/edit/delete controls. The dialog is responsive, so
it works on both desktop and mobile.

Add regression tests covering the button showing when use_soundboard is
granted and hiding without it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Trim the build-method comment to only the maintenance invariant (the
  two-line version explained what the code does, violating project
  conventions).
- Add a missing test: soundboard button must stay hidden in DM/group-DM
  voice calls where spaceId is null, regardless of permission state.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MvQoPxs2QKDxU79J4ZCkad

Copy link
Copy Markdown
Contributor Author

Code Review — findings & fixes (commit 242ca69)

Two fixes pushed to the branch. Findings ranked by severity:


🟡 MEDIUM — Comment explained what the code does (fixed)

lib/features/voice/views/voice_bar.dart line 72–73

The original two-line comment described what the code does ("Surface the soundboard to members who can use it…") and referenced the internal filename as a task note — both things the project's conventions ask us to avoid in source comments. The only information worth preserving is the maintenance invariant (two places compute the same permission, must stay in sync). Trimmed to:

// Mirrors accord_space_settings.dart — keep these permission checks in sync.

🟡 MEDIUM — Missing regression test: soundboard in DM voice calls (fixed)

test/features/voice/voice_bar_test.dart

When VoiceConnection.spaceId is null (DM / group-DM calls), canUseSoundboard stays false and the button must not appear. The existing tests only covered the space-with-permission / space-without-permission cases; there was no test for the DM path. A refactor of the if (spaceId != null) guard or the if (canUseSoundboard && spaceId != null) render condition could silently regress this. Added:

testWidgets('hides soundboard button in a DM voice call (null spaceId)', …)

ℹ️ LOW — Admin user code path not tested (not fixed — needs auth override)

lib/features/voice/views/voice_bar.dart

When ref.watchIsAdmin() returns true, accordEffectivePermissions short-circuits to {administrator} before inspecting any roles, which grants useSoundboard even if the @everyone role doesn't include it. This branch isn't exercised by any test. Covering it would require overriding accordAuthProvider to surface a logged-in state with isAdmin: true — more infrastructure than is appropriate here, but worth adding in a follow-up.


✅ Everything else looks good

  • Permission logic correctly mirrors accord_space_settings.dart — same accordEffectivePermissions / accordHasPermission / rolePreviewControllerProvider path.
  • canUseSoundboard && spaceId != null double-guard is correct: spaceId is used inside the onPressed lambda, and the redundant check lets Dart smart-cast it to non-nullable there.
  • Conditional ref.watch inside if (spaceId != null) is valid in Riverpod 3 for ConsumerState.build.
  • accordAuthProvider.build() returns AccordAuthLoggedOut without touching Hive, so the existing test fixtures are safe without an auth override.
  • No file is close to 1000 lines; no split needed.
  • No 3D / visual rendering changes — visual review not applicable.

Generated by Claude Code

@krazyjakee krazyjakee merged commit 8abc825 into master Jun 25, 2026
3 checks passed
@krazyjakee krazyjakee deleted the claude/happy-chatterjee-2095da branch June 25, 2026 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Soundboard is missing from the UI

2 participants