Skip to content

feat(tui): count blocks arriving below a scrolled view in the follow hint - #234

Merged
Max17190 merged 2 commits into
tui-turn-end-notificationfrom
tui-follow-state-unread
Aug 27, 2026
Merged

feat(tui): count blocks arriving below a scrolled view in the follow hint#234
Max17190 merged 2 commits into
tui-turn-end-notificationfrom
tui-follow-state-unread

Conversation

@Max17190

@Max17190 Max17190 commented Aug 27, 2026

Copy link
Copy Markdown
Owner

Why

A reader scrolled up has no way to know whether anything landed at the bottom; the hint says only how to get back. Forced or silent follow behavior is the largest complaint class in comparable terminal frontends.

Summary

Count blocks appended while the view is scrolled up and render the count ahead of the re-arm hint (N new · esc follow · pgup/pgdn scroll). The count clears whenever the view reaches the bottom, so a later scroll-up starts from zero instead of resurrecting content already seen. Chat dirt promotes a chrome repaint while a count shows, so the status line never goes stale.

Test Plan

  • unread_counts_blocks_while_scrolled_and_clears_at_the_bottom (transcript state machine, incl. no-resurrect).
  • scrolled_hint_counts_blocks_arriving_below (hint text, chrome promotion, no-resurrect at the app layer).
  • Both shown red with the counter neutered. Workspace tests and clippy clean.

Greptile Summary

Adds an unread-block count to the follow hint when completed transcript blocks arrive below a scrolled view. Returning to the latest content clears the count, and status chrome continues to repaint through the existing chat invalidation path.

Confidence Score: 5/5

No blocking failure remains.

Focused checks confirmed unread blocks increment while the view is scrolled, clear when the view reaches the bottom, and appear in the status hint. The full TUI test suite also completed successfully with 248 passing tests and 6 ignored tests.

T-Rex T-Rex Logs

What T-Rex did

  • Ran focused Rust tests covering unread block counting, unread clearing on return to bottom, status-hint rendering, and chat-to-chrome invalidation.
  • Observed that two appended blocks while scrolled up produce an unread count of 2; returning to offset 0 clears it; a later scroll-up starts from 0; a new arrival increments it to 1; and follow clears it.
  • Observed the status hint '↓ 2 new · esc follow · pgup/pgdn scroll', and noted that Dirty::mark_chat marks chat, tail, and chrome.
  • Confirmed the draw path contains neither a draw-time mark_chrome() call nor unread-specific chrome promotion.
  • Ran the full current TUI test suite: 248 tests passed, 6 were ignored, and none failed.

View all artifacts

T-Rex Ran code and verified through T-Rex

Reviews (2): Last reviewed commit: "fix(tui): drop the draw-time chrome prom..." | Re-trigger Greptile

@Max17190
Max17190 marked this pull request as ready for review August 27, 2026 03:53
…hint

A reader scrolled up had no way to know whether anything new landed at
the bottom; the hint said only how to get back. Count blocks appended
while the offset is off the floor and render the count ahead of the
re-arm hint. The count clears whenever the view reaches the bottom,
so a later scroll-up starts from zero instead of resurrecting content
already seen, and chat dirt promotes a chrome repaint while a count is
showing so the status line never goes stale.
@Max17190
Max17190 force-pushed the tui-follow-state-unread branch from 895daf9 to ed7174f Compare August 27, 2026 03:55
Comment thread crates/tui/src/app.rs Outdated
…ntees

Every path that dirties chat goes through Dirty::mark_chat, which marks
chrome for exactly the reason the promotion cited; the invariant test now
says the unread hint depends on it.
@Max17190
Max17190 merged commit 154c061 into main Aug 27, 2026
4 checks passed
@Max17190
Max17190 deleted the tui-follow-state-unread branch September 4, 2026 02:06
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