revert(orbit): drop maxPending cap feature, keep suggestion mute

The pending counter desynced from the actual approval list (state.queue
holds approved items as history, so the count never decreased after a
host approve). The host-pushed pendingApprovalCount workaround didn't
hold up under live testing either, so we're rolling the whole cap
feature back rather than ship something flaky.

What's gone:
- OrbitSettings.maxPending + state.pendingApprovalCount
- cap branch in applyOutboxSnapshotsToState (now back to mute-only)
- maxPending number input in settings popover
- pending counter chip in OrbitQueueHead
- 'cap-reached' branch in evaluateOrbitSuggestGate / OrbitSuggestGateReason
- cap-related toasts in ContextMenu / useOrbitSongRowBehavior
- cap-related i18n keys (suggestBlockedCap, settingMaxPending*, pendingCounter*)
- cap CSS (.orbit-queue-head__pending, .orbit-settings-pop__number)

What stays: per-guest suggestion mute (works correctly) and everything
that fed into both features (OrbitState.suggestionBlocked,
setOrbitSuggestionBlocked, evaluateOrbitSuggestGate, the participants
popover Mic/MicOff toggle, the suggestBlockedMuted toast).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Psychotoxical
2026-04-25 01:40:22 +02:00
parent 7c379c2111
commit e4cc54a1b5
16 changed files with 14 additions and 224 deletions
+1 -19
View File
@@ -1,5 +1,5 @@
import { useEffect, useState } from 'react';
import { Users, Wifi, WifiOff, Inbox } from 'lucide-react';
import { Users, Wifi, WifiOff } from 'lucide-react';
import { useTranslation } from 'react-i18next';
import { useOrbitStore } from '../store/orbitStore';
import type { OrbitState } from '../api/orbit';
@@ -36,15 +36,6 @@ export default function OrbitQueueHead({ state }: Props) {
const names = [state.host, ...state.participants.map(p => p.user)];
const showPresence = role === 'guest' && state.positionAt > 0;
const hostAway = showPresence && (nowMs - state.positionAt) > HOST_AWAY_THRESHOLD_MS;
const cap = state.settings?.maxPending ?? 0;
// Authoritative count comes from the host's own tick (state.pendingApprovalCount).
// Older clients that predate that field fall back to the raw queue length
// — that one over-counts because merged/declined items stay in state.queue
// as history, but it's the best a non-host client can do.
const pendingCount = cap > 0
? (state.pendingApprovalCount
?? state.queue.filter(q => q.addedBy !== state.host).length)
: 0;
return (
<div className="orbit-queue-head">
@@ -63,15 +54,6 @@ export default function OrbitQueueHead({ state }: Props) {
<div className="orbit-queue-head__meta">
<Users size={11} />
<span className="orbit-queue-head__names">{names.join(', ')}</span>
{cap > 0 && (
<span
className={`orbit-queue-head__pending${pendingCount >= cap ? ' is-full' : ''}`}
data-tooltip={t('orbit.pendingCounterTooltip')}
>
<Inbox size={11} />
<span>{t('orbit.pendingCounter', { count: pendingCount, max: cap })}</span>
</span>
)}
</div>
</div>
);