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
@@ -1580,6 +1580,10 @@ export const deTranslation = {
participantsRemoveAria: '{{user}} aus dieser Session entfernen',
participantsBanTooltip: 'Permanent bannen',
participantsBanAria: '{{user}} permanent bannen',
participantsMuteTooltip: 'Vorschläge sperren',
participantsUnmuteTooltip: 'Vorschläge erlauben',
participantsMuteAria: 'Vorschläge von {{user}} sperren',
participantsUnmuteAria: 'Vorschläge von {{user}} wieder erlauben',
confirmRemoveTitle: 'Aus Session entfernen?',
confirmRemoveBody: '{{user}} wird aus der Session geworfen, kann aber jederzeit über deinen Einladungslink wieder beitreten.',
confirmRemoveConfirm: 'Entfernen',
@@ -1605,6 +1609,12 @@ export const deTranslation = {
settingAutoShuffleHint: 'Periodischer Fisher-Yates-Shuffle der kommenden Warteschlange. Aus: Reihenfolge wird nur verändert, wenn du selbst sortierst.',
settingShuffleInterval: 'Alle',
settingShuffleIntervalHint: 'Wie oft die kommende Warteschlange während der Session neu gemischt wird.',
settingMaxPending: 'Max offene Vorschläge',
settingMaxPendingHint: 'Begrenzt, wie viele Gast-Vorschläge gleichzeitig auf Bestätigung warten dürfen. 0 = unbegrenzt.',
pendingCounter: '{{count}} / {{max}} offen',
pendingCounterTooltip: 'Wartende Gast-Vorschläge / Limit',
suggestBlockedMuted: 'Der Host hat dich für diese Session gesperrt — keine Vorschläge möglich.',
suggestBlockedCap: 'Approval-Liste ist voll — warte bis der Host welche durchwinkt.',
settingShuffleIntervalValue_one: '{{count}} Min.',
settingShuffleIntervalValue_other: '{{count}} Min.',
settingShuffleNow: 'Jetzt mischen',
+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',
+10
View File
@@ -1567,6 +1567,10 @@ export const esTranslation = {
participantsRemoveAria: 'Quitar a {{user}} de esta sesión',
participantsBanTooltip: 'Banear permanentemente',
participantsBanAria: 'Banear permanentemente a {{user}}',
participantsMuteTooltip: 'Silenciar sugerencias',
participantsUnmuteTooltip: 'Permitir sugerencias',
participantsMuteAria: 'Silenciar las sugerencias de {{user}}',
participantsUnmuteAria: 'Volver a permitir las sugerencias de {{user}}',
confirmRemoveTitle: '¿Quitar de la sesión?',
confirmRemoveBody: '{{user}} será expulsado de la sesión, pero puede volver a unirse por tu enlace de invitación.',
confirmRemoveConfirm: 'Quitar',
@@ -1592,6 +1596,12 @@ export const esTranslation = {
settingAutoShuffleHint: 'Mezclado Fisher-Yates periódico de la cola próxima. Desactivado: el orden solo cambia cuando lo reorganizas.',
settingShuffleInterval: 'Remezclar cada',
settingShuffleIntervalHint: 'Con qué frecuencia se remezcla la cola próxima durante la sesión.',
settingMaxPending: 'Máx. sugerencias pendientes',
settingMaxPendingHint: 'Límite de sugerencias de invitados que pueden esperar aprobación a la vez. 0 = ilimitado.',
pendingCounter: '{{count}} / {{max}} pendientes',
pendingCounterTooltip: 'Sugerencias de invitados pendientes / límite',
suggestBlockedMuted: 'El anfitrión te silenció en esta sesión — sugerencias desactivadas.',
suggestBlockedCap: 'La cola de aprobación está llena — espera a que el anfitrión despeje algunas.',
settingShuffleIntervalValue_one: '{{count}} min',
settingShuffleIntervalValue_other: '{{count}} min',
settingShuffleNow: 'Mezclar ahora',
+10
View File
@@ -1562,6 +1562,10 @@ export const frTranslation = {
participantsRemoveAria: 'Retirer {{user}} de cette session',
participantsBanTooltip: 'Bannir définitivement',
participantsBanAria: 'Bannir définitivement {{user}}',
participantsMuteTooltip: 'Bloquer les suggestions',
participantsUnmuteTooltip: 'Autoriser les suggestions',
participantsMuteAria: 'Bloquer les suggestions de {{user}}',
participantsUnmuteAria: 'Autoriser à nouveau les suggestions de {{user}}',
confirmRemoveTitle: 'Retirer de la session ?',
confirmRemoveBody: '{{user}} sera retiré de la session mais peut rejoindre via ton lien d\'invitation.',
confirmRemoveConfirm: 'Retirer',
@@ -1587,6 +1591,12 @@ export const frTranslation = {
settingAutoShuffleHint: 'Mélange Fisher-Yates périodique de la file à venir. Désactivé : l\'ordre ne change que lorsque tu le réorganises.',
settingShuffleInterval: 'Remélanger toutes les',
settingShuffleIntervalHint: 'Fréquence de remélange de la file pendant la session.',
settingMaxPending: 'Max suggestions en attente',
settingMaxPendingHint: 'Limite le nombre de suggestions invitées qui attendent ton approbation. 0 = illimité.',
pendingCounter: '{{count}} / {{max}} en attente',
pendingCounterTooltip: 'Suggestions invitées en attente / limite',
suggestBlockedMuted: 'L\'hôte t\'a coupé le micro pour cette session — suggestions désactivées.',
suggestBlockedCap: 'La file d\'approbation est pleine — attends que l\'hôte en traite.',
settingShuffleIntervalValue_one: '{{count}} min',
settingShuffleIntervalValue_other: '{{count}} min',
settingShuffleNow: 'Mélanger maintenant',
+10
View File
@@ -1561,6 +1561,10 @@ export const nbTranslation = {
participantsRemoveAria: 'Fjern {{user}} fra denne økten',
participantsBanTooltip: 'Uteste permanent',
participantsBanAria: 'Uteste {{user}} permanent',
participantsMuteTooltip: 'Blokker forslag',
participantsUnmuteTooltip: 'Tillat forslag',
participantsMuteAria: 'Blokker forslag fra {{user}}',
participantsUnmuteAria: 'Tillat forslag fra {{user}} igjen',
confirmRemoveTitle: 'Fjerne fra økten?',
confirmRemoveBody: '{{user}} fjernes fra økten, men kan bli med igjen via invitasjonslenken din.',
confirmRemoveConfirm: 'Fjern',
@@ -1586,6 +1590,12 @@ export const nbTranslation = {
settingAutoShuffleHint: 'Periodisk Fisher-Yates-stokking av kommende kø. Av: rekkefølgen endres bare når du omorganiserer den.',
settingShuffleInterval: 'Stokk på nytt hver',
settingShuffleIntervalHint: 'Hvor ofte kommende kø stokkes på nytt mens økten kjører.',
settingMaxPending: 'Maks ventende forslag',
settingMaxPendingHint: 'Hvor mange gjesteforslag som samtidig kan vente på godkjenning. 0 = ubegrenset.',
pendingCounter: '{{count}} / {{max}} venter',
pendingCounterTooltip: 'Ventende gjesteforslag / grense',
suggestBlockedMuted: 'Verten har blokkert deg for denne økten — forslag er av.',
suggestBlockedCap: 'Godkjenningskøen er full — vent til verten tar unna noen.',
settingShuffleIntervalValue_one: '{{count}} min',
settingShuffleIntervalValue_other: '{{count}} min',
settingShuffleNow: 'Stokk nå',
+10
View File
@@ -1561,6 +1561,10 @@ export const nlTranslation = {
participantsRemoveAria: '{{user}} uit deze sessie verwijderen',
participantsBanTooltip: 'Permanent bannen',
participantsBanAria: '{{user}} permanent bannen',
participantsMuteTooltip: 'Voorstellen blokkeren',
participantsUnmuteTooltip: 'Voorstellen toestaan',
participantsMuteAria: 'Voorstellen van {{user}} blokkeren',
participantsUnmuteAria: 'Voorstellen van {{user}} weer toestaan',
confirmRemoveTitle: 'Uit sessie verwijderen?',
confirmRemoveBody: '{{user}} wordt uit de sessie verwijderd, maar kan opnieuw deelnemen via je uitnodigingslink.',
confirmRemoveConfirm: 'Verwijderen',
@@ -1586,6 +1590,12 @@ export const nlTranslation = {
settingAutoShuffleHint: 'Periodieke Fisher-Yates-shuffle van de komende wachtrij. Uit: de volgorde verandert alleen wanneer je zelf herschikt.',
settingShuffleInterval: 'Opnieuw shufflen elke',
settingShuffleIntervalHint: 'Hoe vaak de komende wachtrij tijdens de sessie opnieuw wordt geshuffled.',
settingMaxPending: 'Max openstaande voorstellen',
settingMaxPendingHint: 'Hoeveel gastvoorstellen tegelijk op goedkeuring mogen wachten. 0 = onbeperkt.',
pendingCounter: '{{count}} / {{max}} open',
pendingCounterTooltip: 'Wachtende gastvoorstellen / limiet',
suggestBlockedMuted: 'De host heeft je voor deze sessie geblokkeerd — voorstellen uitgeschakeld.',
suggestBlockedCap: 'De goedkeuringslijst is vol — wacht tot de host er een paar afhandelt.',
settingShuffleIntervalValue_one: '{{count}} min',
settingShuffleIntervalValue_other: '{{count}} min',
settingShuffleNow: 'Nu shufflen',
+10
View File
@@ -1641,6 +1641,10 @@ export const ruTranslation = {
participantsRemoveAria: 'Удалить {{user}} из этой сессии',
participantsBanTooltip: 'Забанить навсегда',
participantsBanAria: 'Забанить {{user}} навсегда',
participantsMuteTooltip: 'Запретить предлагать треки',
participantsUnmuteTooltip: 'Разрешить предлагать треки',
participantsMuteAria: 'Запретить {{user}} предлагать треки',
participantsUnmuteAria: 'Снова разрешить {{user}} предлагать треки',
confirmRemoveTitle: 'Удалить из сессии?',
confirmRemoveBody: '{{user}} будет удалён из сессии, но может присоединиться снова по твоей ссылке-приглашению.',
confirmRemoveConfirm: 'Удалить',
@@ -1666,6 +1670,12 @@ export const ruTranslation = {
settingAutoShuffleHint: 'Периодическое Fisher-Yates перемешивание предстоящей очереди. Выкл.: порядок меняется только при ручной перестановке.',
settingShuffleInterval: 'Перемешивать каждые',
settingShuffleIntervalHint: 'Как часто предстоящая очередь перемешивается во время сессии.',
settingMaxPending: 'Макс. ожидающих заявок',
settingMaxPendingHint: 'Сколько гостевых предложений могут одновременно ждать одобрения. 0 = без лимита.',
pendingCounter: '{{count}} / {{max}} в ожидании',
pendingCounterTooltip: 'Ожидающие гостевые заявки / лимит',
suggestBlockedMuted: 'Хост отключил тебе предложение треков на этой сессии.',
suggestBlockedCap: 'Очередь одобрений переполнена — подожди, пока хост её разгребёт.',
settingShuffleIntervalValue_one: '{{count}} мин',
settingShuffleIntervalValue_few: '{{count}} мин',
settingShuffleIntervalValue_many: '{{count}} мин',
+10
View File
@@ -1554,6 +1554,10 @@ export const zhTranslation = {
participantsRemoveAria: '从此会话中移除 {{user}}',
participantsBanTooltip: '永久封禁',
participantsBanAria: '永久封禁 {{user}}',
participantsMuteTooltip: '禁止投歌',
participantsUnmuteTooltip: '允许投歌',
participantsMuteAria: '禁止 {{user}} 投歌',
participantsUnmuteAria: '允许 {{user}} 重新投歌',
confirmRemoveTitle: '从会话中移除?',
confirmRemoveBody: '{{user}} 将从会话中移除,但可以通过你的邀请链接重新加入。',
confirmRemoveConfirm: '移除',
@@ -1579,6 +1583,12 @@ export const zhTranslation = {
settingAutoShuffleHint: '即将播放队列的定期 Fisher-Yates 洗牌。关闭:顺序仅在你手动重新排列时改变。',
settingShuffleInterval: '洗牌间隔',
settingShuffleIntervalHint: '会话运行时即将播放队列的重新洗牌频率。',
settingMaxPending: '最大待审投歌数',
settingMaxPendingHint: '同时等待审核的访客投歌上限。0 = 不限制。',
pendingCounter: '{{count}} / {{max}} 待审',
pendingCounterTooltip: '等待中的访客投歌 / 上限',
suggestBlockedMuted: '主持人已禁止你在本场会话投歌。',
suggestBlockedCap: '审核队列已满,等主持人处理一些再继续。',
settingShuffleIntervalValue_one: '{{count}} 分钟',
settingShuffleIntervalValue_other: '{{count}} 分钟',
settingShuffleNow: '立即洗牌',