-
Notifications
You must be signed in to change notification settings - Fork 59
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
Add opt-in usage of sidebar in NavigationStack/NavigationView #4
Comments
Good points. The tab bar was supposed to just be for demo purposes — there's 4 tabs that each contain a separate instance of Setting. I was trying to mock up different scenarios where you'd use the library. Instead, maybe the sidebar should contain the top-level list of settings, like this? It'll be a master-detail presentation style. This is possible in iOS 16 / macOS Ventura using NavigationSplitView. |
I'm trying to maintain current compatibility if possible so I'm using NavigationSplitView for the newer platforms and NavigationView for the older ones. I have a somewhat workable prototype now, but it's proving challenging to adapt the existing code. |
I'm going to put a pin in this and circle back later - there's other projects needing attention. If you feel inclined to attempt implementing any of this feel free of course. I love the concept of this library and you've done really great work. I think the extra touch of making it truly feel at home on macOS could definitely take it to the next level. |
@orchetect can you share the refactoring work you did? Sounds like a great idea, I'm trying to build something with the same UI right now and also finding it difficult to refactor my own fork. Happy to look at picking up where you left off if you can share a link. |
@DanBurkhardt I didn't get very far at the time. Got pulled onto other projects and also ran into some roadblocks that were making it evident that a proper refactor to add macOS look and feel was going to be a lot more work than it seemed. I don't think there's anything useful in my old fork honestly. It would be best to just fork and start from scratch. |
I actually figured it out last night, how to force the thing to present as a Swift UI view with NSHostingController, and properly navigate with a back button / maintaining the navigation stack. Will link to my fork after I clean it up and ship it, it's a little hacky and tbh I don't fully understand why it works, but it does. kassandra-settings-fixed.mov |
This is a fantastic library and just the thing I was looking for recently.
I am building a macOS app and I'm working on a refactor of Setting to allow the use of the sidebar as the top level, very much like how macOS Ventura's System Settings does:
It started as a small refactor (WIP) of the SettingExample project to use NavigationView with a sidebar instead of TabView:
But then I realized it would be much nicer if the sidebar was actually an opt-in feature of Setting. The reason is that right now, the text search function only searches within the scope of the current top-level item selected, not across all of them at once.
Additionally, in macOS Settings, the search bar is positioned within the sidebar (which doesn't really work on macOS) and its text search filters the sidebar contents during searching.
The text was updated successfully, but these errors were encountered: