fix(feed): re-measure the bare row's first-paint estimate
Making it a single line halved its height (82 -> 46), which left the virtualizer sizing a 60-item page ~2160px too tall.
This commit is contained in:
@@ -12,11 +12,15 @@ const LIST_GAP = 4;
|
|||||||
// Estimated row heights before measurement; real heights are measured per-row so these only affect
|
// Estimated row heights before measurement; real heights are measured per-row so these only affect
|
||||||
// the very first paint and the scrollbar's initial guess. Taken from measuring each mode in the
|
// the very first paint and the scrollbar's initial guess. Taken from measuring each mode in the
|
||||||
// browser rather than guessed — a bad estimate makes the scrollbar jump as you scroll in.
|
// browser rather than guessed — a bad estimate makes the scrollbar jump as you scroll in.
|
||||||
|
// RE-MEASURE these when a mode's layout changes: they have gone stale twice already, most recently
|
||||||
|
// when the bare row became a single line and halved (82 -> 46). The card figures are the roughest
|
||||||
|
// of the set by nature — a card's height follows its column width (measured ~307 at 3 columns,
|
||||||
|
// ~301 at 4, taller still at 2), so no single constant is right for every window.
|
||||||
const ROW_EST: Record<FeedView, number> = {
|
const ROW_EST: Record<FeedView, number> = {
|
||||||
cards: 340,
|
cards: 340,
|
||||||
cardsSmall: 257,
|
cardsSmall: 257,
|
||||||
rows: 115,
|
rows: 115,
|
||||||
rowsCompact: 82,
|
rowsCompact: 46,
|
||||||
tiles: 132,
|
tiles: 132,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user