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

SwiftUI Settings redux #1179

Merged
merged 16 commits into from Feb 27, 2024
Merged

SwiftUI Settings redux #1179

merged 16 commits into from Feb 27, 2024

Conversation

nolanw
Copy link
Member

@nolanw nolanw commented Feb 26, 2024

Picked up #1152 and ran with it:

  • Move the Settings and Acknowledgements screens to SwiftUI.
    • Fix the app icon selector.
  • Replace Sourcery with a centralized list of settings, conveniences for using settings within SwiftUI, and add dependency Foil for observability outside SwiftUI.
  • Experiment with moving UI bits into packages.
    • AwfulExtensions for convenience bits that know nothing about Awful specifically.
    • AwfulModelTypes for some tagged string identifiers, hopefully we don't confuse e.g. forum IDs and thread IDs between public interfaces.
    • AwfulSettings and AwfulTheming are shared UI code, will probably get imported a lot.
    • AwfulSettingsUI is (more or less) the Settings tab.
    • This is mostly for faster builds when using previews. A fringe benefit is making the internal access level relevant.
    • Lots more imports needed when making a new view/screen. Certainly room to fiddle, but let's get a few more reps in first.
  • Add some SwiftUI affordances for theming. Lots more to do here.
  • No more Objective-C in the Awful target. Vendored Objective-C code is quarantined in dedicated packages.

Also start AwfulModelTypes package for tagged identifier types.
Would be nice to move .css files over, but they're generated from .less files, and pulling that generation into a Swift package build plugin is more effort than it's worth right now.
Slowly figuring out how to bring themes into SwiftUI. The environment key and view modifier seem like a good step. Manually having to set everything is annoying, but let's try it out on a few different views before trying anything drastic.

Also split AwfulSettingsUI into its own package to fix a dependency cycle between AwfulSettings and AwfulTheming. AwfulTheming needs to read some Settings values to do its job, but AwfulSettingsUI needs to theme itself. Maybe there's a smarter breakdown here. Or maybe AwfulSettingsUI can pull its weight if we move the other Settings tab screens over.
…er, and add missing imports previously covered up by the bridging header
@nolanw nolanw merged commit e5926dc into main Feb 27, 2024
1 check passed
@nolanw nolanw deleted the nolanw/swiftui-settings-redux branch February 27, 2024 05:21
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.

None yet

1 participant