Skip to content
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

[🐴] Finalize web message screen #3868

Merged
merged 28 commits into from
May 6, 2024
Merged

[🐴] Finalize web message screen #3868

merged 28 commits into from
May 6, 2024

Conversation

haileyok
Copy link
Contributor

@haileyok haileyok commented May 5, 2024

Stacked on #3866 and #3867

Why

Web requires a little extra logic for maintaining scroll position whenever we load new items at the top of the list. This PR adds a little check whenever the content size changes to see if:

  1. We are at the top of the scroll view
  2. We have already scrolled at least once (the first scroll takes us to the bottom of the page)

If we meet those criteria, we immediately scroll to the previous offset whenever new items get added to the list.

We also remove an unnecessary wrapper around the List that has become unnecessary after changes in the other two PRs.

Without whitespace

Test Plan

  1. Load the messages in a large chat. Verify that you start at the bottom of the conversation.
  2. Scroll up to the top. Verify that you see a spinner, and then new messages are added without causing your position to jump.
  3. Verify that new messages can be added to the chat while you are scrolled away from the bottom without causing jumps in position.
Screen.Recording.2024-05-05.at.1.52.50.AM.mov

Copy link

github-actions bot commented May 5, 2024

Old size New size Diff
6.87 MB 6.87 MB 1.46 KB (0.02%)

Copy link
Member

@estrattonbailey estrattonbailey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on web and Android, looks great

Base automatically changed from further-align-web-list-with-flatlist to main May 6, 2024 15:34
# Conflicts:
#	src/view/com/util/List.web.tsx
#	src/view/screens/Storybook/ListContained.tsx
Copy link

render bot commented May 6, 2024

@haileyok haileyok merged commit ae7626c into main May 6, 2024
6 checks passed
@haileyok haileyok deleted the hailey/messages-list-web branch May 6, 2024 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants