fix(tui): load full transcript before PgUp/Home from scrollback tail#132
Merged
Conversation
When most of the transcript has already been emitted to native scrollback (nativeScrollbackPrinted near len(transcript)), the follow-tail refresh trims messages to nativeScrollbackPrinted: for performance. Pressing PgUp or Home from the live tail then scrolled within that tiny window, landing on the startup banner instead of the actual history. Fix by introducing loadFullChatForScroll() which loads the complete transcript (via chatMessages() instead of the trimmed chatViewportMessages()) and anchors it at the bottom, so the subsequent chat.PageUp() / chat.ScrollToTop() walks the real history.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When most of the transcript has already been emitted to native scrollback (
nativeScrollbackPrintednearlen(transcript)), pressing PgUp or Home from the live tail scrolled within the trimmed message window and landed on the startup banner instead of real history.What changed
loadFullChatForScroll()inchat_viewport.go— loads the complete transcript viachatMessages()(bypassing thenativeScrollbackPrintedtrim) and anchors it at the bottom.history_nav.go— calls the new method before the scroll action so the subsequentchat.PageUp()/chat.ScrollToTop()walks the real history.TestPageUpAtTailRevealsTranscriptAboveScrollbackBoundary— verifies that PgUp from tail exposes entries above the scrollback boundary, not just the trimmed window.Why not change
refreshViewportContentFollow?The follow-tail refresh must keep trimming for performance on streaming/append paths. The full-load is intentionally a one-shot pre-scroll step.