Posts and threads settle or jitter a bit before they stop #229

Closed
opened 2026-10-21 19:04:39 +00:00 by littlefox · 4 comments
Owner

Reported by the user (D-057). After "Läs nästa", after moving to the next channel, or after clicking "Visa fler"/"show replies", the post or thread moves a little before it settles. The user can't reproduce it reliably.

Candidates:

  • The scroll-to-current effect in app/src/main_view/mod.rs (view_key): it scrolls in a requestAnimationFrame when the post is shown, and again when the thread arrives around it. Each preview or picture that loads afterwards changes the height above the current post, so the post moves.
  • Cards render without their content first (preview None) and then grow when the preview comes in.
  • Pictures without width and height move the layout when they load.
  • "Visa fler" adds cards and then reloads the thread (the opened signal), so it can render twice.

Directions:

  • overflow-anchor / scroll anchoring on the current card.
  • Reserve the height for cards and pictures.
  • Render a thread once, when the cards above the current post are ready.

A test: record the current post's position for a second after each of the three actions (as show-more.spec already does for the button holder) and require it to stay still.

Reported by the user (D-057). After "Läs nästa", after moving to the next channel, or after clicking "Visa fler"/"show replies", the post or thread moves a little before it settles. The user can't reproduce it reliably. Candidates: - The scroll-to-current effect in `app/src/main_view/mod.rs` (`view_key`): it scrolls in a `requestAnimationFrame` when the post is shown, and again when the thread arrives around it. Each preview or picture that loads afterwards changes the height above the current post, so the post moves. - Cards render without their content first (preview `None`) and then grow when the preview comes in. - Pictures without width and height move the layout when they load. - "Visa fler" adds cards and then reloads the thread (the `opened` signal), so it can render twice. Directions: - `overflow-anchor` / scroll anchoring on the current card. - Reserve the height for cards and pictures. - Render a thread once, when the cards above the current post are ready. A test: record the current post's position for a second after each of the three actions (as `show-more.spec` already does for the button holder) and require it to stay still.
Author
Owner

Narrowed 2026-10-21: #242 replaces these views, so fix the causes that are shared (pictures without reserved size, cards growing when their preview arrives, scrolling before the thread has loaded) and keep anything view-specific small. Anchoring itself belongs to the windowed list of #236.

Narrowed 2026-10-21: #242 replaces these views, so fix the causes that are shared (pictures without reserved size, cards growing when their preview arrives, scrolling before the thread has loaded) and keep anything view-specific small. Anchoring itself belongs to the windowed list of #236.
Author
Owner

Another symptom, from CI run #400: a post opened on its own (by number) is drawn once, then drawn again inside its thread when the thread arrives. Anything the reader did in between is lost; time.spec saw a tap on the time label vanish (#249). Rendering the post once, inside the thread, when the thread is ready would fix both.

Another symptom, from CI run #400: a post opened on its own (by number) is drawn once, then drawn again inside its thread when the thread arrives. Anything the reader did in between is lost; `time.spec` saw a tap on the time label vanish (#249). Rendering the post once, inside the thread, when the thread is ready would fix both.
Author
Owner

Possibly the same again (full e2e run for #251, iPhone, passed on retry): mute.spec clicked "Följ tråden" in a post's menu right after the post was shown, and nothing happened (the status still said "Visar inlägg 59."). A click landing while the post is being drawn again is lost.

Possibly the same again (full e2e run for #251, iPhone, passed on retry): mute.spec clicked "Följ tråden" in a post's menu right after the post was shown, and nothing happened (the status still said "Visar inlägg 59."). A click landing while the post is being drawn again is lost.
Author
Owner

Merged in #273 (main #456 green). Pictures get their width/height from the image header, so they keep their room before they load. The jump to the current post now happens right away, and the post is held in place while content above it grows, until someone else scrolls or 5 s pass. Verified with the new e2e/tests/settle.spec.ts, which measures drift after the jump: 230–1300 px, then about 75 px before; 8, 0, 0, 0 px now (limit 10). Full suite on the branch with main merged: 338 passed.

Merged in #273 (main #456 green). Pictures get their width/height from the image header, so they keep their room before they load. The jump to the current post now happens right away, and the post is held in place while content above it grows, until someone else scrolls or 5 s pass. Verified with the new e2e/tests/settle.spec.ts, which measures drift after the jump: 230–1300 px, then about 75 px before; 8, 0, 0, 0 px now (limit 10). Full suite on the branch with main merged: 338 passed.
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#229
No description provided.