}
);
@@ -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) &&