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

View conversion to SwiftUI #123

Open
NattyNarwhal opened this issue Apr 21, 2023 · 3 comments
Open

View conversion to SwiftUI #123

NattyNarwhal opened this issue Apr 21, 2023 · 3 comments
Labels
design Visual and UX design refactor Code cleanup

Comments

@NattyNarwhal
Copy link
Member

NattyNarwhal commented Apr 21, 2023

Downloads view has been converted and it seems to work pretty well.

  • Onboarding: Low-stakes. Done
  • Preferences: I have this working in a Playground, but to get the proper Settings view toolbar with a TabView involves conversion to the SwiftUI lifecycle instead of the AppKit one, or manually frobbing NSToolbar (gross).
  • Tracklist: Good low-risk opportunity to use tables bound to an array. Will probably involve a refactor of SBPlayer in Swift to expose the tracklist as an @ObservableObject?
  • Library views (Music, ServerLibrary, etc.): Would involve a lot of @FetchRequest...
  • Database: Would be a good way to clean up the awful mess there. Wiring up sheets, subviews, and selectors sounds nightmarish though.

Concerns would be:

  • We have extensive NSTableView customization and common patterns, how hard would these be with SwiftUI Table?
@NattyNarwhal NattyNarwhal added refactor Code cleanup design Visual and UX design labels Apr 21, 2023
@NattyNarwhal
Copy link
Member Author

I have a prototype of Database in a SwiftUI test project with:

  • view switching in sidebar
  • enumerates playlists in servers

But:

  • toolbar, right sidebar, and actions not implemented yet

@NattyNarwhal
Copy link
Member Author

SwiftUI has a very annoying issue for the tracklist (and probably playlist) case, where you can't really have multiple of the same tracks in whatever collection the Table/List represents, because the selection is based by a Set<SBTrack>, not by an index. It'd need a data model change, or regress to the pre-index change. Might have to play with .enumerated() sometime...

@NattyNarwhal
Copy link
Member Author

Another issue is that Table requires macOS 12. We still support 11, but I don't know if it'd be worth dropping it. App Store users look to be mostly on 12 or 13.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design Visual and UX design refactor Code cleanup
Projects
None yet
Development

No branches or pull requests

1 participant