Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix connection view background in iOS15 #7479

Merged
merged 1 commit into from
Jan 22, 2025

Conversation

rablador
Copy link
Contributor

@rablador rablador commented Jan 17, 2025

The blurred background in the connection view is transparent in iOS15. We should fix it.


This change is Reviewable

@rablador rablador added bug iOS Issues related to iOS labels Jan 17, 2025
@rablador rablador self-assigned this Jan 17, 2025
Copy link

linear bot commented Jan 17, 2025

@rablador rablador force-pushed the fix-connection-view-background-in-ios15-ios-1016 branch from a3bef8f to 37c6978 Compare January 20, 2025 09:17
pinkisemils
pinkisemils previously approved these changes Jan 20, 2025
Copy link
Collaborator

@pinkisemils pinkisemils left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think my review should hold much authority, but the code seems sane and this runs just fine on my myriad of emulators. :lgtm:

Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

Copy link
Contributor

@SteffenErn SteffenErn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @rablador)


ios/MullvadVPN/View controllers/Tunnel/ConnectionView/ConnectionView.swift line 28 at r1 (raw file):

                .showIf(connectionViewModel.showsActivityIndicator)

            ZStack {

ZStack can be removed since it only contains one view. Move padding and radius modifier to VStack (order of modifiers is important)

@rablador rablador force-pushed the fix-connection-view-background-in-ios15-ios-1016 branch from 37c6978 to ad41168 Compare January 21, 2025 10:53
Copy link
Contributor Author

@rablador rablador left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 1 of 3 files reviewed, 2 unresolved discussions (waiting on @pinkisemils and @SteffenErn)


ios/MullvadVPN/View controllers/Tunnel/ConnectionView/ConnectionView.swift line 28 at r1 (raw file):

Previously, SteffenErn (Steffen Ernst) wrote…

ZStack can be removed since it only contains one view. Move padding and radius modifier to VStack (order of modifiers is important)

Done.


ios/MullvadVPN/View controllers/Tunnel/TunnelViewController.swift line 66 at r2 (raw file):

        super.init(nibName: nil, bundle: nil)

Not needed anymore.

Copy link
Collaborator

@mojganii mojganii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 1 of 3 files reviewed, 2 unresolved discussions (waiting on @pinkisemils and @SteffenErn)


ios/MullvadVPN/View controllers/Tunnel/ConnectionView/ConnectionView.swift line 28 at r1 (raw file):

Previously, SteffenErn (Steffen Ernst) wrote…

ZStack can be removed since it only contains one view. Move padding and radius modifier to VStack (order of modifiers is important)

it can be reduced to :

Code snippet:

var body: some View {
        Spacer()
            .accessibilityIdentifier(AccessibilityIdentifier.connectionView.asString)
        VStack(alignment: .leading, spacing: 0) {
            HeaderView(viewModel: connectionViewModel, isExpanded: $isExpanded)
                .padding(.bottom, headerViewBottomPadding)
            
            DetailsContainer(
                connectionViewModel: connectionViewModel,
                indicatorsViewModel: indicatorsViewModel,
                isExpanded: $isExpanded
            )
            .showIf(connectionViewModel.showConnectionDetails)
            
            ButtonPanel(viewModel: connectionViewModel, action: action)
                .padding(.top, 16)
        }
        .padding(16.0)
        .background(BlurView(style: .dark))
        .cornerRadius(12)
        // Some spacing to avoid overlap with the map legal link.
        .padding(EdgeInsets(top: 16, leading: 16, bottom: 24, trailing: 16))
        .onChange(of: isExpanded) { _ in
            onContentUpdate?()
        }
        .onReceive(connectionViewModel.combinedState) { _, _ in
            // Only update expanded state when connections details should be hidden.
            // This will contract the view on eg. disconnect, but leave it as-is on
            // eg. connect.
            if !connectionViewModel.showConnectionDetails {
                isExpanded = false
                return
            }
            
            onContentUpdate?()
        }
    }

@rablador rablador force-pushed the fix-connection-view-background-in-ios15-ios-1016 branch from ad41168 to 378e026 Compare January 21, 2025 11:50
Copy link
Contributor Author

@rablador rablador left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 1 of 4 files reviewed, 3 unresolved discussions (waiting on @pinkisemils and @SteffenErn)


ios/MullvadVPN/View controllers/Tunnel/ConnectionView/ConnectionView.swift line 28 at r1 (raw file):

Previously, mojganii wrote…

it can be reduced to :

Done.


ios/MullvadVPN/View controllers/Tunnel/ConnectionView/ConnectionViewViewModel.swift line 29 at r3 (raw file):

    @Published private(set) var tunnelStatus: TunnelStatus
    @Published var outgoingConnectionInfo: OutgoingConnectionInfo?
    @Published var showsActivityIndicator = false

Cleanup.

Copy link
Contributor

@SteffenErn SteffenErn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 3 of 3 files at r3, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions

SteffenErn
SteffenErn previously approved these changes Jan 22, 2025
Copy link
Contributor

@SteffenErn SteffenErn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 2 unresolved discussions

@rablador rablador force-pushed the fix-connection-view-background-in-ios15-ios-1016 branch from 378e026 to ef8ad08 Compare January 22, 2025 09:43
Copy link
Collaborator

@mojganii mojganii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewable status: 3 of 4 files reviewed, 2 unresolved discussions (waiting on @SteffenErn)

@rablador rablador force-pushed the fix-connection-view-background-in-ios15-ios-1016 branch from ef8ad08 to 58f13dd Compare January 22, 2025 13:24
@rablador rablador merged commit 8c94061 into main Jan 22, 2025
10 of 11 checks passed
@rablador rablador deleted the fix-connection-view-background-in-ios15-ios-1016 branch January 22, 2025 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug iOS Issues related to iOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants