Commit Graph

8 Commits

Author SHA1 Message Date
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
Davide
a94db35d01
Refactor a few things about provider flows (#748)
- Move disclosable menu from installed profile view to
ThemeDisclosableMenu
- Drop unnecessary configurationType modifier parameter
- Reorg view-related module extensions to separate files
- Reuse .flow fields instead of single blocks
- Show specific error on missing provider server selection
2024-10-22 15:06:13 +02:00
Davide
da87ca698a
Add initial support for providers (#723)
Initial integration of providers via API:

- Generic views and modifiers for provider/server selection
- Add in OpenVPNView
- Prepare in WireGuardView

Also:

- Introduce ProfileProcessor, move IAP processing there
- Move .asModuleView() to ModuleViewModifier for proper animation
- Use .themeModal() rather than .sheet()
2024-10-11 00:24:06 +02:00
Davide
df2fc54044
Render profile UUID as quartets (#700)
Easier to read.
2024-10-09 21:40:56 +02:00
Davide De Rosa
8b5096ab69
Make copiable text multiline by default 2024-10-05 00:17:08 +02:00
Davide De Rosa
e75c264258
Go multiline rather than truncate copiable
Fixes #682
2024-10-04 10:40:18 +02:00
Davide De Rosa
fc834ab367
Replace Section with .themeSection
Closes #676
2024-10-03 23:32:31 +02:00
Davide
fbc6ece59d
Reorganize library into AppUI (#621)
Closes #611
2024-09-26 23:13:55 +02:00