passepartout-apple/Passepartout/Library/Sources/AppUI/Views
Davide ee8ef34f06
Avoid nested module navigation (#749)
A NavigationLink in VPNProviderContentModifier raised a few questions
about the navigation approach in module views. It turned out that having
a Binding to a local ObservedObject (ProfileEditor) is a recipe for
disaster.

Therefore:

- We don't need a binding to the editor module (the draft), because by
doing so we end up _observing_ the same changes from two properties, the
binding and the editor. This seems to drive SwiftUI crazy and freezes
the app once we navigate from the module to another view (e.g. in
OpenVPN the credentials or the provider server). Use the module binding
as a shortcut, but do not assign the binding to the view to avoid
unnecessary observation.
- Keep .navigationDestination() in the module view, and pass a known
destination to VPNProviderContentModifier. This will save the modifier
from creating a nested NavigationLink destination. The
VPNProviderServerView is now openly instantiated by the module view when
such destination is triggered by the NavigationLink in the modifier.
- Do not implicitly dismiss VPNProviderServerView on selection, let the
presenter take care. In order to do so, we add a .navigationPath
environment key through which the module view can modify the current
navigation stack.
2024-10-23 15:42:54 +02:00
..
About TODO -> FIXME 2024-10-04 10:30:14 +02:00
App Refactor a few things about provider flows (#748) 2024-10-22 15:06:13 +02:00
Diagnostics Lazy-load tunnel logs in Diagnostics 2024-10-20 01:54:46 +02:00
Extensions Avoid nested module navigation (#749) 2024-10-23 15:42:54 +02:00
Modules Avoid nested module navigation (#749) 2024-10-23 15:42:54 +02:00
Paywall TODO -> FIXME 2024-10-04 10:30:14 +02:00
Profile Avoid nested module navigation (#749) 2024-10-23 15:42:54 +02:00
ProfileEditor Avoid nested module navigation (#749) 2024-10-23 15:42:54 +02:00
Provider Avoid nested module navigation (#749) 2024-10-23 15:42:54 +02:00
Settings Several fixes in ProfileManager (#685) 2024-10-04 20:58:11 +02:00
Theme Refactor a few things about provider flows (#748) 2024-10-22 15:06:13 +02:00
UI Refactor a few things about provider flows (#748) 2024-10-22 15:06:13 +02:00