mullvad / mullvadvpn-app

The Mullvad VPN client app for desktop and mobile
https://mullvad.net/
GNU General Public License v3.0
5.14k stars 342 forks source link

Ios 881 shadowsocks obfuscation settings #7216

Closed acb-mv closed 1 day ago

acb-mv commented 1 week ago

Create the SwiftUI-based Shadowsocks port configuration page.

This uses the same SingleChoiceList element created for IOS-880. However, since the UI is more complex, as custom user-entered ports are allowed, this element has been extended to implement this functionality (In fact, most of the changes in this PR are to SingleChoiceList). Documentation and examples (in SwiftUI Previews) have been added for this element as well, as it should prove reusable for other screens.

A screen recording of the UI is attached:

https://github.com/user-attachments/assets/863dd0d7-9c85-4a54-ab85-bca6bd311b9e


This change is Reviewable

linear[bot] commented 1 week ago

IOS-881 Create new subsetting page for shadowsocks selection

acb-mv commented 1 week ago

ios/MullvadVPN/View controllers/Settings/Obfuscation/ShadowsocksObfuscationSettingsView.swift line 52 at r2 (raw file):

Previously, acb-mv wrote…
I agree that it looks horrible. I could set the width of the `TextField`'s frame in points, but not in characters. Given that the text size could change, padding the string with spaces is the least-worst option.

The other option would be to wrap the TextField in a ZStack, placing a Text("00000") or similar beneath it for sizing. Which we can do, though it doesn't quite sound like less of a hack.

acb-mv commented 3 days ago

ios/MullvadVPN/View controllers/Settings/Obfuscation/ShadowsocksObfuscationSettingsView.swift line 52 at r2 (raw file):

Previously, rablador (Jon Petersson) wrote…
We currently hard code 100 px for `SettingsInputCell` (used in wireguard port). I think we should use that for now here too.

Given that SwiftUI automatically scales text with the user's preferences (yes, we get Dynamic Text for free), this will break horribly the first time a person with poor eyesight and extra-large phone text uses our app. We could nerf Dynamic Text and hardwire everything to fixed sizes, but that would be a retrograde step.

acb-mv commented 3 days ago

ios/MullvadVPN/View controllers/Settings/SwiftUI components/SingleChoiceList.swift line 217 at r9 (raw file):

Previously, rablador (Jon Petersson) wrote…
The default background color should be dark, focused white. Check out `SettingsInputCell` for the correct colors.

Should we be using the SearchTextField colours, given that this is not a search field?

github-actions[bot] commented 1 day ago

🚨 End to end tests failed. Please check the failed workflow run.