refactor(feed): derive the row's drop-out thresholds from its column widths
They were two hand-written sets of numbers describing the same boxes — change a w-32 and the thresholds are silently wrong, the symptom being a column appearing just before it fits. Now computed from one table (which reproduces the old values exactly). Width also stops reaching the four views that ignore it: it changes every frame of a resize, so passing it everywhere pushed all of them through VideoCard's memo for nothing.
This commit is contained in:
@@ -180,7 +180,11 @@ export default function VirtualFeed({
|
||||
key={v.id}
|
||||
video={v}
|
||||
view={view}
|
||||
width={itemWidth}
|
||||
// Only the one-line row reads its own width (it stands columns down as it
|
||||
// narrows). Everything else takes a stable 0, so a resize — which changes
|
||||
// itemWidth every frame — doesn't blow past VideoCard's memo for views that
|
||||
// wouldn't do anything with it.
|
||||
width={FEED_VIEW_SPEC[view].thumb ? 0 : itemWidth}
|
||||
onState={onState}
|
||||
onToggleSave={onToggleSave}
|
||||
onOpenChannel={onOpenChannel}
|
||||
|
||||
Reference in New Issue
Block a user