Commit Graph

2860 Commits

Author SHA1 Message Date
Davide
4e423e3dd9
Fix previous PR 2024-11-03 13:47:48 +01:00
Davide
2790a2aac2
Merge AppLibrary into CommonLibrary (#806)
CommonLibrary barely used as standalone, almost always together with
AppLibrary.
2024-11-03 13:16:13 +01:00
Davide
1d2de39d49
Use profile name as interactive view title 2024-11-03 11:44:14 +01:00
Davide
fbe2d84113
Submit on OpenVPN fields (#805)
Submit on password or OTP depending on the selected method.
2024-11-03 11:27:12 +01:00
Davide
fff21c3250
Late dismissal after changing active provider server (#804)
The dismissal action waited until the current connection was
disconnected.

Consider that AppContext makes the explicit .connect() redundant,
reconnection is already happening after saving a profile while
connected.
2024-11-03 11:12:19 +01:00
Davide
3f7ad5bf57
Fix flashing context menu on data count update (#803)
Observe tunnel in InstalledProfileView subviews to avoid redraw of whole
view and context menu.
2024-11-03 08:38:53 +01:00
Davide
15959d2422
Resolve some focus issues (#802)
- [x] tvOS: When profile selector appears, if it's closed without
selecting any profile, it instantly reopens
- [x] Set initial focus in OpenVPN credentials
2024-11-03 08:17:19 +01:00
Davide
8aff3bedbc
Fix missing country flags 2024-11-02 16:15:19 +01:00
Davide
248f1e7257
Fix compile error on tvOS 2024-11-02 15:27:52 +01:00
Davide
aba5081450
Refactor and improve interactive login (#801)
Define two styles for interactive login:

- Modal (iOS/macOS) - Form inside NavigationStack
- Inline (tvOS) - VStack

Requires OpenVPN credentials view to be container-agnostic.

Play with focus to improve the overall TV experience.
2024-11-02 15:24:41 +01:00
Davide
454efb8e50
Refactor ModuleType to be a single source of truth (#800)
Rather than defining a new enum, tie ModuleType to ModuleHandler names
from PassepartoutKit.

Also a way to reuse ModuleType.localizedDescription on both Module and
ModuleBuilder implementations.
2024-11-02 15:23:36 +01:00
Davide
f286ed8ff9
Clean up test plan 2024-11-02 10:21:14 +01:00
Davide
070b661c43
Refactor library targets (#799)
Renames:

- AppUI → UILibrary
- AppUIPlatform → AppUI (conditional umbrella) + AppUI[Main|TV]
- APILibrary/CommonLibrary/UtilsLibrary → Common[API|Library|Utils]

Dependencies:

- AppUI → UILibrary
- UILibrary → AppLibrary, CommonAPI
- AppLibrary → CommonLibrary, CommonUtils
2024-11-02 10:11:59 +01:00
Davide
72e784272a
Create basic UI for TV app (#798)
Start with the profile tab. Left to do: search and settings.

Fixes and refactoring:

- Listen to changes in current profile in ExtendedTunnel
- Externalize style from TunnelToggleButton and ConnectionStatusText
(renamed from View)
- Add ThemeCountryText for convenience
2024-11-02 08:41:32 +01:00
Davide
357c505cc0
Refactor AppUI/AppUIMain to accomodate TV (#797)
- Move InteractiveView to AppUI for use in TV, with
OpenVPNCredentialsView
- Move non-UI entities to AppLibrary (IAP, ExtendedTunnel,
ProfileProcessor)
- Take API out of CommonLibrary (tunnel extension does not need it)
- Reorganize theme views/modifiers into separate files
2024-11-01 23:32:35 +01:00
Davide
ca18aadddf
Allow interactive credentials with providers (#796)
Fixes #795
2024-11-01 20:01:18 +01:00
Davide
590b2790fa
Revisit overuse of EnvironmentObject (#794)
The biggest issue is the hidden and scattered use of both Tunnel and
ConnectionObserver. Only use the latter, and rename it to ExtendedTunnel
for being now a full wrapper around Tunnel (e.g. for .connectionStatus).

In general, restrict the use of EnvironmentObject to:

- Theme
- IAPManager
- ProfileProcessor
- ProviderManager

Always be explicit about:

- ProfileManager
- ExtendedTunnel

Contextually, move some UI entities to the base AppUI target.
2024-11-01 09:47:50 +01:00
Davide
33d238270e
Fix issues with iOS 16 (#792)
- Drop AppInlineCoordinator completely, always present profile modally
- Delay modal presentations by 50ms

Fixes #791
2024-10-31 14:30:22 +01:00
Davide
e7666e6097
Fix previout commit on macOS 2024-10-31 12:23:00 +01:00
Davide
9f22053fa9
Fix lifecycle of environment objects (#790)
#779 was happening because environment objects were set on contentView,
which is not the _outmost_ root view. This clarifies why the Theme
object was not being found in ThemeLockScreenModifier.

Also, do not hardcode LogoView as lock view.
2024-10-31 11:14:39 +01:00
Davide
237277d4db
Do some refactoring in AppUI targets (#789)
- Refactor AppUI initialization in all platforms (sort of template
method pattern)
- Make AppMenu specific to macOS by wrapping it into a folder for
consistency
- Add SizeClassProviding for repeated checks on hsClass/vsClass

Fixes #659
2024-10-31 10:02:21 +01:00
Davide
80dd6dc779
Render country flags with Emojis (#787)
Revert FlagKit just introduced in #786
2024-10-31 01:15:07 +01:00
Davide
dcdb03a735
Improve country flags (#786)
Leverage the convenience of FlagKit. Update credits too.
2024-10-30 19:11:58 +01:00
Davide
14260b9bcd
Fall back to empty OTP
OpenVPN requires it to be non-nil when method is != .none

This is a quick fix.
2024-10-30 18:27:05 +01:00
Davide
3ae6ec5784
Bump version 2024-10-30 17:09:36 +01:00
Davide
bb8c760278
OpenVPN OTP is persisted with the password (#785)
Encode OpenVPN password + OTP in tunnel rather than in the app.

Encoding them upfront in the app ends up persisting the profile with the
combined password. Update the library with a new OTP field in
OpenVPN.Credentials, so that the password encoding is performed [on the
fly in the
tunnel](https://github.com/passepartoutvpn/passepartoutkit-source/pull/398).
Similar to how provider modules are generated.

This is likely a regression caused by migrating to NEProfileRepository,
because starting a connection causes the profile to be saved to NE with
the encoded password. Later, the profile is restored from NE and
therefore contains the encoded password.
2024-10-30 17:07:59 +01:00
Davide
9a365703c5
Refactor Theme strings
Fixes #784
2024-10-30 15:20:18 +01:00
Davide
9e7860d390 Show titles and set destructive on confirmation
Fixes #683
2024-10-30 15:07:22 +01:00
Davide
d12590387a Always close window on .isVisible = false
E.g. "About" would open main window when launched from login item.
2024-10-30 15:07:22 +01:00
Davide
a39583da1f Restore menu style in provider picker
Faces #761, but fixes #774
2024-10-30 15:07:22 +01:00
Davide
c677a1e655 Fix lock view flickering on first appearance
Fixes #781
2024-10-30 15:07:22 +01:00
Davide
aadc46e98f
Bundle API in app rather than library (#782)
Add script to speed up API update.
2024-10-30 11:46:24 +01:00
Davide
705130514c
Bump version 2024-10-30 10:40:02 +01:00
Davide
7f3d897818
Improve macOS window lifecycle (#780)
- Let the user close the window, the app will just remain alive in the
status bar
- Accordingly, replace "Confirm quit" preference with the option to stay
alive in the status bar
- Add "About..." item
2024-10-30 10:37:45 +01:00
Davide
9d6dfe6a76
Fix crash on lock screen (#779)
Missing environment Theme in LogoView.

Probably broken in #775
2024-10-30 10:18:39 +01:00
Davide
00bd826096
Fix error unwrapping (previous commit) 2024-10-30 10:16:05 +01:00
Davide
f48349cde9
Fix duplicated message on import error 2024-10-29 16:30:43 +01:00
Davide
7ac5d3ce23
Omit commit SHA1 from CHANGELOG
Unreadable without monospace.
2024-10-29 16:02:23 +01:00
Davide
c8ee557091
Bump version 2024-10-29 15:35:36 +01:00
Davide
0f6df3894e
Set "Skip install" to true for login item
It spoils archive otherwise, because there are two macOS apps.
2024-10-29 15:32:14 +01:00
Davide
374ac6f636
Bump version 2024-10-29 15:18:40 +01:00
Davide
7e2bd01c36
Omit lock screen on macOS 2024-10-29 14:44:00 +01:00
Davide
944d6f8c28
Refactor AppUI for TV target (#775)
Split AppUI into AppUI and AppUIMain to allow for a new, simplified
AppUITV target tailored for the Apple TV.

As a PoC, present a view with a list of the shared profiles.
2024-10-29 14:30:41 +01:00
Davide
8536aee755
Show hostname with middle truncation on iOS 2024-10-29 11:50:33 +01:00
Davide
41de48789e
Show in Mac status bar plus Login Item (#773)
Add a status menu via SwiftUI MenuBarExtra where to:

- Show/hide app
- Launch on login via "Login Item" target
- Toggle profiles on/off

Only weird that the login item is not added to the list of "Open at
Login", but to "Allow in the Background", see
https://github.com/pilotmoon/Scroll-Reverser/issues/165

Requires some refactoring to bring AppContext initialization to the
AppDelegate.

Fixes #617
Fixes #482 
Fixes #696 
Fixes #505
2024-10-29 11:40:11 +01:00
Davide
d60ab97922
Fix initial country filters (#771)
- iOS: skip filter to speed up selection of another country
- macOS: initial country filter was lost due to category/country
chaining
2024-10-29 00:15:56 +01:00
Davide
92cf1985e2
Fix iOS app not reacting to open URL (#770)
Resort to SwiftUI .onOpenURL(), seems to do fine for single URL on iOS
(not on macOS).
2024-10-28 23:38:01 +01:00
Davide
33f17ab496
Move favorites toggle above servers list on iOS (#769)
Improve access to the most used filter.
2024-10-28 23:00:41 +01:00
Davide
5e46eb2fe5
Fix "Connect to..." appearing in non-providers 2024-10-28 22:34:07 +01:00
Davide
acaaf13ceb
Bump version 2024-10-28 21:48:29 +01:00