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

Magic Links: Fix window resizing animation + some clean up #1204

Merged
merged 17 commits into from
Jul 26, 2024

Conversation

charliescheer
Copy link
Contributor

@charliescheer charliescheer commented Jul 26, 2024

Fix

We had noticed some wonky animations when pushing and popping from one view to another during the auth login/signup flow. This was causing the size of the window to jump to meet the new view size. Didn't look great. In this PR we have updated the animations so that it will animate smoothly to the new size of the view loaded into the navigation controller. Huge T/Y to @jleandroperez for the assist on this one.

Also while I was in there I fixed an issue where if you don't animate the navigation controller push/pop the views didn't size and the back button didn't hide correctly (we don't really need this, but if we are gonna build the component might as well make it work correctly)

and I did a bit of cleanup to make the methods simpler.

relies on #1202

Test

(Required) List the steps to test the behavior. For example:

  1. Launch Simplenote Mac to the onboarding/auth screen.
  2. Tap on the sign up button, then the back button, then the login button, then the back button again.
  • Confirm that the views animate smoothly
  • Confirm that the back button appears when you go off the initial view and disappears when you return to it.
  • Confirm the size of the window changes to match the new view that appears.

Review

(Required) Add instructions for reviewers. For example:

Only one developer is required to review these changes, but anyone can perform the review.

Release

(Required) Add a concise statement to RELEASE-NOTES.txt if the changes should be included in release notes. Include details about updating the notes in this section. For example:

These changes do not require release notes.

@charliescheer charliescheer added the [feature] login Anything relating to login label Jul 26, 2024
@charliescheer charliescheer added this to the 2.21 milestone Jul 26, 2024
@charliescheer charliescheer self-assigned this Jul 26, 2024
@charliescheer charliescheer changed the base branch from trunk to feature/1187-magic-links July 26, 2024 19:10
@charliescheer charliescheer changed the base branch from feature/1187-magic-links to lantean/1187-debt-fixes July 26, 2024 19:10
Copy link
Contributor

@jleandroperez jleandroperez left a comment

Choose a reason for hiding this comment

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

Works great!! sending you a few notes, TY!!

Simplenote/SPNavigationController.swift Outdated Show resolved Hide resolved
Simplenote/SPNavigationController.swift Outdated Show resolved Hide resolved
Simplenote/SPNavigationController.swift Outdated Show resolved Hide resolved
override func loadView() {
guard let initialViewController = topViewController else {
fatalError()
}

view = NSView()
heightConstraint = view.heightAnchor.constraint(equalToConstant: .zero)
heightConstraint?.isActive = true
Copy link
Contributor

Choose a reason for hiding this comment

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

Since we're now doing this, the minimumHeightConstraint workaround isn't required anymore. We can:

  • Maybe convert this constraint into an IUO? or not?
  • Move the .activate to L57 instead (where miminumHeightConstraint lives now)

Also I'm ... slightly worried about setting it to .zero by default. It is possible, at some point in time, the Window will actually be .zero height.

Simplenote/SPNavigationController.swift Show resolved Hide resolved
Base automatically changed from lantean/1187-debt-fixes to feature/1187-magic-links July 26, 2024 19:48
Copy link
Contributor

@jleandroperez jleandroperez left a comment

Choose a reason for hiding this comment

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

Looks amazing, thank you Charlie!!

:shipit:

@charliescheer charliescheer merged commit 7d63262 into feature/1187-magic-links Jul 26, 2024
8 checks passed
@charliescheer charliescheer deleted the charlie/1187-window-animation branch July 26, 2024 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[feature] login Anything relating to login
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants