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

Animate expansion of connection details view #7548

Merged
merged 1 commit into from
Feb 13, 2025

Conversation

SteffenErn
Copy link
Contributor

@SteffenErn SteffenErn commented Jan 30, 2025

It is finally time for some fancy animations of the connection view. A few changes to the structure, lots of pain and finally the salvation through .transformEffect(.identity) was required.
Some of the newly introduced State variables seem unnecessary, but it doesn't work properly without them.
Enjoy!


This change is Reviewable

Copy link

linear bot commented Jan 30, 2025

@SteffenErn SteffenErn force-pushed the animate-expansion-of-connection-details-ios-994 branch from bb3c5ae to 96ea06d Compare January 30, 2025 08:12
@SteffenErn SteffenErn added the iOS Issues related to iOS label Jan 30, 2025
@SteffenErn SteffenErn self-assigned this Jan 30, 2025
@SteffenErn SteffenErn requested a review from waahlnaden January 30, 2025 08:53
@SteffenErn SteffenErn force-pushed the animate-expansion-of-connection-details-ios-994 branch from 2bc4ae5 to f113e11 Compare January 30, 2025 11:26
Copy link
Contributor

@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.

There is a black backround behind the buttons that should not be there:
Simulator Screenshot - iPhone 16 Pro - 2025-01-30 at 13.14.35.png

Reviewable status: 0 of 10 files reviewed, 1 unresolved discussion (waiting on @SteffenErn)


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

    @State private(set) var showConnectionDetailsAnimated = false
    @State private(set) var isExpandedAnimatied = false

Nit: Spelling: "Animatied"

Copy link
Contributor

@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: 0 of 10 files reviewed, 1 unresolved discussion (waiting on @SteffenErn)


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

    @State private(set) var isExpanded = false

    @State private(set) var showConnectionDetailsAnimated = false

I think we always want to do these things animated, so we don't need to specify that in the variable names.

Copy link
Contributor

@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.

Reviewed 3 of 10 files at r1, 6 of 7 files at r2, 1 of 1 files at r4, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @SteffenErn)


ios/MullvadVPN/Extensions/View+Modifier.swift line 12 at r4 (raw file):

extension View {
    func apply<V: View>(@ViewBuilder _ block: (Self) -> V) -> V { block(self) }

We should add documentation here to clarify what the function is used for.

buggmagnet
buggmagnet previously approved these changes Feb 6, 2025
Copy link
Contributor

@buggmagnet buggmagnet 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 10 files at r1, 6 of 7 files at r2, 1 of 1 files at r4, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @SteffenErn)

@SteffenErn SteffenErn force-pushed the animate-expansion-of-connection-details-ios-994 branch 3 times, most recently from c5e7f08 to c404b1b Compare February 10, 2025 13:58
Copy link
Contributor Author

@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.

New and improved version of animations are ready to be tested and reviewed. (No more black bar between buttons included)

Reviewable status: 3 of 15 files reviewed, 3 unresolved discussions (waiting on @buggmagnet, @mojganii, and @rablador)


ios/MullvadVPN/Extensions/View+Modifier.swift line 12 at r4 (raw file):

Previously, rablador (Jon Petersson) wrote…

We should add documentation here to clarify what the function is used for.

Done.


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

Previously, rablador (Jon Petersson) wrote…

I think we always want to do these things animated, so we don't need to specify that in the variable names.

managed to remove those variables entirely 🥳


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

Previously, mojganii wrote…

why did you remove constants?

16 is the default padding, but I added it back now to be more explicit.

Copy link
Contributor

@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.

Reviewed 12 of 12 files at r5, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @mojganii and @SteffenErn)


ios/MullvadVPN/Extensions/View+Modifier.swift line 12 at r4 (raw file):

Previously, SteffenErn (Steffen Ernst) wrote…

Done.

Change to documentation comments (///) instead and move it to the apply function so that it's visible in Xcode at a glance.


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

Previously, SteffenErn (Steffen Ernst) wrote…

managed to remove those variables entirely 🥳

🙌


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

            .cornerRadius(12)
            .padding(16)
            .onChange(of: connectionViewModel.showsConnectionDetails) { newValue in

Nit: newValue should be renamed to something immediately identifiable.

Copy link
Contributor

@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.

Reviewed 1 of 1 files at r6, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @mojganii and @SteffenErn)

@SteffenErn SteffenErn force-pushed the animate-expansion-of-connection-details-ios-994 branch from 47d4d19 to 4cf7408 Compare February 11, 2025 14:56
Copy link
Contributor Author

@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 1 of 12 files at r5.
Reviewable status: 13 of 15 files reviewed, 2 unresolved discussions (waiting on @mojganii and @rablador)


ios/MullvadVPN/Extensions/View+Modifier.swift line 12 at r4 (raw file):

Previously, rablador (Jon Petersson) wrote…

Change to documentation comments (///) instead and move it to the apply function so that it's visible in Xcode at a glance.

Done.

@SteffenErn SteffenErn force-pushed the animate-expansion-of-connection-details-ios-994 branch from 4cf7408 to bb982f2 Compare February 11, 2025 15:07
rablador
rablador previously approved these changes Feb 11, 2025
Copy link
Contributor

@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.

:lgtm:

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

Copy link
Contributor Author

@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: 14 of 15 files reviewed, 1 unresolved discussion (waiting on @mojganii and @rablador)


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

Previously, SteffenErn (Steffen Ernst) wrote…

16 is the default padding, but I added it back now to be more explicit.

Sorry you are right, I missed that one value was 24.
Done

Copy link
Contributor

@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.

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

Copy link
Contributor

@buggmagnet buggmagnet left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 9 of 12 files at r5, 1 of 1 files at r6, 1 of 2 files at r7, 1 of 1 files at r9, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @mojganii)

@buggmagnet buggmagnet force-pushed the animate-expansion-of-connection-details-ios-994 branch from 38a8757 to fde953e Compare February 13, 2025 09:55
@buggmagnet buggmagnet merged commit 6bb5e59 into main Feb 13, 2025
10 of 11 checks passed
@buggmagnet buggmagnet deleted the animate-expansion-of-connection-details-ios-994 branch February 13, 2025 09:57
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
iOS Issues related to iOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants