-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[Nicer Tabs] Fork TabBar, simplify Pager #6762
Merged
Merged
Conversation
This file contains 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
gaearon
changed the title
[Nicer tabs] Fork TabBar, simplify Pager
[Nicer Tabs] Fork TabBar, simplify Pager
Nov 26, 2024
gaearon
force-pushed
the
nicer-tabs-1
branch
from
November 26, 2024 21:32
79dedfd
to
fa5775e
Compare
gaearon
force-pushed
the
nicer-tabs-1
branch
from
November 27, 2024 14:57
b63c614
to
7acae03
Compare
|
mozzius
force-pushed
the
nicer-tabs-1
branch
from
November 27, 2024 21:37
7acae03
to
a263998
Compare
mozzius
approved these changes
Nov 27, 2024
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.
nice simplification, works cross-platform
It's difficult to tell what exactly it's supposed to represent, and in practice it's not really used aside from logging. Let's rip it out for now to keep other changes simpler.
It was added to try to do some work eagerly when we're sure which way the scroll is snapping. This is not necessarily a good idea though. It schedules a potentially expensive re-render right during the deceleration animation, which is not great. Whatever we're optimizing there, we should optimize smarter (e.g. prewarm just the network call). The other thing it used to help with is triggering the pager header autoscroll earlier. But we're going to rewrite that part differently anyway so that's not relevant either.
We'll have to revisit this when adding tablet support but for now I'd prefer to remove a codepath that is not being tested or ever run.
The Draggable thing was needed for web-only behavior so we can drop it in the native fork.
gaearon
force-pushed
the
nicer-tabs-1
branch
from
November 30, 2024 18:03
a263998
to
82b227e
Compare
arcalinea
temporarily deployed
to
nicer-tabs-1 - social-app PR #6762
November 30, 2024 18:03 — with
Render
Destroyed
Signez
pushed a commit
to Signez/bsky-social-app
that referenced
this pull request
Dec 26, 2024
* Fork TabBar.web.tsx * Trim dead code from both forks * Remove onPageSelecting event It's difficult to tell what exactly it's supposed to represent, and in practice it's not really used aside from logging. Let's rip it out for now to keep other changes simpler. * Remove early onPageSelected call It was added to try to do some work eagerly when we're sure which way the scroll is snapping. This is not necessarily a good idea though. It schedules a potentially expensive re-render right during the deceleration animation, which is not great. Whatever we're optimizing there, we should optimize smarter (e.g. prewarm just the network call). The other thing it used to help with is triggering the pager header autoscroll earlier. But we're going to rewrite that part differently anyway so that's not relevant either. * Prune more dead code from the native version We'll have to revisit this when adding tablet support but for now I'd prefer to remove a codepath that is not being tested or ever run. * Use regular ScrollView on native The Draggable thing was needed for web-only behavior so we can drop it in the native fork.
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.
The goal is to resurrect #1696. I've learned a bunch of things since I made that version, and I'm pretty sure I can get the indicator to work fast on Android now. Scrolling on demand may still be tricky but we'll see. Could be iOS-only.
In this PR, I'm just starting to clean things up a bit:
TabBar
is going to diverge even more between web and native, so I'll just fork it now.Pager
'sonPageSelecting
event. It's kind of ill-defined (what does "selecting" mean exactly?), and the implementation encourages putting heavy work just as the deceleration is starting. This is not great for performance, especially if we start adding more visual flourishes to it. I believe the goal was to optimistically start some work earlier (maybe fetching the selected feed?) — but if that's the goal, we should just add some kind of query prewarming later. In either case, it gets in the way of refactoring, so let's kill it for now and revisit this decision at the end of the stack.Test Plan
Everything still works.
We're not sending the
reason
in the analytics event but that seems fine. Maybe I'll hook it up later, for now I want to simplify the code.The "header catch up" animation after swipe now runs a bit later. We'll solve that in the subsequent PRs.