Repository navigation
Open chat history at a pinned message or reply, then scroll to the present (GRYT-1686) - #812
Merged
Merged
Conversation
…esent (GRYT-1686) Jumping to an old pin or reply quote loaded every page in between and gave up after 1,000 messages. On a server with server#282, it now asks for the page around that message and opens history there. Scrolling down loads newer pages. A bar saying "You're looking at older messages" has a Jump to present button. The window is its own list (useHistoryWindow) on top of the channel's. useChat keeps the channel list in step with a cache that always runs up to the newest message, so a list with a gap in it can't live there. Edits, reactions and deletions still reach the window. New messages don't, because they belong at the present. When the window's newer pages reach the present, it merges into the cache and goes away. Sending a message, or switching conversation, leaves it as well. On a server without `around`, the answer is the newest page. The client recognises that and falls back to the 1,000-message search from #811. MLS DMs use that search too, because their timeline is merged with an archive. useChatScroll loads newer pages near the bottom of a window, and stops holding the view at the bottom there, since a window's last row isn't the present. Jump to present scrolls instantly. A smooth scroll from the top crossed the load-older line, and the prepend that followed stopped it short. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The check runs the ResizeObserver effect's source with the refs it reads. That effect now also reads detachedRef, so the check passes one, and a new case confirms an old window isn't held at its bottom. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
The client half of opening chat history at any message. Task: GRYT-1686. The server half is server#282. Without it, this falls back to the 1,000-message search from #811, so it can merge first.
What it does
How
useHistoryWindowkeeps the window as its own list on top of the channel's.useChatre-syncs the channel list from a cache that always runs up to the newest message, so a list with a gap can't live in it.useChatleaves window pages (around,after, orbeforewhile a window is open) to the window, and shows the window's list, older-page loader andhasOlderwhile it's open.useChatScrollloads newer pages within 200px of the bottom of a window. Inside a window it no longer auto-scrolls on a changed last row, and the ResizeObserver stops holding the bottom.useJumpToMessagetriesopenAtfirst. It falls back to paging older history when the answer isunsupported, and says the message is gone when it'smissing.Checked
In a headless browser against a seeded channel (220 messages, a pin on the 4th):
around): falls back to paging, and the message is in view after about 4 s.yarn lintpasses.Look at
useChatchanges are small but sit on the path every channel uses. Nothing changes untilopenAtis called:historyWindow.messagesisnull, and every branch falls through to the old values.mergeTimeline). They get the paging search.aroundwith the newest page. If a normal latest-page fetch, from a reconnect for instance, lands while a jump is waiting, the jump reads it as "unsupported" and pages instead. It still finds the message, just more slowly.🤖 Generated with Claude Code