feat: add jump-to-message with highlight animation#95
Open
sanasol wants to merge 2 commits intostoatchat:devfrom
Open
feat: add jump-to-message with highlight animation#95sanasol wants to merge 2 commits intostoatchat:devfrom
sanasol wants to merge 2 commits intostoatchat:devfrom
Conversation
Signed-off-by: sanasol <[email protected]> Signed-off-by: sanasol <[email protected]>
ca523f9 to
dda158a
Compare
This was referenced Mar 4, 2026
When the WS connects (including first connection), pushReconnectEvent() triggers loadMessages(50, ignoreExisting=true). If the initial load already fetched the same messages, ignoreExisting filters them all out, producing an empty list that updateItems() uses to clear the channel. Skip the update entirely when ignoreExisting yields no new messages. Signed-off-by: sanasol <[email protected]>
Author
|
Note: The second commit also fixes a pre-existing bug (not introduced by this PR) where the channel would sometimes appear empty on fresh app start. Root cause: Fix: Early return when |
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.
Summary
Adds the ability to click message links (e.g.
# General › 💬badges in markdown) and jump to the referenced message with a visual highlight.Routing:
SwitchChannelToMessageaction in ActionChannel for message-specific navigationpendingScrollToMessageIdstateLink parsing (JBMRenderer):
/server/ID/channel/ID/ID)# Generalinstead of full URL)Scroll + highlight:
scrollToItem(index + 1)thenanimateScrollBy(-viewportHeight / 2f)to center the target in reverseLayoutjumpToMessage()loads messages around the target from APIdrawWithContent(3 pulses at 0.55→0.20 alpha, settle at 0.30, 3s hold, 1s fade out)ViewModel enhancements:
isInMiddleOfHistory/reachedLatest/newestLoadedMessageIdstate for bidirectional paginationjumpToMessage(),returnToLatest(),loadNewerMessages()methodsswitchChannel()now accepts optionaltargetMessageIdfor initial scrollaroundparameter support inloadMessages()with proper sort orderFixes #23, related to stoatchat/for-web#891
Tested and live on https://chat.sanhost.net — app at https://chat.sanhost.net/downloads/