Commit Graph

225 Commits

Author SHA1 Message Date
Davide De Rosa 38bdbc3697 Move diagnostics to settings 2022-09-12 22:58:37 +02:00
Davide De Rosa 940e0cf8c9 Attempt beta release 2022-09-05 22:35:22 +02:00
Davide De Rosa f36d7596d0 Integrate settings with about screen
Move everything to SettingsView and remove invite actions.
2022-08-27 23:15:51 +02:00
Davide De Rosa f465108a0a Attempt beta release 2022-08-16 12:43:20 +02:00
Davide De Rosa 9195d426e4 Attempt beta release 2022-07-18 08:03:24 +02:00
Davide De Rosa b26e334881 Get Mac strings from main bundle
Alter bundle in SwiftGen configuration file.
2022-07-18 07:55:56 +02:00
Davide De Rosa 04faf57d4c Send app to background if started hidden
Sandbox had to be enabled in order to submit binary to App Store
Connect, therefore command line arguments cannot be used to tell
if the app was started by the launcher.

However, given that launcher starts app in hidden state, we can
safely assert that if the app is hidden on start, it was started
by the launcher.

See f33380b4e2

Also drop automatic signing on Mac bundle and unused utils.
2022-07-18 07:55:56 +02:00
Davide De Rosa 32e548421f Attempt beta release 2022-07-17 14:50:05 +02:00
Davide De Rosa 781291940f Enforce window appearance on 'Show' after closure 2022-07-16 21:24:53 +02:00
Davide De Rosa 3f4b55a003 Implement Mac bundle with system menu
Use bundle as a means to provide Mac APIs to Catalyst app.

In order to cross the @objc wall set by the Mac Bundle mechanism,
Swift structures cannot be used directly and must be bridged
through ObjC facades.

Create NSMenu in MVVM style and install it on app launch. Make
sure to do it in AppDelegate.applicationDidFinishLaunching(),
because doing it as early as in PassepartoutApp.init() would
crash Mac code.

Use .representedObject to own view models.

With menu in place, app can be sent to background when main window
is closed. Requires multiple documents support for app not to die
instantly.
2022-07-16 17:39:42 +02:00
Davide De Rosa df0d40c556 Add launcher target
- Launch main app in background then die

- Do not launch app if already running

- Launch app binary relative to launcher location
2022-06-25 16:53:38 +02:00
Davide De Rosa 7ba9879c8c Revisit constants structure
Move some stuff back to App:

- Constants, and split library-dependent

- InApp entities and constants

Flatten global constants hierarchy.
2022-06-25 14:36:28 +02:00
Davide De Rosa 3c9511cd0c Only support Catalyst where required
- App
- Tunnels
2022-06-25 13:28:28 +02:00
Davide De Rosa 9a8477225e Refactor library into domain + impl 2022-06-23 23:31:01 +02:00
Davide De Rosa 8504998bbb Reorganize app-specific shared code into AppShared 2022-06-19 14:41:26 +02:00
Davide De Rosa 10b4c321c8 Separate context responsibilities
- Split Core and App context

- Move .shared instantiation to extension

Context may differ by target.
2022-06-16 13:42:53 +02:00
Davide De Rosa 14b42fbea5 Persist managers state to generic key-value store
Move all persisted state out of AppManager to where it really
belongs. To do that, inject a shared KeyValueStore object into
managers that need to persist part of their state in a strongly
typed manner.

Below are persisted states:

- PersistenceManager
    - persistenceAuthor

- ProfileManager
    - activeProfileId

- UpgradeManager (formerly AppManager)
    - didMigrateToV2 (migrate former value)

- VPNManager
    - tunnelLogFormat
    - masksPrivateData

A similar approach is used for app-specific preferences, by using
a strongly typed enum (AppPreference) together with SwiftUI
@AppStorage property wrapper.

Worth moving logging logic into a specific LogManager.

Finally, drop any former view dependency on AppManager, as states
are now accessed through specific managers.
2022-06-16 13:42:37 +02:00
Davide De Rosa 127ba28a8c Run SwiftGen manually
Build phase may raise concerns in CI.
2022-06-16 13:42:21 +02:00
Davide De Rosa 83cdd460e4 Attempt beta release 2022-05-21 19:15:48 +02:00
Davide De Rosa a2d4ed370e Revisit sidebar with per-profile VPN toggles 2022-05-21 19:15:37 +02:00
Davide De Rosa ddce671c62 Move theme extensions to non-reusable 2022-05-18 11:33:29 +02:00
Davide De Rosa b1d77cccbc Attempt beta release 2022-05-18 11:18:57 +02:00
Davide De Rosa 160338e62a Add credits in Mac about 2022-05-17 19:57:19 +02:00
Davide De Rosa 4c2a471b9f Attempt beta release 2022-05-17 19:34:13 +02:00
Davide De Rosa 6c798c8b19 Bump build 2022-05-17 16:43:14 +02:00
Davide De Rosa 16d618df0e Show info menu in ProfileView on iPad/Mac
Use .navigationBarTrailing to avoid artifact on Catalyst (item
relocates when first clicked).

Rename menu files too.
2022-05-16 11:18:58 +02:00
Davide De Rosa 743facca6b Improve Catalyst appearance
- Revert to more "stable" iPad idiom

- Set accent color the proper way

- Use .tint when available

- Unify navigation style by idiom

- Retain navigation bars in sidebar/detail

- Lighten sidebar appearance

- Fix Menu style (dropdown -> button)

- Use native Picker (dropdown)

- Use switch toggles rather than checkboxes

- Replace .actionSheet with .alert

- Increase minimum row height

CAVEAT: on Mac with iPad idiom, having a Section in .sidebar
produces artifacts. Header keeps changing height for no reason.
Retain Section on iPad multitasking only to not break navigation.
2022-05-15 22:24:36 +02:00
Davide De Rosa 683a8e7d82 Attempt beta release 2022-05-05 11:07:49 +02:00
Davide De Rosa 092233b546 Attempt beta release 2022-05-04 23:16:01 +02:00
Davide De Rosa c2676cbdf6 Attempt beta release 2022-05-04 19:03:22 +02:00
Davide De Rosa 9e9cd018eb Revert "Enable "DNS Settings" capability"
This reverts commit 75650b1f0a.
2022-05-04 09:01:27 +02:00
Davide De Rosa 3c0e511e84 Split again OrganizerView and ProfilesList
On iOS 14, Organizer scrolls abruptly on profile selection. It
looks like this was introduced by merging ProfilesList into
OrganizerView.

Try to revert merge to split observation responsibilities.

Drop unused AppManager in +Scene along the way.
2022-05-03 14:40:41 +02:00
Davide De Rosa 75650b1f0a Enable "DNS Settings" capability
Maybe fixes #182
2022-05-02 00:04:56 +02:00
Davide De Rosa 87f2ebfd9e Attempt beta release 2022-05-01 20:44:17 +02:00
Davide De Rosa edc7cdf045 Merge List into OrganizerView
- Restore wrapping Section as it seems to fix multitasking

- Hide profiles section if empty
2022-05-01 19:19:31 +02:00
Davide De Rosa 0047d095fb Adjust navigation style to all devices
- Mac
    - Drop all styles
    - Tweak hide title bar
    - Hide navigation bar

- Restore single section for all profiles
    - Allows using NavigationLink safely
    - Indirectly fixes multitasking
    - Retains selection on profile activation
    - Clean up presentActiveProfile

- Leave active profile in its position
    - Fixes Mac flashing row selection on profile activation

- Unify profile row appearance
    - Use fixed .headline font
    - Add subtitles to inactive profiles
    - Use padding rather than fixed row height

CAVEATS:

- Do not preselect active profile on iPad launch, as doing so
seems to present two ProfileView on top of each other, one from
MainView and one from the NavigationLink.

- Do not touch .listStyle() of master view, as it seems to break
navigation esp. in iPad multitasking.
2022-04-29 19:29:47 +02:00
Davide De Rosa cd854f8ebf Group profile actions into menus
- Organizer
    - Duplicate

- Profile
    - Rename
    - Siri
    - Uninstall (+ confirmation)
    - Delete (+ confirmation)
2022-04-27 09:53:42 +02:00
Davide De Rosa 4a0245d757 Rename AddHostView to .NameView
In preparation of future additions to flow.
2022-04-26 22:44:34 +02:00
Davide De Rosa 99e48119f7 Encapsulate calculation of former products
Use an interface (BuildProducts) that makes understandable and
easily extensibile how some in-app products are inferred by build
number.
2022-04-26 20:55:18 +02:00
Davide De Rosa 1ff19b331f Move VPNToggle to standalone view 2022-04-26 10:40:46 +02:00
Davide De Rosa 6434008ebd Make destructive buttons standalone
- Uninstall VPN

- Remove profile (add to ProfileView)

Create DestructiveButton with iOS 15 .role when available.
2022-04-25 16:34:22 +02:00
Davide De Rosa deac70359f Reorganize and fix platform-specific fastlane data
Reuse all iOS metadata in macOS, except the app icon.
2022-04-25 11:21:19 +02:00
Davide De Rosa c507c739bd Move WelcomeView to its own view 2022-04-23 10:25:31 +02:00
Davide De Rosa d8e47cb7c0 Refactor strings and add new ones
- Move Localizable.strings above to share *.lproj folders

- Reorg menus into contextual/system

- Shorten titles of contextual menus

- Update sharing message with WireGuard

- Drop AlternativeTo

7 phrases left to translate into 9 languages.
2022-04-22 13:12:42 +02:00
Davide De Rosa c9dfed676e Move VPN status below active profile
Rather than on the side. Similar to old subtitle table view cell.

Restore data count as well (when available).
2022-04-22 09:52:10 +02:00
Davide De Rosa 46050e0141 Refactor ProfileView a little bit
- Make welcome a computed property

- Reuse first header for consistency when loading

- Convert isDeleted to better isExisting (inverted)
2022-04-21 19:11:22 +02:00
Davide De Rosa fd7c232ecc Unroll ProfileView toolbar items
Also leave them visible when disabled.
2022-04-21 19:03:14 +02:00
Davide De Rosa d1c98006d3 Replace ReloadingContent with implicit animations
Infinite loop on init(), but horrible practice in general.

- DonateView
- PaywallView+Purchase

Also show a ProgressView while rows are loading.

DO NOT animate on .products value because animation won't work
if products are empty and stay empty after refresh. Instead,
observe .isRefreshingProducts.

Lastly, to avoid annoying animation when products are actually
available, do not refresh products if non-empty. They certainly
do not change during the application lifecycle.
2022-04-21 11:22:07 +02:00
Davide De Rosa 3f9ff50d0e Optimize Catalyst for Mac
- Fix missing PlugIns in Catalyst build

Hence the VPN failure, there was a "iOS" filter on embed.

- Fix complaint about file access permission

Seems to need R/W when importing VPN configuration files.
2022-04-19 16:48:42 +02:00
Davide De Rosa bf65f76401 Merge project into iOS + macOS
Share views with both platforms initially. Will split specific
views step by step.
2022-04-19 16:14:23 +02:00