Improve stream sidebar experience and avatar affordance #284

Merged
talksik merged 5 commits from experience-nits into main 2026-06-13 18:39:29 +00:00
Showing only changes of commit 368922a2c1 - Show all commits
+1 -8
View File
@@ -3,6 +3,7 @@ import type { Particle } from '@/api/types';
export type StreamViewMode = 'player' | 'list';
// Deprecated: now we always start with player mode
function decideMode(
streamParticle: Particle & { type: 'stream' },
userId: string | undefined,
@@ -19,14 +20,6 @@ export function useStreamViewMode(
userId: string | undefined,
): { mode: StreamViewMode; toggle: () => void } {
const [mode, setMode] = useState<StreamViewMode>('player');
// Re-decide when navigating between streams without an unmount.
const [prevStreamId, setPrevStreamId] = useState(streamParticle.id);
if (prevStreamId !== streamParticle.id) {
setPrevStreamId(streamParticle.id);
setMode(decideMode(streamParticle, userId));
}
const toggle = useCallback(() => {
setMode((prev) => (prev === 'player' ? 'list' : 'player'));
}, []);