Repository navigation
fix(chat): land message jumps centred on the target - #1136
Merged
Merged
Conversation
A jump far up a transcript stopped short of the target. scrollToItem worked out the offset from the 56pt estimate for rows that had never been on screen, and nothing re-anchored once those rows self-sized, so in a chat of photos the target ended up above the visible area. The jump now centres the row through a ChatLayout position snapshot, recomputed from the row's measured height on each pass. The non-animated jump re-anchors once more on the next runloop turn. The animated jump measures its destination first, restores the reader's position, and scrolls to the measured offset, with a final re-anchor when it lands. In the new windowed test, the animated jump previously left the target 239pt above centre and the deferred jump left it off screen.
bmc08gt
marked this pull request as ready for review
October 26, 2026 18:47
bmc08gt
added a commit
that referenced
this pull request
Oct 26, 2026
* commit '28622a831ce5876c6165063aed9d4203292651df': feat(history): move the boost emoji and chat into the detail subtitle feat(history): show the boost on the detail header and receipt card feat(history): title boosted payments and link them to the boosted message fix(chat): land message jumps centred on the target (#1136) # Conflicts: # FlipcashCore/Sources/FlipcashStore/Database.swift
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.
Jumping to a message far up a transcript stopped several messages short of it.
flipcash://chat/12e1d342-…/m/109in a photo-heavy group landed on a post from the next morning instead of the 1:39 PM photo it names. It affects deep links, quote taps and boost detail's View Message, since they all end inChatViewController.scrollToRow.scrollToRowcalledscrollToItem(at:at: .centeredVertically)once. The offset came from ChatLayout's 56pt estimate for every row that had never been on screen, and nothing re-anchored after those rows self-sized. With photos several times that height, the target ended up above the visible area.scrollToBottomandscrollToRowTopalready re-anchor through a position snapshot on the next runloop turn; the jump had no such pass.Changes, all in
ChatViewController:centerRow(at:)centres a row with aChatLayoutPositionSnapshotworked out from the row's current height, top-aligning a row taller than the screen.scrollToMessage_tallRows_landsCentred(animated:)drives a windowed transcript of rows several times the estimate. Before the fix, the animated jump left the target 239pt above centre and the deferred jump left it off screen. Both cases now pass, along with the rest ofChatViewControllerTestsandChatReplyReturnTests.