← Back to Pull requests

feat(ui): join a friend's voice channel from their profile #971

Open
unknown opened this pull request with 650 lines diff across 8 files
View on GitHub
unknown unknown commented on Nov 11, 2026 00:02 UTC
Author

Summary

Discord's profile shows an In voice card when someone is in a server voice channel, with a Join button that connects you straight to their channel. Serein only showed a small "In voice" badge, so joining a friend meant finding the server and channel yourself.

Profiles now show that card:

  • Where: the full profile's Activity tab (below current activity, as in Discord), the compact popout and the card docked beside a DM.

  • Contents: up to three people from the channel on a small tile, the profile's owner first. A larger crowd shows +N, and hovering the tile names the people shown. Below it are the channel name, the server name and Join.

  • Source: built only from voice states the Gateway already delivered (READY guild voice_states / VOICE_STATE_UPDATE, unofficial). No extra request is made.

  • Visibility: uses the same rules as the existing voice badge. Only channels this account can view (VIEW_CHANNEL) on a connected Gateway appear. Private calls are not listed, because their conversation already offers them.

  • Join: goes through the existing guild voice join (request_call):

  • - It never rings.
    - If another call is live, the existing "Switch calls?" confirmation asks first.
    - It closes the profile and opens the joined channel, as Discord does.
  • Disabled Join: happens while you're already in that channel, without CONNECT, offline, or in the offline preview. A hover explains why.

  • No duplicate badge: the small "In voice" badge hides while the card is on screen.
  • Adds 4 strings to all 13 locales and updates the profile Activity paragraph in docs/discord-compatibility.md.

    Verification

  • cargo xtask check passed with the pinned 1.99.1 MSVC toolchain on Windows 11 x64. It covers fmt, clippy -D warnings, cargo test --workspace (42 suites: 1,520 passed, 0 failed, 16 ignored), check -p serein --no-default-features and the policy checks.

  • New regression test in_voice_card_joins_a_visible_server_channel_without_ringing checks four things on the synthetic voice fixture:

  • - The card finds the right server and channel.
    - Join sends exactly one non-ringing join and opens the channel.
    - Join closes the profile.
    - A channel hidden by a VIEW_CHANNEL deny overwrite is never offered.
  • Native --demo --demo-voice --demo-profile (synthetic fixture), before and after: Robin's popout, then the full profile's Activity tab. Both disabled-Join and tile hovers were inspected.

  • cargo xtask package was built for both revisions. See Performance.

  • Repro:

  • 1. Run serein --demo --demo-voice --demo-profile.
    2. Robin's popout shows the In voice card.
    3. Click the avatar, then Activity.

    Not verified:

  • Live Discord. No account, call or microphone was used.

  • macOS and Linux rendering.

  • An enabled Join button. In the fixture the account is already in the room, and the offline preview never allows calls, so the screenshots show Join disabled.
  • Before / after

    Top: Robin's popout. Bottom: full profile, Activity tab. The data is the synthetic --demo-voice fixture, not live Discord.

    | Before | After |
    | --- | --- |
    | !Before | !After |

    Performance

    Environment: Windows 11 Pro 26200 x64, i9-14900KS, 96 GiB RAM, rustc 1.99.1 MSVC. Baseline is 09bee5a0 (origin/main).

    Package sizes: both releases came from cargo xtask package (release, --no-default-features, voice included).

    Process samples: both runs used unoptimized debug --features demo builds, because the fixture is not in the release package. Each run used the same clicks: --demo --demo-voice --demo-profile, then the full profile on the Activity tab, a 10 s warm-up, and 30 samples one second apart. There were two runs per build, shown as run 1 / run 2.

    | Metric / method | Baseline | After | Delta |
    | --- | --- | --- | --- |
    | serein.exe | 98,518,528 B | 98,561,536 B | +43,008 B (+0.04%) |
    | Installed dist/, all files | 102,892,189 B | 102,935,197 B | +43,008 B (+0.04%) |
    | Compressed dist/ (Compress-Archive -CompressionLevel Optimal) | 55,978,920 B | 55,994,654 B | +15,734 B (+0.03%) |
    | Settled working set | 365.2 / 365.2 MiB | 365.0 / 364.8 MiB | No change, within ~0.4 MiB run noise |
    | Peak working set | 379.2 / 379.1 MiB | 380.2 / 378.7 MiB | No change, within noise |
    | Settled private bytes | 421.0 / 418.9 MiB | 420.9 / 420.9 MiB | No change, within noise |
    | Average CPU, % of the whole machine | 0.02 / 0.13% | 0.14 / 0.01% | Noise-level; no measurable difference |

    Not measured:

  • Frame time and latency.

  • The NSIS installer (makensis is not installed).

  • replay-bench, which doesn't apply here: the reducer, cache and protocol are unchanged.
  • Cost of the new code:

  • One extra scan of the voice roster, which is already bounded, and only while a profile is open. The existing badge already does the same scan.

  • At most three avatar lookups per frame.
  • Risks / blockers

  • Discord shows the card from the same voice states. Serein only lists rooms that this account's computed permissions allow it to view, so it may show fewer rooms than Discord in edge cases. It never shows more.

  • Channel user limits are not modelled. Join stays enabled for a full channel. It is then handled by the existing join failure path, which has not been verified live for this case.
  • 🔺 Built with JOKELCODE

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->

    <!-- coderabbit-ai-generated:v1 -->

    Summary by CodeRabbit

    New Features
    Profile cards now show when someone is in a viewable server voice channel, including the channel, server, and participants. You can join from the card when available; joining does not ring.
    Voice-channel profile information is available in multiple languages.
    Documentation
    * Updated profile board documentation with details about voice cards and joining restrictions.

    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: greptile-apps[bot] Review duration: 10m
    All Vouch review confidence checks passed
    Residual risk 0.34 = Change Risk (0.52) × (1 − Review Confidence (0.35)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 66% · Reviewer familiarity: 35%
    34%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #971"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 34.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 52% (MEDIUM) · Higher = larger blast radius
    52%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 34.5% · Lower = rushed or shallow review
    34.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 34.1% · Safe to merge
    34.1%