mirror of
https://github.com/SableClient/Sable.git
synced 2026-11-21 09:31:17 -08:00
fix message load indicator positions
This commit is contained in:
1 parent
42e9d61244
commit
0a577a11c7
2 files changed
+33
-13
No files matched your search
@@ -0,0 +1,5 @@
|
||||
---
|
||||
default: patch
|
||||
---
|
||||
|
||||
Properly centered message loading indicators to avoid brief scrollbar shift while loading messages.
|
||||
@@ -720,12 +720,6 @@ export function RoomTimeline({
|
||||
</Chip>
|
||||
</Box>
|
||||
);
|
||||
} else if (timelineSync.backwardStatus === 'loading' && timelineSync.eventsLength > 0) {
|
||||
backPaginationJSX = (
|
||||
<Box justifyContent="Center" style={{ padding: config.space.S300 }}>
|
||||
<Spinner variant="Secondary" size="400" />
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -752,15 +746,20 @@ export function RoomTimeline({
|
||||
</Chip>
|
||||
</Box>
|
||||
);
|
||||
} else if (timelineSync.forwardStatus === 'loading' && timelineSync.eventsLength > 0) {
|
||||
frontPaginationJSX = (
|
||||
<Box justifyContent="Center" style={{ padding: config.space.S300 }}>
|
||||
<Spinner variant="Secondary" size="400" />
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const showBackPaginationSpinner =
|
||||
timelineSync.backwardStatus === 'loading' && timelineSync.eventsLength > 0;
|
||||
const showFrontPaginationSpinner =
|
||||
timelineSync.forwardStatus === 'loading' && timelineSync.eventsLength > 0;
|
||||
const timelineBottomFloatLift =
|
||||
!atBottomState && isReady ? { bottom: `calc(${config.space.S400} + ${toRem(52)})` } : undefined;
|
||||
const timelineTopFloatLift =
|
||||
unreadInfo?.readUptoEventId && !unreadInfo?.inLiveTimeline && isReady
|
||||
? { top: `calc(${config.space.S400} + ${toRem(52)})` }
|
||||
: undefined;
|
||||
|
||||
const vListItemCount =
|
||||
timelineSync.eventsLength === 0 &&
|
||||
(!isReady || timelineSync.canPaginateBack || timelineSync.backwardStatus === 'loading')
|
||||
@@ -1009,7 +1008,23 @@ export function RoomTimeline({
|
||||
</VList>
|
||||
</div>
|
||||
|
||||
{frontPaginationJSX}
|
||||
{showBackPaginationSpinner && (
|
||||
<TimelineFloat position="Top" style={timelineTopFloatLift}>
|
||||
<Spinner variant="Secondary" size="400" />
|
||||
</TimelineFloat>
|
||||
)}
|
||||
|
||||
{showFrontPaginationSpinner && (
|
||||
<TimelineFloat position="Bottom" style={timelineBottomFloatLift}>
|
||||
<Spinner variant="Secondary" size="400" />
|
||||
</TimelineFloat>
|
||||
)}
|
||||
|
||||
{frontPaginationJSX && (
|
||||
<TimelineFloat position="Bottom" style={timelineBottomFloatLift}>
|
||||
{frontPaginationJSX}
|
||||
</TimelineFloat>
|
||||
)}
|
||||
|
||||
{!atBottomState && isReady && (
|
||||
<TimelineFloat position="Bottom">
|
||||
|
||||
Reference in new issue
Block a user