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

[🐴] 60 FPS Keyboard #4066

Merged
merged 8 commits into from
May 17, 2024
Merged

[🐴] 60 FPS Keyboard #4066

merged 8 commits into from
May 17, 2024

Conversation

haileyok
Copy link
Contributor

No description provided.

Copy link

render bot commented May 16, 2024

Comment on lines -226 to -232
requestAnimationFrame(() => {
if (isMomentumScrolling.value) return

flatListRef.current?.scrollToEnd({animated: true})
isMomentumScrolling.value = true
})
}, [isMomentumScrolling])
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since this is happening sync now, we don't need to use requestAnimationFrame here.

}

keyboardIsOpening.value = now !== prev
scrollTo(flatListRef, 0, contentHeight.value + now, false)
Copy link
Contributor Author

@haileyok haileyok May 16, 2024

Choose a reason for hiding this comment

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

Running scrollTo here within useAnimatedReaction will perform the scroll sync.

@@ -119,6 +131,7 @@ export function MessagesList() {
// really large - and the normal chat behavior would be to still scroll to the end if it's only one
// message - we ignore this rule if there's only one additional message
if (
!keyboardIsOpening.value &&
Copy link
Contributor Author

@haileyok haileyok May 16, 2024

Choose a reason for hiding this comment

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

We let the animated reaction handle this now, so never scroll on content size changes due to the keyboard opening.

Copy link

github-actions bot commented May 16, 2024

Old size New size Diff
6.82 MB 6.82 MB 52 B (0.00%)

@haileyok haileyok merged commit 8085116 into main May 17, 2024
6 checks passed
@haileyok haileyok deleted the hailey/60fps-keyboard branch May 17, 2024 00:12
estrattonbailey added a commit that referenced this pull request May 17, 2024
* origin/main:
  [🐴] Don't always show notification for everything (#4083)
  [🐴] Additional tweaks to the message list (#4075)
  Conditionally load unreads (#4072)
  Revert "Aggregate quickly-sent messages into batches (#4061)" (#4069)
  100% Real Deal™ (#4070)
  [🐴] 60 FPS Keyboard (#4066)
  Fix delete message error (#4065)
  Aggregate quickly-sent messages into batches (#4061)
  [🐴] Input hover and focus styles (#4064)
  fix typo (#4060)
  Fix error styles (#4063)
  Reset leave chat optimistic update if fails (#4058)
  don't show individual labels on own profile, only "have been placed..." (#4057)
  [🐴] Tweak header styles (#4053)
estrattonbailey added a commit that referenced this pull request May 17, 2024
* origin/main:
  [🐴] NUX (#4062)
  [🐴] Reduce header size (#4078)
  [🐴] Don't always show notification for everything (#4083)
  [🐴] Additional tweaks to the message list (#4075)
  Conditionally load unreads (#4072)
  Revert "Aggregate quickly-sent messages into batches (#4061)" (#4069)
  100% Real Deal™ (#4070)
  [🐴] 60 FPS Keyboard (#4066)
  Fix delete message error (#4065)
  Aggregate quickly-sent messages into batches (#4061)
  [🐴] Input hover and focus styles (#4064)
  fix typo (#4060)
  Fix error styles (#4063)
  Reset leave chat optimistic update if fails (#4058)
  don't show individual labels on own profile, only "have been placed..." (#4057)
  [🐴] Tweak header styles (#4053)
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