Open
Conversation
The previous overscroll-based gesture (rubber-banding past the top) was essentially invisible — there was no UI hint and users saw a truncated conversation with no indication that more history existed. We now detect when the scroll position is within 300px of the top and automatically load the next 80 turns. A ScrollState observer tracks document view frame changes and incrementally adjusts the scroll offset so the visible content stays pixel-perfect in place, even while the user is still scrolling with momentum. Chained loads continue until all history is loaded or the viewport moves away from the top. To prevent false triggers during the initial scroll-to-bottom animation, auto-loading is armed after a 500ms delay that resets on session switches.
We were using the sequential turn index as the ForEach identity, but this index shifts whenever new turns are appended to the JSONL file, causing SwiftUI to see all-new IDs and re-render the entire list. The viewport would jump even when the user had scrolled away from the bottom. We now use the file line number, which is stable — appending new lines never changes existing line numbers. This keeps the viewport in place when new turns arrive, while still following new content when the user is already at the bottom. Amends 0d66aa7.
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.
No description provided.