Skip to content

fix(web): hide jump to latest once a closed fold brings the end back - #781

Merged
nixuuu merged 1 commit into
devfrom
fix/feed-jump-after-fold
Nov 15, 2026
Merged

nixuuu merged 1 commit into
devfrom
fix/feed-jump-after-fold

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 15, 2026

Copy link
Copy Markdown
Member

What was wrong

Opening a tool fold at the end of a thread (keep()) stops following the end, so the fold's header keeps its place while its rows grow below it. Closing the fold shrank the feed back so the end was on screen again (or nothing scrolled at all), but following stayed off, so "Jump to latest" kept showing with nothing below it.

Fix

  • FeedExtent (apps/web/src/lib/shared/ui/virtual/feed-extent.svelte.ts) measures the scroll height at each settle. When the rows shrank and the end is within FEED_END_THRESHOLD, the feed follows the end again. Only shrinking does this: a fold that opens grows towards the end, and its header still keeps its place.
  • With nothing to scroll, the button never shows and atEnd is true (seen marking, composer fold).

Checks

  • Chromium (headless) on /dev/long-thread?turns=1 with the disposable bench stack, viewport heights 600–900 px, open and close the last turn's fold:
    • before: the button stayed after closing;
    • after: it goes away once the end is back on screen, and stays when there is still something to scroll below;
    • when the fold opens, its header stays exactly where it was (unchanged from before).
  • bun install, bun run gen:check, bun run typecheck, bun run lint, bun run format:check, web build: clean.
  • bun run check:tmp: 3162 pass, nothing left in the temp dir; 2 failures from the local environment, unrelated to the web: worker-profile-env.test.ts picks up CANOPY_SUPERVISED from the session (passes without it) and codex/connections.test.ts hits the locally installed Codex CLI refusing a provider change on resume.

Copy audit (docs/copy.md §8)

No UI text added or changed.

🤖 Generated with Claude Code

Opening a tool fold stops following the end so its header keeps its place.
Closing it again shrank the feed back to the end, but following stayed off,
so "Jump to latest" showed with nothing below. The feed now follows the end
again when its rows shrink and the end is on screen, and never shows the
button when there is nothing to scroll.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@nixuuu
nixuuu merged commit a9e90cf into dev Nov 15, 2026
11 checks passed
@nixuuu
nixuuu deleted the fix/feed-jump-after-fold branch November 15, 2026 02:05
nixuuu added a commit that referenced this pull request Nov 28, 2026
## Change

A fast jump through a thread could leave several “Show earlier work”
buttons on screen until the next upward gesture. Web and desktop now
fetch a page when a gap or the start of the loaded history comes within
240 CSS pixels of the reading area. The feed waits for its initial
position, then rechecks the current window after each page. Failed reads
expose the existing retry action.

When older rows turn out shorter than their estimates, the feed restores
the reading anchor before it decides whether to follow the end. This
keeps the same message on screen across consecutive reads.

## Verification

- Exercised the real thread route in Chromium with 96 turns and 1,112
items. After Home, five sequential reads filled all six visible gaps
with the first prompt moving less than one pixel. Also checked a fast
wheel gesture at 390 px wide.
- Approached a gap from each direction. Requests started with the gap
still offscreen and stopped outside the margin. A short thread with a
visible gap loaded on opening. An HTTP 503 paused automatic reads until
Retry.
- Kept an answer within half a CSS pixel of its position through four
pages of a 540-command turn. Closing the last work fold still resumed
following at the end.
- Web typecheck, lint on changed files and 15 existing history and
scroll tests passed locally. Repository-wide checks and selected builds
run in CI.

Fixes: #1049
Fixes: #781
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant