Commit Graph

2932 Commits

Author SHA1 Message Date
Davide 2d93fa64c6
Embrace simplifications in PassepartoutProviders (#975)
Update library with the new domain reorganization.
2024-12-03 16:18:05 +01:00
Davide 7611f6f7d2
Fix a tunnel crash during DNS resolution 2024-12-02 18:59:18 +01:00
Davide d6ebf4bc18
Fix .lifetime not being credited all features 2024-12-02 12:08:30 +01:00
Davide 3540e1cb1a
Redesign confusing paywall (#973)
- Split suggested product and full version
- Hide sections with no products
- Hide full features if no full products
- Fail if no purchasable products
2024-12-02 10:40:25 +01:00
Davide d885ad2a3d
Add template for import tests 2024-12-02 09:25:19 +01:00
Davide bcd7dff4d5
Bump version 2024-12-02 00:23:23 +01:00
Davide 2447db19e2
Fix compile error on TV 2024-12-02 00:23:13 +01:00
Davide c50862ff6f
Bump version 2024-12-02 00:16:16 +01:00
Davide abd1d5bb9b
Enable animations in OpenVPN credentials 2024-12-02 00:11:52 +01:00
Davide a2544b33ac
Hide OpenVPN password if provider does not require it (#970) 2024-12-02 00:01:35 +01:00
Davide 14ce23f25b
Improve confusing footer modifiers (#969)
There was duplication and a ugly `#if os(macOS)` with some footers
explicitly rendered on macOS with .themeFooter() (now .themeSubtitle()).

Move this logic to the .themeSection() modifiers by adding a
`forcesFooter` parameter. When true, a fake footer is added on macOS as
the last row of a section.
2024-12-01 23:23:51 +01:00
Davide 0a1886fe31
Handle all connection attempts in AppCoordinator (#968)
Let the AppCoordinator take care of the connection requirements via
modals:

- onInteractiveLogin() - now presented on AppError
- onProviderEntityRequired()
- onPurchaseRequired()
- Any other connection error

Subviews must not use tunnel.connect(), rather they route connection
requests via the ConnectionFlow callbacks. In particular, migrate to the
AppCoordinator the connection logic from:

- TunnelToggleButton.perform()
- ProviderEntitySelector.onSelect()

onInteractiveLogin() and onPurchaseRequired() are now handled
internally, while onProviderEntityRequired() is kept public because it's
how subviews may present the entity selector.

Extras:

- Avoid modals overlap with a 500ms delay
- Shrink interactive login size on macOS
2024-12-01 22:34:41 +01:00
Davide f87cc1da0b
Fix OpenVPN/WireGuard import error messages (#967)
OpenVPN parser was indirectly swallowing WireGuard errors.
2024-12-01 21:33:58 +01:00
Davide 725168b652
Show guidance regardless of OTP method 2024-11-30 16:15:04 +01:00
Davide 1a25102ec3
Add guidance for OpenVPN provider credentials (#966)
Some providers require specific credentials for OpenVPN, different from
account credentials. Update the API index with this information to show
an information footer and possibly a link to the OpenVPN credentials.

Also, fix the OTP footer not appearing on macOS.
2024-11-29 15:25:22 +01:00
Davide 8c305688cc
Always use setLater for paywall
Fixes #951
2024-11-29 00:13:00 +01:00
Davide d8f5aed665
Update release notes on bump (#965)
Refine symlink scripts too.
2024-11-29 00:10:22 +01:00
Davide 63496725c8
Transparent logo in version screen (#963)
Looks better on macOS and allows gradient on tvOS.
2024-11-28 22:59:37 +01:00
Davide e761979134
Extend ProfileManager events (#964)
Especially for flaky tests:

- Do objectWillChange.send() _before_ performing the change
- Send more events to .didChange to be more deterministic about test
expectations
2024-11-28 22:56:12 +01:00
Davide ed413a748e
Update SwiftLint/SwiftGen YAML 2024-11-28 19:54:50 +01:00
Davide 3a511b9474
Drop empty folder 2024-11-28 18:50:58 +01:00
Davide 7af703c164
Move app library to the root (#962)
Makes it easier to search among app files and library files.
2024-11-28 17:45:18 +01:00
Davide 2a467e0c7e
Separate AppContext for previews and UI testing (#961)
Clarify the use of contexts:

- **Production** (.shared)
- **Previews** (.mock → .forPreviews)
  - ONLY use it in UILibrary for, well, previews
  - This context has dumb profiles with UUIDs as names
  - Registry is fake
- **UI Tests** (.forUITesting)
  - Add new context for UI testing
  - Selected based on command line arguments
  - This context has mock data tuned for decent screenshots
  - Registry is real

Share the same InAppProcessor in .shared and .forTesting contexts
because the app behavior was inconsistent regarding e.g. in-app
purchases.
2024-11-28 17:31:17 +01:00
Davide 962361cb9f
Automate screenshots via UI tests (#960)
Ready for screenshots generation, except for the tests themselves and
the TV target.

- More customizations while UI testing
  - Act as full version user in IAPManager
  - Override layout with default to .grid if isBigDevice
  - Show module names in profile list/grid
- Improve mock Profile/ProfileManager
  - Meaningful profile names
  - iCloud/TV icons
  - Initial modules
- Improve XCTest extensions
  - Screenshot destination (attachment/temporary)
  - Screenshot target (window/sheet)
  - Print saved temporary URL at the end (may help with CI)
  - Append device name to screenshot filename
- Tests
- Refactor actions with the [Page Object
pattern](https://swiftwithmajid.com/2021/03/24/ui-testing-using-page-object-pattern-in-swift/)
  - Perform iPad screenshots in landscape
  - Split simple flow tests and screenshots
  - Add "Connect to" test

Closes #681
2024-11-28 15:51:03 +01:00
Davide f6c93fc2f7
Use provider description as profile name 2024-11-28 11:14:23 +01:00
Davide 42c0d7e932
Customize user level from bundle 2024-11-28 02:19:44 +01:00
Davide 581673c617
Add target for UI tests (#959)
Create UITesting target with:

- AppCommandLine/AppEnvironment: strongly typed refactoring of PP_*
environment values
- AccessibilityInfo: identifies and locates elements for UI testing

Make the app behave differently when launched with `.uiTesting`, and
expose the flag to SwiftUI via `.environment(\.isUITesting)` to:

- Use the mock AppContext
- Skip onboarding

Add PassepartoutUITests target with two screenshot tests:

- Connected screen
- Profile modal
2024-11-28 01:30:26 +01:00
Davide fc711ae98f
Get rid of downloaded API after update 2024-11-27 19:27:50 +01:00
Davide c0dc2181e3
Complete CI/CD release workflow (#958)
Import current metadata and screenshots.

Fixes #647
2024-11-27 19:10:23 +01:00
Davide 6e3e3e398e
Well 2024-11-27 18:52:46 +01:00
Davide 2de5aad093
Improve bump script with positional arguments (#957)
Get rid of the messy `bump*.sh` scripts variants with a single one with
positional arguments (all optional):

- -v: the new version number (default: current)
- -b: the new build number (default: current + 1)
- -s: the initial build for the CHANGELOG diff (default: latest tag)
- -na: do not update the API (default: do update it)
- -nl: do not update the CHANGELOG (default: present editor)
- -d: dry run

Fixes #948
2024-11-27 17:08:00 +01:00
Davide 8f778faa5d
Inform about use of profile name in Shortcuts (#954)
Now that Siri is superseded by the more general Shortcuts automations,
add an informational footer below the "Name" field of the profile
editor.
2024-11-27 15:30:15 +01:00
Davide b4caa26a47
Improve layout of installed profile (#953)
When none, fill the whitespace with an informational placeholder.
2024-11-27 14:49:23 +01:00
Davide eac1e028b2
Add version view in About/Settings (#952)
Restored from v2. Refactor LogoView for reuse.
2024-11-27 13:24:44 +01:00
Davide 14aae4e02a
Define common PreferenceProtocol 2024-11-27 09:40:32 +01:00
Davide b3c90b6802
Drop animations on reload servers on iOS 2024-11-27 01:22:54 +01:00
Davide 4fcac3c95a
Fix modals not re-appearing in iOS 16
- Paywall
- Error handler

Expose setLater/enableLater.
2024-11-27 01:22:53 +01:00
Davide a92c2c2c64
Fix profile menus
- Omit duplicate/delete from current profile
- Replace .infoButton with .installedProfile if current
- Drop dots from direct actions
- Disable trailing dots on iOS/tvOS
- Disable "Connect to" if ineligible (decouple to own view)
2024-11-27 01:20:42 +01:00
Davide 91f4e510c4
Split app and UI domains (#949)
CommonLibrary had some undesired knowledge of UI. Split AppPreference
and UIPreference. Then move some more stuff from AppUI* to UILibrary.

WARNING: this forgets existing UI preferences (e.g. favorite servers).
2024-11-26 21:21:49 +01:00
Davide 20273e651f
Bump version 2024-11-26 20:12:03 +01:00
Davide d8753f21da
Different styles for profile menu based on context (#947)
Hide "Duplicate" and "Delete" from the info button menu because they are
disruptive actions, misclick is likely.
2024-11-26 20:10:03 +01:00
Davide e0f16cbb3e
Mitigate overlap of sheet/alert during onboarding 2024-11-26 19:19:15 +01:00
Davide b34019e4eb
Add provider profile from toolbar (#946)
Create profile with a provider module and an on-demand module (disabled)
to speed up initial provider selection and configuration. Supports
OpenVPN for now.

Fixes #899
2024-11-26 19:14:56 +01:00
Davide 2dad04f241
Do not present server selector if ineligible (#945)
Verification was only performed for interactive login, not for provider
server selection. Do that before a connection attempt, so that the
paywall always appears first.
2024-11-26 18:44:23 +01:00
Davide 7d8055f044
Do not dismiss abruptly on "Donate" error 2024-11-26 17:28:49 +01:00
Davide b455701daa
Improve appearance of "Purchased"
- Animate load
- Handle load errors
2024-11-26 17:28:19 +01:00
Davide aa9da8c9e0
Bump version 2024-11-26 16:52:02 +01:00
Davide b9f3500f31
Fix regressions in L&F (#944)
- Text appearance on iOS/macOS (broken by #943)
- Visual ambiguity in "Purchased" when no feature is eligible
- "Purchased" must be a form on macOS
2024-11-26 16:50:37 +01:00
Davide 4d84bd1dd6
Bump version 2024-11-26 16:34:35 +01:00
Davide ed1d78d424
Add manual flow to run Xcode tests 2024-11-26 16:24:12 +01:00