Open
Conversation
Add a marker to indicate new messages since the last time the room was read. Some extra features along with this: - Jump to last read when a room is opened - Handle rate limiting and other errors when this happens - Double tap message to reply - Highlight messages replying to you or mentioning you
Airyzz
requested changes
Mar 25, 2026
| } | ||
|
|
||
| WidgetsBinding.instance.addPostFrameCallback((_) { | ||
| jumpToEvent(timeline.room.lastRead, highlight: false); |
Contributor
There was a problem hiding this comment.
jumping to the event post-frame causes a stutter when opening the timeline, as on the first visible frame the scroll location is different. it would be better to initialize to the correct position immediately, it should be possible by manipulating recentItemsCount
Contributor
Author
There was a problem hiding this comment.
I couldn't figure out how to fix this. Setting the offset directly doesn't really work because I couldn't reliably get it and calling the jump too early causes it to just not work or jump to the wrong event. I'm not sure how you mean for me to use recentItemsCount here, since the events could be of different heights and it doesn't account for the loading indicator.
commet/lib/ui/molecules/timeline_events/events/timeline_event_view_message.dart
Outdated
Show resolved
Hide resolved
commet/lib/ui/molecules/timeline_events/timeline_view_entry.dart
Outdated
Show resolved
Hide resolved
commet/lib/ui/molecules/timeline_events/timeline_view_entry.dart
Outdated
Show resolved
Hide resolved
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.
Add a marker to indicate new messages since the last time the room was read. Some extra features along with this:
There were some situations where I got a
RangeErrorbut I couldn't figure out where it was happening. It was rare enough that it didn't cause any major problems but that also made it really hard to reproduce. If it does happen, it's easy enough to get around by clicking jump to latest.