Commit 380e538
fix(web): trigger lineup next-page fetch before user scrolls past skeletons (#14351)
## Summary
The web Feed (and any other `TrackLineup`-driven page: Trending, Profile
Tracks/Reposts, Search, Listening History, Remixes, Contest Submissions)
felt like pagination was lagging: as you scroll down you'd see skeletons
appear at the bottom, but the next-page request didn't actually fire
until you scrolled *further past* them.
Root cause: regressed in
[apps#14286](#14286). The
bottom-of-list skeletons were changed from being gated on `isFetching`
to being gated on `hasNextPage`, which means they render persistently
any time there's more to load — not just during an in-flight fetch. With
`~15` skeletons at `~184px` each, they pad the `<InfiniteScroll>`'s
content height by `~2` viewports. `react-infinite-scroller` measures
distance to the bottom of *all* rendered content, so the threshold (also
`2 * viewport`) only fires after you've scrolled through both the loaded
tiles **and** the skeleton padding. The skeletons read as "loading" but
no fetch had been kicked off yet.
This PR:
- Restores the original "skeletons only while a page is in flight"
condition (`isFetching || isLoadMoreTriggered`), matching the
empty-state branch a few lines above. The bottom of the InfiniteScroll
content is now the bottom of the loaded tiles, so the existing
2-viewport threshold actually fires ~2 viewports before the last tile.
- Corrects `APPROX_TILE_HEIGHT_LARGE` from `124` → `184` (the desktop
tile is 144 body + 24 `mb='l'` + 16 parent `gap='m'`) so the in-flight
skeleton count actually fills the threshold area as the comment claims.
## Test plan
- [x] Open the Feed on web, scroll down — the next-page request fires
while the bottom of the loaded tiles is still ~2 viewports below your
viewport (check Network panel for `feed` calls), with skeletons
appearing only after the request is in flight.
- [x] Same on Trending (Week / Month / All-Time).
- [x] Same on Profile Tracks / Reposts, Search Tracks, Listening
History, Track Remixes, Contest Submissions.
- [ ] Mobile-web (`useWindow` path) at a phone-sized viewport — fetch
still triggers smoothly, no persistent skeleton padding.
- [x] Empty state still renders when a tab has no tracks.
- [x] Resizing the browser between pages still updates the threshold via
`ResizeObserver` (no regression to existing behavior).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>1 parent de7e3f9 commit 380e538
1 file changed
Lines changed: 52 additions & 38 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
| |||
30 | 29 | | |
31 | 30 | | |
32 | 31 | | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | 32 | | |
40 | 33 | | |
41 | 34 | | |
| |||
208 | 201 | | |
209 | 202 | | |
210 | 203 | | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | 204 | | |
217 | 205 | | |
218 | 206 | | |
| |||
254 | 242 | | |
255 | 243 | | |
256 | 244 | | |
257 | | - | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
258 | 248 | | |
259 | 249 | | |
260 | 250 | | |
261 | | - | |
262 | | - | |
| 251 | + | |
| 252 | + | |
263 | 253 | | |
264 | 254 | | |
265 | 255 | | |
| |||
281 | 271 | | |
282 | 272 | | |
283 | 273 | | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
284 | 295 | | |
285 | 296 | | |
286 | 297 | | |
| |||
359 | 370 | | |
360 | 371 | | |
361 | 372 | | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
371 | 379 | | |
372 | 380 | | |
373 | | - | |
| 381 | + | |
374 | 382 | | |
375 | 383 | | |
376 | 384 | | |
| |||
386 | 394 | | |
387 | 395 | | |
388 | 396 | | |
389 | | - | |
| 397 | + | |
390 | 398 | | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | 399 | | |
400 | 400 | | |
401 | 401 | | |
| |||
440 | 440 | | |
441 | 441 | | |
442 | 442 | | |
443 | | - | |
444 | | - | |
445 | | - | |
446 | | - | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
447 | 461 | | |
448 | 462 | | |
449 | 463 | | |
| |||
0 commit comments