Skip to content

Make Auto-scroll actually follow the live stream - #50

Merged
laomou merged 2 commits into
mainfrom
fix/auto-scroll-follow-tail
Aug 6, 2026
Merged

Make Auto-scroll actually follow the live stream#50
laomou merged 2 commits into
mainfrom
fix/auto-scroll-follow-tail

Conversation

@laomou

@laomou laomou commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Summary

The Auto-scroll checkbox was dead state — auto_scroll was written by the checkbox but never read anywhere. During adb streaming or file tailing, new rows piled up below the viewport while the view stayed frozen. This breaks the core "watch a live logcat" workflow.

Fix

Wire it to the table's stick_to_bottom(self.auto_scroll). egui's stick-to-bottom:

  • pins to the bottom only while the view is already there
  • releases the instant the user scrolls up (no fighting manual scroll)
  • defers to an explicit scroll_to_row (goto / arrow keys / bookmark jump)

So it follows the tail like tail -f / Android Studio logcat, without hijacking navigation.

Notes

  • This is GUI scroll behavior, validated via egui source semantics + all tests. Worth a quick visual sanity-check when watching a live adb stream.
  • Opening a static file with Auto-scroll on now lands at the newest line (bottom); scroll up (releases follow) or uncheck Auto-scroll to browse from the top.

Test plan

  • All 103 tests pass, including open_file_tails_appended_lines_without_moving_scroll (the fix works via the scroll area's offset, not pending_scroll, so that assertion still holds)
  • Watch a live adb logcat stream — view follows new lines; scrolling up pauses following; scrolling back to bottom resumes

laomou added 2 commits August 6, 2026 19:08
The "Auto-scroll" checkbox was dead state: `auto_scroll` was written by
the checkbox but never read, so during adb streaming or file tailing new
rows piled up below the viewport while the view stayed frozen.

Wire it to the table's `stick_to_bottom(self.auto_scroll)`. egui pins to
the bottom only while the view is already there, releases the instant the
user scrolls up, and defers to an explicit scroll_to_row (goto/arrows), so
it follows the tail without fighting manual navigation.
egui's stick_to_bottom only re-engages once the view is already at the
end, so flipping Auto-scroll on while scrolled up did nothing until you
manually scrolled back down. Detect the toggle and request a jump to the
last row so the switch takes effect immediately.
@laomou
laomou force-pushed the fix/auto-scroll-follow-tail branch from 09de2a0 to 860d91b Compare August 6, 2026 11:09
@laomou
laomou merged commit f0bb358 into main Aug 6, 2026
3 checks passed
@laomou
laomou deleted the fix/auto-scroll-follow-tail branch August 6, 2026 11:12
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