-
Notifications
You must be signed in to change notification settings - Fork 31
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
Tab Bar Navigation preview #615
Closed
Closed
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
…eed a reference to a navigation path can use whatever.
- Add tab bar navigation to Inbox/Profile/Search. Note: - Need to fix Feed tab navigation.
…ttempting tab bar navigation. - Add debug print in dismiss action.
- Fix issue where navigationSelection was not the same as selection on init. - Remove navigation selection state from ContentView.
Note: - Scroll to top appeared seems broken.
…ld views. - Remove unused code. - Add documentation.
- Only scroll to top in user view if it is root view.
…heet view (sheets don't participate in tab bar navigation).
…rag gesture), navigation breaks because SwiftUI doesn't call onAppear again on top view.
… view disappears.
…ion no longer works because it lost reference to dismiss action.
(cherry picked from commit b91d4e5)
Co-authored-by: mormaer <[email protected]> (cherry picked from commit 84fa94c)
(cherry picked from commit 863b05d)
Co-authored-by: Bosco Ho <[email protected]> (cherry picked from commit 3a2a7c0)
(cherry picked from commit e29b179)
(cherry picked from commit adf639e)
(cherry picked from commit d8bc82c)
Co-authored-by: mormaer <[email protected]> (cherry picked from commit 57af347)
(cherry picked from commit baa54a8)
- Add tab navigation README.
- Hoist function no longer requires dismissAction injection. - Update README.
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.
Tab Bar Navigation Preview
TL;DR: Try and see if any bug(s) make it totally unusable...plez 🥹
Feature
Users can use the tab bar to navigate back, scroll to top, and show the sidebar.
Discussion
The implementation allows for two types of tab bar navigation actions:
NavigationStack
).~ Examples include "scroll to top", "focus of search bar", etc. Technically, we could even make it scroll up to each parent comment in
ExpandedPost
(not that that makes sense =P).~ This auxiliary action is implemented as a
() -> Bool
closure where you can define multiple "auxiliary sub-actions" by returningtrue
. The tab bar navigator will continue to call into this closure until it returnsfalse
.Implementation Notes
Initially, this feature was implemented by programmatically manipulating a tab's corresponding navigation path.
This revised implementation uses the environment's dismiss action to trigger go back navigation, which means the we let the system deal with coordinating between data state and UI state on a navigation path/stack.
Additional Notes
This revision also handles the following use cases:
Customization
Currently, there is no option to customize this behaviour. It could make sense to offer one or more of the following options:
Todo
Known Issues