From 34e40ae7693941c5b42ab342c245562655d4b5b9 Mon Sep 17 00:00:00 2001 From: robert Date: Mon, 26 May 2025 09:11:29 -0400 Subject: [PATCH] more view changes. --- src/App.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/App.js b/src/App.js index b470e7d..36d2ed7 100644 --- a/src/App.js +++ b/src/App.js @@ -234,7 +234,7 @@ function App() { {!isAuthReady && !error &&

Authenticating...

} ); @@ -1001,7 +1001,7 @@ function DisplayView() { block: 'center', }); } - }, [activeEncounterData?.currentTurnParticipantId]); + }, [activeEncounterData?.currentTurnParticipantId, activeEncounterData?.participants]); // Also re-scroll if participants list changes (e.g. focused view) if (isLoadingActiveDisplay || (isPlayerDisplayActive && isLoadingEncounter)) { return
Loading Player Display...
; @@ -1042,7 +1042,7 @@ function DisplayView() { } let participantsToRender = allOrderedActiveParticipants; - const FOCUSED_VIEW_THRESHOLD = 7; // When to switch to focused view + const FOCUSED_VIEW_THRESHOLD = 7; const ITEMS_AROUND_CURRENT = 3; // Show 3 before and 3 after current = 7 total in focused view let inFocusedView = false; @@ -1053,7 +1053,6 @@ function DisplayView() { const focusedList = []; for (let i = -ITEMS_AROUND_CURRENT; i <= ITEMS_AROUND_CURRENT; i++) { const listLength = allOrderedActiveParticipants.length; - // Ensure the index wraps around correctly for the circular list effect const actualIndex = (currentIndex + i + listLength) % listLength; focusedList.push(allOrderedActiveParticipants[actualIndex]); } @@ -1086,7 +1085,7 @@ function DisplayView() { {!isStarted && (!participants || participants.length === 0) &&

No participants.

} {participantsToRender.length === 0 && isStarted &&

No active participants.

} -
{/* Widened and adjusted maxHeight */} +
{/* Adjusted maxHeight */} {participantsToRender.map(p => (