Skip to content

fix(view): keep snapshots anchored at the lazy tail#11

Merged
siriusctrl merged 1 commit into
agent/embedding-facadefrom
review/embedding-facade
Jul 22, 2026
Merged

fix(view): keep snapshots anchored at the lazy tail#11
siriusctrl merged 1 commit into
agent/embedding-facadefrom
review/embedding-facade

Conversation

@siriusctrl

Copy link
Copy Markdown
Owner

What changed

  • distinguish a tail-anchored initial window from live follow state through the backend-neutral ViewFile::starts_at_tail capability
  • open snapshots on the actual newest viewport while keeping follow controls disabled
  • arm bounded older preload only after backward navigation intent, including the one-record/fully-visible tail edge case
  • stop older preload again after G/End returns to the tail, without changing follow detach/pause/reattach behavior
  • remove the unreleased ViewOptions::notice field because it routed ordinary embedder text through the existing red error-notice path
  • add deterministic snapshot, navigation, non-TTY, and downstream API coverage

Why

The facade loaded the newest record batch but initialized non-follow snapshots at local line zero. A large initial batch therefore opened at the oldest visible record in that batch. Idle preload could also walk backward before the user requested history. Conversely, simply guarding preload with the current viewport state would strand a fully visible one-record tail because PageUp cannot move its local line number.

The new state separates three concerns: where the source initially anchors, whether it follows live appends, and whether the user has asked to load older history.

Validation

  • cargo fmt --all --check
  • cargo check --workspace --all-targets --locked
  • cargo clippy --workspace --all-targets --locked -- -D warnings
  • cargo test --workspace --all-targets --locked
  • cargo test --workspace --doc --locked
  • RUSTDOCFLAGS='-D warnings' cargo doc --workspace --no-deps --locked
  • downstream temp crate compiles with only the fmtview dependency
  • cargo publish -p fmtview-core --dry-run --locked --allow-dirty
  • root package contents created with cargo package -p fmtview --locked --allow-dirty --no-verify
  • PTY smoke confirmed alternate-screen/mouse/synchronized-update enter+leave ordering, raw/structured toggle, zero exit, and restored stty
  • real Kitty/Xvfb recording exercised scroll, search, structure jumps, and clean quit; contact sheet inspected with no blank startup, clipping, stale cells, or false error notice

Full root tarball verification still requires the normal release sequence: publish the next matching fmtview-core version before verifying/publishing the root crate. The current published fmtview-core 0.6.0 does not contain the new snapshot constructor from the base PR.

Separate initial tail anchoring from follow state and arm bounded older preload only after backward navigation intent.

Remove the misleading public notice option, which rendered ordinary embedder text as an error.
@siriusctrl
siriusctrl marked this pull request as ready for review July 22, 2026 10:20
@siriusctrl
siriusctrl merged commit 943a4fb into agent/embedding-facade 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