Some useful shortcuts can be replicated in the main profile screen.
Requirements:
- Modules implementing `ModuleDestinationProviding` return a
`navigationDestination()` to navigate to module-specific routes (e.g.
OpenVPN credentials). This was done in #1166
- In order to navigate to the module routes from the main
`ProfileCoordinator` view, it must have a `navigationDestination()`
attached for each of the modules, without knowing the concrete route
types
Here is how this is accomplished in a generic fashion:
1. `ProfileEditor.navigationDestinations()` iterates over each
`ModuleDestinationProviding` to return a list of
`navigationDestination()`, [implemented as a
`ViewModifier`](https://github.com/passepartoutvpn/passepartout/pull/1167/files#diff-11dfcbc4f6c173b133fe8eb4c54710f2ac7161cd38126735c655a8c56a62b8c0R29)
2. With this in place, module routes can be pushed with a
`NavigationLink` from the main profile view
3. Lastly, in the profile view, we add a section for each module
implementing `ModuleShortcutsProviding`, where the module may return a
list of convenient shortcuts, e.g. in the form of the `NavigationLink`
in 2
Start with some OpenVPN entries:
- Provider server
- Credentials (if needed)
Some refactoring was necessary:
- Load ModulePreferences in the module destinations via
ModulePreferencesModifier, rather than in the module view (may revisit
later)
- Due to the above, move "Remote endpoints" from "Configuration" to a
separate destination (also less messy)
- Group complex module views (OpenVPN/WireGuard) into folders
- Reuse `ProviderServerRow` for consistency across modules/shortcuts
Decouple destinations from the module view so that one can navigate to
them from any point of the app. Affects only OpenVPN for now.
Preparation for "profile shortcuts".
- Restore the default accent, but extend it to toggles on iOS
- Keep the "gold" color for the upgrade icon
- Replace the upgrade icon with the universally understandable lock icon
Restart from the v2 flow most users are familiar with.
- Restore the global v2 accent
- Restore the per-profile toggles
- Single tap to edit a profile
- Reuse the same chevron for profile and module navigation
- Improve the iCloud/TV section and rename it to "Synchronization"
- Drop the misleading moon icon from the "Keep alive on sleep" toggle
- Drop the marginal "Enable"/"Disable" action from context menus
- Drop the grid cell highlighting, now marginal with toggles
- Drop the complexity of `nextProfileId`
Ultimately, rework `TunnelToggleButton` into `TunnelToggle` for better
reuse across all platforms.
Things left to improve:
- The duplication of the active profile on top has not changed, but the
toggles may make it more visually apparent
- The "Inactive" subtitle in disabled profiles is there for balance as
it keeps rows and cells of the same height, but it serves no real
purpose
- Access to secondary actions (e.g. provider server, credentials)
- Use of TipKit for less intuitive flows (e.g. context menus, building a
profile from scratch)
Fixes#1111