Skip to content

fix(viewer): keep tail-first follow attached#15

Merged
siriusctrl merged 1 commit into
mainfrom
agent/fix-tail-follow-detach
Jul 22, 2026
Merged

fix(viewer): keep tail-first follow attached#15
siriusctrl merged 1 commit into
mainfrom
agent/fix-tail-follow-detach

Conversation

@siriusctrl

Copy link
Copy Markdown
Owner

Summary

  • keep tail-first live timelines attached on their first rendered frame when pretty JSON adds a sticky breadcrumb
  • preserve the existing one-draw tail guard for snapshots and paused views while giving active follow and explicit reattach exact-tail pins precedence
  • add backend-neutral coverage for wrapped, unwrapped, narrow-height, older-prepend, append, detach, reattach, pause, and resume behavior
  • document the user-visible fix under Unreleased

Root cause

A tail-first viewer begins with both preserve_tail_on_next_draw and FollowState::Following. During sticky-layout convergence, the exact live tail was computed and pinned, then the older one-draw preserved position overwrote it. When the JSON breadcrumb changed the visible height, the viewport ended one row before the recomputed tail and the render state immediately became follow:detached.

The fix makes active follow or explicit reattach tail pins authoritative. Paused follow and ordinary snapshot preservation are unchanged.

Validation

  • regression first failed on the 0.6.1 implementation with follow:detached, then passed with the fix
  • cargo fmt --all --check
  • cargo check --workspace --all-targets --locked
  • cargo clippy --workspace --all-targets --locked -- -D warnings
  • cargo test --workspace --all-targets --locked: 384 passed, 0 failed, 13 ignored
  • record timeline suite: 60 passed
  • load performance smoke, growing-record-stream/follow, 3 samples: median 3.025 ms
  • real 120x34 PTY smoke using the release binary showed the committed tail marker with follow:on and clean terminal exit

PTY evidence remains under ignored target/ and is not part of the PR. No release, tag, or publish action is included.

Give an active follow or explicit reattach tail pin precedence over the one-draw tail-preservation guard. This prevents pretty JSON breadcrumbs from shrinking the first viewport after layout and immediately detaching a live timeline.

Cover wrapped, unwrapped, narrow, older-prepend, detach, reattach, pause, resume, and appended-record behavior with backend-neutral timeline tests.
@siriusctrl
siriusctrl marked this pull request as ready for review July 22, 2026 13:00
@siriusctrl
siriusctrl merged commit 3f570c7 into main Jul 22, 2026
1 check passed
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