feat(orbit): per-guest suggestion mute + global pending-cap setting

Two anti-spam knobs the host can dial during a live session:

1. Per-guest suggestion mute — Mic / MicOff toggle next to the
   kick/ban buttons in the participants popover. Symmetric (re-enable
   later). State lives in OrbitState.suggestionBlocked: string[]; the
   guest reads it and disables its own Suggest controls so the user
   sees a clear "muted" state instead of silent failures. Host-side
   sweep also drops their outbox entries as a safety net.

2. Max pending approvals cap — number input in the session-settings
   popover, default 0 (= unlimited so existing sessions are unaffected).
   When set, the host sweep stops folding new outbox entries into the
   approval list once the cap is reached. The OrbitQueueHead surfaces
   "X / Y pending" so guests can see when they're getting close.

State changes are additive on the wire — both fields are optional, with
parseOrbitState defaulting them, so older clients keep working.

evaluateOrbitSuggestGate() centralises the guest-side allow/block check
shared between useOrbitSongRowBehavior and the ContextMenu Add-to-Session
items, plus suggestOrbitTrack as a defensive last line.

i18n: en + de + fr + nl + zh + nb + ru + es.

Also fixes an earlier dedupe-key collision: the (user, trackId) cache
keys were missing their separator (NULL byte slipped in during the
previous patch), so two tracks could share a key and one of them
silently overwrite the other. Restored the space separator.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Psychotoxical
2026-04-25 01:21:51 +02:00
parent 6ca678547b
commit cfb7e7f6c1
17 changed files with 428 additions and 57 deletions
+10
View File
@@ -1584,6 +1584,10 @@ export const enTranslation = {
participantsRemoveAria: 'Remove {{user}} from this session',
participantsBanTooltip: 'Ban permanently',
participantsBanAria: 'Permanently ban {{user}}',
participantsMuteTooltip: 'Mute suggestions',
participantsUnmuteTooltip: 'Allow suggestions',
participantsMuteAria: 'Mute suggestions from {{user}}',
participantsUnmuteAria: 'Allow suggestions from {{user}}',
confirmRemoveTitle: 'Remove from session?',
confirmRemoveBody: '{{user}} will be dropped from the session, but can re-join via your invite link.',
confirmRemoveConfirm: 'Remove',
@@ -1609,6 +1613,12 @@ export const enTranslation = {
settingAutoShuffleHint: "Periodic FisherYates shuffle of the upcoming queue. Off: order only changes when you rearrange it.",
settingShuffleInterval: 'Reshuffle every',
settingShuffleIntervalHint: 'How often the upcoming queue gets reshuffled while the session runs.',
settingMaxPending: 'Max pending suggestions',
settingMaxPendingHint: 'Cap on how many guest suggestions can wait for approval. 0 = unlimited.',
pendingCounter: '{{count}} / {{max}} pending',
pendingCounterTooltip: 'Pending guest suggestions / cap',
suggestBlockedMuted: 'The host muted you for this session — suggestions are off.',
suggestBlockedCap: 'Approval queue is full — wait for the host to clear some.',
settingShuffleIntervalValue_one: '{{count}} min',
settingShuffleIntervalValue_other: '{{count}} min',
settingShuffleNow: 'Shuffle now',