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

Fix (#4430): Use separate hooks for shell mode animated styles #4451

Merged
merged 2 commits into from
Jun 10, 2024

Conversation

frncs-eu
Copy link
Contributor

@frncs-eu frncs-eu commented Jun 9, 2024

This is just a silly "move stuff around" PR and is small step towards improving the perceived performance on low end devices.
This PR is based on the findings reported in #4430 and replaces the hook useMinimalShellMode with 3 separate hooks dedicated to building the animated style (for footer, header and Fab buttons)

This avoids creating 3 instances of the hook useAnimatedStyle of which only one is actually needed every time the hook is used, and reduces the first render time for components using the transitions on low end Android devices.

I tested for regressions for both iOS and web too, and found none, hence I updated the .web components aswell for consistency, but I'm not 100% familiar with simultaneous web/mobile development using RN so let me know if it's ok.

Also, I preferred to keep 3 hooks in the base hooks folder but I'm ok with equivalent alternatives.

Fixes #4430

@gaearon
Copy link
Collaborator

gaearon commented Jun 10, 2024

I think it would be a bit simpler if we kept them in the same file. Makes it easier to add/delete variants.

Copy link
Collaborator

@gaearon gaearon left a comment

Choose a reason for hiding this comment

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

this is a noticeable improvement on my galaxy a12 — not just on the profile screen but on Home as well. thank you!

@gaearon gaearon merged commit b688da8 into bluesky-social:main Jun 10, 2024
6 checks passed
@frncs-eu
Copy link
Contributor Author

Argh, I'm sorry you had to make the requested changes yourself @gaearon!
I was at work and planning to make them when at home but...you were faster 😛

Anyway, I'm happy I helped improving the performance a bit! 🚀

@gaearon
Copy link
Collaborator

gaearon commented Jun 10, 2024

no worries!

@frncs-eu frncs-eu deleted the 4430-load-latest-btn-render branch June 10, 2024 19:16
estrattonbailey added a commit that referenced this pull request Jun 11, 2024
* origin/main: (54 commits)
  patch `expo-notifications` to clear badge (#4475)
  Revert to old modal on android (#4458)
  Sort profile feedgens by likes (#4380)
  Revert "Fix undefined block (#4471)" (#4472)
  Fix undefined block (#4471)
  Open convo menu when tapping on chat with deleted account (#4470)
  stop using `addPushTokenListener` (#4467)
  add hitslop to repost button (#4469)
  Add a loading indicator to notifications when loading latest (#4468)
  Visually improve the empty state of feeds (#4466)
  Give a meaningful error in the composer when replying to a deleted post (#4464)
  Fix: show known feed error UI more reliably (#4463)
  Only validate persisted data for existing users (#4465)
  Check `canAskAgain` for notification permissions (#4460)
  Add support for new-tab clicks on feeds (#4462)
  Override legacy language codes for indonesian, hebrew, and yiddish (#4461)
  Ungate mobile web notification badge (#4459)
  Fix (#4430): Use separate hooks for shell mode animated styles (#4451)
  Throttle instead of debounce (#4456)
  debounce refetching listconvos (#4455)
  ...
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.

Scroll performance on Profile screen on Android
2 participants