-
Notifications
You must be signed in to change notification settings - Fork 984
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Maintain scroll position after fetching gap #8025
Conversation
Jenkins BuildsClick to see older builds (13)
|
54fb59a
to
3ed3c3b
Compare
(defview gap [{:keys [ids]}] | ||
(defview gap | ||
[ids idx list-ref in-progress? connected?] | ||
[react/view {:align-self :stretch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move to styles?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ehm, let me finish with desktop first, and other related PRs. I'm sure it will be changed 2-3 times during next PRs. It's just simplier to keep everything in one place for now
@hesterbruikman that's the best I can propose without spending too much time on this task |
Tested when "Fetching messages" (IOS 11.4.1, IPhone 7, Android 8, LG V20) is close to the top and to the bottom of the screen, and somewhere in the middle. Ready to merge from my after e2e |
98% of end-end tests have passed
Failed tests (1)Click to expand
Passed tests (47)Click to expand
|
failed e2e is due to an infrastructure issue, not related to PR |
Signed-off-by: Igor Mandrigin <i@mandrigin.ru>
cefe634
to
3a2d702
Compare
Pull Request Checklist
|
previously the gap was shown before the first message which has
timestamp
higher than gap'sfrom
; in this PR the gap is shown after all messages whichtimestamp
is lower than gap, also after messages which are inside the gap and before the first message whichtimestamp
is higher than gap'sto
.before:
after:
This minimizes chances that requested messages will be rendered between messages B and C instead of rendering between gap and C. In result, we can scroll to message C before loading and bottom side of the chat will maintain the same position after fetching messages (no guaranty but higher chances).
Before fetching the gap, the list is scrolled so that the next message after the gap (message C in the example above) is placed in the center of the screen. In this case, after rendering of the newly fetched messages, the user will still be able to see older, already seen messages along with new rendered messages which will replace gap above that "message C"
In some cases the app will behave properly without these changes, it depends on a number of referenced messages which are fetched and have to be rendered in responses. Also, messages like
B
might not be present in the chat's history.status: ready