mirror of
https://github.com/Psychotoxical/psysonic.git
synced 2026-07-22 07:15:47 +00:00
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:
@@ -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>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user