Move all persisted state out of AppManager to where it really
belongs. To do that, inject a shared KeyValueStore object into
managers that need to persist part of their state in a strongly
typed manner.
Below are persisted states:
- PersistenceManager
- persistenceAuthor
- ProfileManager
- activeProfileId
- UpgradeManager (formerly AppManager)
- didMigrateToV2 (migrate former value)
- VPNManager
- tunnelLogFormat
- masksPrivateData
A similar approach is used for app-specific preferences, by using
a strongly typed enum (AppPreference) together with SwiftUI
@AppStorage property wrapper.
Worth moving logging logic into a specific LogManager.
Finally, drop any former view dependency on AppManager, as states
are now accessed through specific managers.
- Revert to more "stable" iPad idiom
- Set accent color the proper way
- Use .tint when available
- Unify navigation style by idiom
- Retain navigation bars in sidebar/detail
- Lighten sidebar appearance
- Fix Menu style (dropdown -> button)
- Use native Picker (dropdown)
- Use switch toggles rather than checkboxes
- Replace .actionSheet with .alert
- Increase minimum row height
CAVEAT: on Mac with iPad idiom, having a Section in .sidebar
produces artifacts. Header keeps changing height for no reason.
Retain Section on iPad multitasking only to not break navigation.
App disconnects VPN on launch otherwise, because active
profile is still nil. Where was the regression introduced?
Also .dropFirst() to skip initial values, but keep in mind that
if VPN is connected and active profile was not properly persisted,
the app will show the VPN as disabled.
- Do the profile loading inside the model
- Allow setting current profile to a transient profile
- Check .placeholder before saving current profile
XXX: avoid loading active profile on iPad portrait.
- Mac
- Drop all styles
- Tweak hide title bar
- Hide navigation bar
- Restore single section for all profiles
- Allows using NavigationLink safely
- Indirectly fixes multitasking
- Retains selection on profile activation
- Clean up presentActiveProfile
- Leave active profile in its position
- Fixes Mac flashing row selection on profile activation
- Unify profile row appearance
- Use fixed .headline font
- Add subtitles to inactive profiles
- Use padding rather than fixed row height
CAVEATS:
- Do not preselect active profile on iPad launch, as doing so
seems to present two ProfileView on top of each other, one from
MainView and one from the NavigationLink.
- Do not touch .listStyle() of master view, as it seems to break
navigation esp. in iPad multitasking.
Make action sync, but internally async (makeProfileReady). If not
doing so, UI on launch will not be able to show active profile
immediately. WelcomeView would appear for a moment.
Observe isReloadingCurrentProfile.
See 2b1efb8fec
- Move Localizable.strings above to share *.lproj folders
- Reorg menus into contextual/system
- Shorten titles of contextual menus
- Update sharing message with WireGuard
- Drop AlternativeTo
7 phrases left to translate into 9 languages.