Desktop: scrolling up a big channel's thread list loads it all and hangs #314

Closed
opened 2026-10-23 18:38:31 +00:00 by littlefox · 1 comment
Owner

Reported by the user on the desktop app, latest main, kom.lysator.liu.se:

  1. Entered "Inlägg }t mig" (7000-odd unread).
  2. Clicked the channel name under a post's author, to the channel's presentation.
  3. "Visa inläggen": the thread list.
  4. Scrolled up, to see the "Trådar | Chatt | Klassiskt" switch.

CPU went up, the app stopped responding and then crashed.

Likely cause: when older threads are added above, the thread list relies on the browser to keep the place (CSS scroll anchoring). WebKit (WebKitGTK in the desktop app, Safari) has none, so the view stays at the very top. The top counts as near the screen again, so the next page loads, then the next, through the whole channel, fetching a card for every thread on the way (rows not yet measured count as near). The channel chat had a similar cascade, fixed in #286 with a guard; the thread list has no such guard.

Plan: keep the place ourselves, the same way in every browser; load older threads only after the reader scrolls, one page per approach to the top; a seeded channel with hundreds of threads; a spec that runs in WebKit too.

Reported by the user on the desktop app, latest main, kom.lysator.liu.se: 1. Entered "Inlägg }t mig" (7000-odd unread). 2. Clicked the channel name under a post's author, to the channel's presentation. 3. "Visa inläggen": the thread list. 4. Scrolled up, to see the "Trådar | Chatt | Klassiskt" switch. CPU went up, the app stopped responding and then crashed. Likely cause: when older threads are added above, the thread list relies on the browser to keep the place (CSS scroll anchoring). WebKit (WebKitGTK in the desktop app, Safari) has none, so the view stays at the very top. The top counts as near the screen again, so the next page loads, then the next, through the whole channel, fetching a card for every thread on the way (rows not yet measured count as near). The channel chat had a similar cascade, fixed in #286 with a guard; the thread list has no such guard. Plan: keep the place ourselves, the same way in every browser; load older threads only after the reader scrolls, one page per approach to the top; a seeded channel with hundreds of threads; a spec that runs in WebKit too.
littlefox added this to the 0.7: Threads milestone 2026-10-23 18:38:31 +00:00
Author
Owner

Fixed in #316 (plus the spec fix #323); main green (run #579).

  • Reproduced on the devserver with a new seeded channel, "Många trådar" (400 threads), in Chromium and in WebKit (the desktop app's engine). Before: one scroll to the top loaded all 400 threads, and WebKit loaded 300 just opening the list.
  • After: older threads load only once the list has been shown at its end and the page before is drawn. The window script keeps the reader's place itself, the same in every engine, by the row's number: it anchors on the first row that starts on screen, follows each row's size and the list's children, and gives a briefly missing anchor a frame to come back.
  • thread-list-big.spec.ts: three scrolls to the top load a page each, and the row that was at the top stays on screen. 12 of 12 runs here; green on CI.
  • Not tried on kom.lysator.liu.se (D-007); the seeded channel has the same shape.
Fixed in #316 (plus the spec fix #323); main green (run #579). - Reproduced on the devserver with a new seeded channel, "Många trådar" (400 threads), in Chromium and in WebKit (the desktop app's engine). Before: one scroll to the top loaded all 400 threads, and WebKit loaded 300 just opening the list. - After: older threads load only once the list has been shown at its end and the page before is drawn. The window script keeps the reader's place itself, the same in every engine, by the row's number: it anchors on the first row that starts on screen, follows each row's size and the list's children, and gives a briefly missing anchor a frame to come back. - `thread-list-big.spec.ts`: three scrolls to the top load a page each, and the row that was at the top stays on screen. 12 of 12 runs here; green on CI. - Not tried on kom.lysator.liu.se (D-007); the seeded channel has the same shape.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
littlefox/neokom#314
No description provided.