fix: auto-scroll to bottom when sending messages#56
Open
TigerInYourDream wants to merge 2 commits intomainfrom
Open
fix: auto-scroll to bottom when sending messages#56TigerInYourDream wants to merge 2 commits intomainfrom
TigerInYourDream wants to merge 2 commits intomainfrom
Conversation
When new items are appended to the timeline, check if the last item was sent by the current user. If so, scroll to the bottom so the user always sees their own sent message — regardless of current scroll position. Closes #55
fb51812 to
d810f4f
Compare
…o-scroll Replace the indirect "check if last timeline item sender is current user" approach with a direct MessageSubmittedLocally action emitted from room_input_bar at send time. This follows Makepad's widget action communication pattern and avoids async timing dependencies.
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
When a user sends a message (text or location), the timeline should automatically scroll to the bottom so the sent message is visible — matching the behavior of WeChat, Telegram, and other chat apps.
Approach
MessageAction::MessageSubmittedLocallyaction, emitted directly fromroom_input_bar.rsat send timeroom_screen.rshandles this action by scrolling to the last timeline item and enabling tail-range modeWhy this approach is better
process_timeline_updates()cx.widget_action()communication patternChanges
src/room/room_input_bar.rs: EmitMessageSubmittedLocallyafter both location send and text sendsrc/home/room_screen.rs: Handle the action withset_first_id_and_scroll()+set_tail_range(true), remove old sender-matching logicTest plan