diff --git a/ios/MullvadVPN/TunnelManager/TunnelState+UI.swift b/ios/MullvadVPN/TunnelManager/TunnelState+UI.swift index e87afd87b37d..759f802fc142 100644 --- a/ios/MullvadVPN/TunnelManager/TunnelState+UI.swift +++ b/ios/MullvadVPN/TunnelManager/TunnelState+UI.swift @@ -9,7 +9,7 @@ import UIKit extension TunnelState { - var textColorForSecureLabel: UIColor { + var textColorForConnectionStatusLabel: UIColor { switch self { case .connecting, .reconnecting, .waitingForConnectivity(.noConnection), .negotiatingEphemeralPeer: .white @@ -32,55 +32,20 @@ extension TunnelState { var localizedTitleForSecureLabel: String { switch self { - case let .connecting(_, isPostQuantum, _), let .reconnecting(_, isPostQuantum, _): - if isPostQuantum { - NSLocalizedString( - "TUNNEL_STATE_PQ_CONNECTING", - tableName: "Main", - value: "Creating quantum secure connection", - comment: "" - ) - } else { - NSLocalizedString( - "TUNNEL_STATE_CONNECTING", - tableName: "Main", - value: "Creating secure connection", - comment: "" - ) - } - - case let .negotiatingEphemeralPeer(_, _, isPostQuantum, _): - if isPostQuantum { - NSLocalizedString( - "TUNNEL_STATE_NEGOTIATING_KEY", - tableName: "Main", - value: "Creating quantum secure connection", - comment: "" - ) - } else { - NSLocalizedString( - "TUNNEL_STATE_CONNECTING", - tableName: "Main", - value: "Creating secure connection", - comment: "" - ) - } - case let .connected(_, isPostQuantum, _): - if isPostQuantum { - NSLocalizedString( - "TUNNEL_STATE_PQ_CONNECTED", - tableName: "Main", - value: "Quantum secure connection", - comment: "" - ) - } else { - NSLocalizedString( - "TUNNEL_STATE_CONNECTED", - tableName: "Main", - value: "Secure connection", - comment: "" - ) - } + case .connecting, .reconnecting, .negotiatingEphemeralPeer: + NSLocalizedString( + "TUNNEL_STATE_CONNECTING", + tableName: "Main", + value: "Connecting...", + comment: "" + ) + case .connected: + NSLocalizedString( + "TUNNEL_STATE_CONNECTED", + tableName: "Main", + value: "Connected", + comment: "" + ) case .disconnecting(.nothing): NSLocalizedString( @@ -101,7 +66,7 @@ extension TunnelState { NSLocalizedString( "TUNNEL_STATE_DISCONNECTED", tableName: "Main", - value: "Unsecured connection", + value: "Disconnected", comment: "" ) @@ -159,62 +124,33 @@ extension TunnelState { } } - func secureConnectionLabel(isPostQuantum: Bool) -> String { - if isPostQuantum { - NSLocalizedString( - "TUNNEL_STATE_PQ_CONNECTING_ACCESSIBILITY_LABEL", - tableName: "Main", - value: "Creating quantum secure connection", - comment: "" - ) - } else { + var localizedAccessibilityLabel: String { + switch self { + case .connecting, .negotiatingEphemeralPeer: NSLocalizedString( "TUNNEL_STATE_CONNECTING_ACCESSIBILITY_LABEL", tableName: "Main", - value: "Creating secure connection", + value: "Connecting", comment: "" ) - } - } - var localizedAccessibilityLabel: String { - switch self { - case let .connecting(_, isPostQuantum, _): - secureConnectionLabel(isPostQuantum: isPostQuantum) - - case let .negotiatingEphemeralPeer(_, _, isPostQuantum, _): - secureConnectionLabel(isPostQuantum: isPostQuantum) - - case let .connected(tunnelInfo, isPostQuantum, _): - if isPostQuantum { - String( - format: NSLocalizedString( - "TUNNEL_STATE_PQ_CONNECTED_ACCESSIBILITY_LABEL", - tableName: "Main", - value: "Quantum secure connection. Connected to %@, %@", - comment: "" - ), - tunnelInfo.exit.location.city, - tunnelInfo.exit.location.country - ) - } else { - String( - format: NSLocalizedString( - "TUNNEL_STATE_CONNECTED_ACCESSIBILITY_LABEL", - tableName: "Main", - value: "Secure connection. Connected to %@, %@", - comment: "" - ), - tunnelInfo.exit.location.city, - tunnelInfo.exit.location.country - ) - } + case let .connected(tunnelInfo, _, _): + String( + format: NSLocalizedString( + "TUNNEL_STATE_CONNECTED_ACCESSIBILITY_LABEL", + tableName: "Main", + value: "Connected to %@, %@", + comment: "" + ), + tunnelInfo.exit.location.city, + tunnelInfo.exit.location.country + ) case .disconnected: NSLocalizedString( "TUNNEL_STATE_DISCONNECTED_ACCESSIBILITY_LABEL", tableName: "Main", - value: "Unsecured connection", + value: "Disconnected", comment: "" ) diff --git a/ios/MullvadVPN/View controllers/Tunnel/TunnelControlView.swift b/ios/MullvadVPN/View controllers/Tunnel/TunnelControlView.swift index b95376590fd4..83bf0490170d 100644 --- a/ios/MullvadVPN/View controllers/Tunnel/TunnelControlView.swift +++ b/ios/MullvadVPN/View controllers/Tunnel/TunnelControlView.swift @@ -28,7 +28,7 @@ private enum TunnelControlActionButton { } final class TunnelControlView: UIView { - private let secureLabel = makeBoldTextLabel(ofSize: 20, numberOfLines: 0) + private let connectionStatusLabel = makeBoldTextLabel(ofSize: 20, numberOfLines: 0) private let cityLabel = makeBoldTextLabel(ofSize: 34) private let countryLabel = makeBoldTextLabel(ofSize: 34) @@ -135,8 +135,8 @@ final class TunnelControlView: UIView { func update(with model: TunnelControlViewModel) { viewModel = model let tunnelState = model.tunnelStatus.state - secureLabel.text = model.secureLabelText - secureLabel.textColor = tunnelState.textColorForSecureLabel + connectionStatusLabel.text = model.connectionStatusLabelText + connectionStatusLabel.textColor = tunnelState.textColorForConnectionStatusLabel selectLocationButtonBlurView.isEnabled = model.enableButtons connectButtonBlurView.isEnabled = model.enableButtons cityLabel.attributedText = attributedStringForLocation(string: model.city) @@ -144,7 +144,7 @@ final class TunnelControlView: UIView { connectionPanel.connectedRelayName = model.connectedRelaysName connectionPanel.dataSource = model.connectionPanel - updateSecureLabel(tunnelState: tunnelState) + updateConnectionStatusLabel(tunnelState: tunnelState) updateActionButtons(tunnelState: tunnelState) updateTunnelRelays(tunnelStatus: model.tunnelStatus) } @@ -166,17 +166,17 @@ final class TunnelControlView: UIView { setArrangedButtons(views) } - private func updateSecureLabel(tunnelState: TunnelState) { - secureLabel.text = tunnelState.localizedTitleForSecureLabel.uppercased() - secureLabel.textColor = tunnelState.textColorForSecureLabel + private func updateConnectionStatusLabel(tunnelState: TunnelState) { + connectionStatusLabel.text = tunnelState.localizedTitleForSecureLabel.uppercased() + connectionStatusLabel.textColor = tunnelState.textColorForConnectionStatusLabel switch tunnelState { case .connected: - secureLabel.accessibilityIdentifier = .connectionStatusConnectedLabel + connectionStatusLabel.accessibilityIdentifier = .connectionStatusConnectedLabel case .connecting: - secureLabel.accessibilityIdentifier = .connectionStatusConnectingLabel + connectionStatusLabel.accessibilityIdentifier = .connectionStatusConnectingLabel default: - secureLabel.accessibilityIdentifier = .connectionStatusNotConnectedLabel + connectionStatusLabel.accessibilityIdentifier = .connectionStatusNotConnectedLabel } } @@ -185,7 +185,7 @@ final class TunnelControlView: UIView { NSLocalizedString( "CONNECT_BUTTON_TITLE", tableName: "Main", - value: "Secure connection", + value: "Connect", comment: "" ), for: .normal ) @@ -274,7 +274,7 @@ final class TunnelControlView: UIView { // MARK: - Private private func addSubviews() { - for subview in [secureLabel, countryLabel, cityLabel, connectionPanel] { + for subview in [connectionStatusLabel, countryLabel, cityLabel, connectionPanel] { locationContainerView.addArrangedSubview(subview) } diff --git a/ios/MullvadVPN/View controllers/Tunnel/TunnelControlViewModel.swift b/ios/MullvadVPN/View controllers/Tunnel/TunnelControlViewModel.swift index d1ce7b3a7a93..660024f41230 100644 --- a/ios/MullvadVPN/View controllers/Tunnel/TunnelControlViewModel.swift +++ b/ios/MullvadVPN/View controllers/Tunnel/TunnelControlViewModel.swift @@ -10,7 +10,7 @@ import Foundation struct TunnelControlViewModel { let tunnelStatus: TunnelStatus - let secureLabelText: String + let connectionStatusLabelText: String let enableButtons: Bool let city: String let country: String @@ -37,7 +37,7 @@ struct TunnelControlViewModel { static var empty: Self { TunnelControlViewModel( tunnelStatus: TunnelStatus(), - secureLabelText: "", + connectionStatusLabelText: "", enableButtons: true, city: "", country: "", @@ -49,7 +49,7 @@ struct TunnelControlViewModel { func update(status: TunnelStatus) -> TunnelControlViewModel { TunnelControlViewModel( tunnelStatus: status, - secureLabelText: secureLabelText, + connectionStatusLabelText: connectionStatusLabelText, enableButtons: enableButtons, city: city, country: country, @@ -61,7 +61,7 @@ struct TunnelControlViewModel { func update(outgoingConnectionInfo: OutgoingConnectionInfo) -> TunnelControlViewModel { TunnelControlViewModel( tunnelStatus: tunnelStatus, - secureLabelText: secureLabelText, + connectionStatusLabelText: connectionStatusLabelText, enableButtons: enableButtons, city: city, country: country, diff --git a/ios/MullvadVPNUITests/ConnectivityTests.swift b/ios/MullvadVPNUITests/ConnectivityTests.swift index 6b66a2d5142c..c730fa876b8b 100644 --- a/ios/MullvadVPNUITests/ConnectivityTests.swift +++ b/ios/MullvadVPNUITests/ConnectivityTests.swift @@ -210,7 +210,7 @@ class ConnectivityTests: LoggedOutUITestCase { allowAddVPNConfigurationsIfAsked() TunnelControlPage(app) - .waitForSecureConnectionLabel() + .waitForConnectedLabel() HeaderBar(app) .tapAccountButton() diff --git a/ios/MullvadVPNUITests/Pages/TunnelControlPage.swift b/ios/MullvadVPNUITests/Pages/TunnelControlPage.swift index 6929ee1f5ac5..ab127d5ccb72 100644 --- a/ios/MullvadVPNUITests/Pages/TunnelControlPage.swift +++ b/ios/MullvadVPNUITests/Pages/TunnelControlPage.swift @@ -112,10 +112,10 @@ class TunnelControlPage: Page { return self } - @discardableResult func waitForSecureConnectionLabel() -> Self { + @discardableResult func waitForConnectedLabel() -> Self { let labelFound = app.staticTexts[.connectionStatusConnectedLabel] .waitForExistence(timeout: BaseUITestCase.extremelyLongTimeout) - XCTAssertTrue(labelFound, "Secure connection label presented") + XCTAssertTrue(labelFound, "Connected label presented") return self } diff --git a/ios/MullvadVPNUITests/RelayTests.swift b/ios/MullvadVPNUITests/RelayTests.swift index 9bf9c790421f..53896fca91bb 100644 --- a/ios/MullvadVPNUITests/RelayTests.swift +++ b/ios/MullvadVPNUITests/RelayTests.swift @@ -80,7 +80,7 @@ class RelayTests: LoggedInWithTimeUITestCase { allowAddVPNConfigurationsIfAsked() // Allow adding VPN configurations iOS permission TunnelControlPage(app) - .waitForSecureConnectionLabel() + .waitForConnectedLabel() try Networking.verifyCannotReachAdServingDomain() @@ -95,7 +95,7 @@ class RelayTests: LoggedInWithTimeUITestCase { allowAddVPNConfigurationsIfAsked() TunnelControlPage(app) - .waitForSecureConnectionLabel() + .waitForConnectedLabel() try Networking.verifyCanAccessInternet() try Networking.verifyConnectedThroughMullvad() @@ -163,7 +163,7 @@ class RelayTests: LoggedInWithTimeUITestCase { allowAddVPNConfigurationsIfAsked() TunnelControlPage(app) - .waitForSecureConnectionLabel() + .waitForConnectedLabel() try Networking.verifyCanAccessInternet() @@ -204,7 +204,7 @@ class RelayTests: LoggedInWithTimeUITestCase { allowAddVPNConfigurationsIfAsked() TunnelControlPage(app) - .waitForSecureConnectionLabel() + .waitForConnectedLabel() try Networking.verifyCanAccessInternet() @@ -253,7 +253,7 @@ class RelayTests: LoggedInWithTimeUITestCase { // Should be two UDP connection attempts but sometimes only one is shown in the UI TunnelControlPage(app) .verifyConnectingOverTCPAfterUDPAttempts() - .waitForSecureConnectionLabel() + .waitForConnectedLabel() .tapDisconnectButton() } @@ -282,7 +282,7 @@ class RelayTests: LoggedInWithTimeUITestCase { TunnelControlPage(app) .tapRelayStatusExpandCollapseButton() .verifyConnectingToPort("4001") - .waitForSecureConnectionLabel() + .waitForConnectedLabel() .tapDisconnectButton() } @@ -363,7 +363,7 @@ class RelayTests: LoggedInWithTimeUITestCase { allowAddVPNConfigurationsIfAsked() TunnelControlPage(app) - .waitForSecureConnectionLabel() + .waitForConnectedLabel() .verifyConnectingOverMultihop() .tapDisconnectButton() } @@ -386,7 +386,7 @@ class RelayTests: LoggedInWithTimeUITestCase { allowAddVPNConfigurationsIfAsked() let relayIPAddress = TunnelControlPage(app) - .waitForSecureConnectionLabel() + .waitForConnectedLabel() .tapRelayStatusExpandCollapseButton() .getInIPAddressFromConnectionStatus() @@ -408,7 +408,7 @@ class RelayTests: LoggedInWithTimeUITestCase { allowAddVPNConfigurationsIfAsked() TunnelControlPage(app) - .waitForSecureConnectionLabel() + .waitForConnectedLabel() try Networking.verifyCanAccessInternet() diff --git a/ios/MullvadVPNUITests/Screenshots/ScreenshotTests.swift b/ios/MullvadVPNUITests/Screenshots/ScreenshotTests.swift index 326a5c56a189..dc53791101f5 100644 --- a/ios/MullvadVPNUITests/Screenshots/ScreenshotTests.swift +++ b/ios/MullvadVPNUITests/Screenshots/ScreenshotTests.swift @@ -50,7 +50,7 @@ class ScreenshotTests: LoggedInWithTimeUITestCase { .tapLocationCell(withName: "Sweden") TunnelControlPage(app) - .waitForSecureConnectionLabel() + .waitForConnectedLabel() snapshot("QuantumConnectionSecured") }