Posts stay put after a jump: picture sizes up front, the current post pinned #273

Merged
littlefox merged 2 commits from issue-229-settle into main 2026-10-22 08:40:47 +00:00
Owner

Closes #229

Posts "settled" after a jump: pictures had no size until they loaded, and the scroll to the current post waited a frame and then lost its place as content above it grew.

  • Picture sizes are read from the image header (PNG, GIF, BMP, JPEG, WebP) and set as width/height, so a picture takes its place before it loads.
  • The jump to the current post happens right away, and a ResizeObserver keeps the post in place while things above it grow. It lets go on the first scroll by someone else, or after 5 s.

Verified: new e2e/tests/settle.spec.ts measures how far the post drifts after the jump. It drifted 230–1300 px, then about 75 px; now it drifts 8, 0, 0, 0 px (limit 10). Full suite on the branch with main merged: 338 passed. Unit tests for the header parsing; clippy three ways.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XJW2ocwLunyaLiUwCBHEP8

Closes #229 Posts "settled" after a jump: pictures had no size until they loaded, and the scroll to the current post waited a frame and then lost its place as content above it grew. - Picture sizes are read from the image header (PNG, GIF, BMP, JPEG, WebP) and set as width/height, so a picture takes its place before it loads. - The jump to the current post happens right away, and a ResizeObserver keeps the post in place while things above it grow. It lets go on the first scroll by someone else, or after 5 s. Verified: new `e2e/tests/settle.spec.ts` measures how far the post drifts after the jump. It drifted 230–1300 px, then about 75 px; now it drifts 8, 0, 0, 0 px (limit 10). Full suite on the branch with main merged: 338 passed. Unit tests for the header parsing; clippy three ways. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01XJW2ocwLunyaLiUwCBHEP8
After 'Läs nästa' in a long thread the new post was drawn where its card
was for a frame and then scrolled to the top (~75 px every step), and on
entering a thread the cards above it filling in pushed it down by
hundreds of pixels. Now it is scrolled at once, then held in place while
its thread, cards and pictures come in, until the reader scrolls or five
seconds pass. Pictures take their size from their headers, so their room
is kept before they're drawn.

settle.spec (Sara, new in the seed, reading Stor tråd) measures the move:
8, 0, 0, 0 px; before, 230-1 300 px on the first step and ~75 px after.

Closes #229

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XJW2ocwLunyaLiUwCBHEP8
Merge remote-tracking branch 'origin/main' into issue-229-settle
All checks were successful
ci / check (push) Successful in 10m8s
ci / desktop (push) Successful in 15m59s
ci / e2e (push) Successful in 31m42s
346998fd52
littlefox referenced this pull request from a commit 2026-10-22 14:11:06 +00:00
Sign in to join this conversation.
No description provided.