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

GT-2465 resume lesson modal #2352

Merged
merged 23 commits into from
Dec 5, 2024
Merged

Conversation

rachaelblue
Copy link
Collaborator

No description provided.

@@ -0,0 +1,15 @@
//
// GetResumeLessonProgressModalInterfaceStringsRepositoryInterface.swift
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hey @levieggertcru, how do you feel about the naming convention making some names super long? Was debating to take out the word "progress", but still gonna be pretty long either way 🤔

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hey @rachaelblue I know some names get super long. I know we suffix a lot of key names such as UseCase, DomainModel, RepositoryInterface, etc.

And some names get descriptive based on feature so there isn't collisions with other features. (If we could namespace that would help here).

I think we could start omitting Repository from the interface naming.

Maybe GetResumeLessonInterfaceStringsInterface or even GetResumeLessonStringsInterface. A tiny bit shorter.

let buttonWidth = (modalWidth - totalSpaceAroundButtons) / 2

ZStack {
if #available(iOS 15.0, *) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Also @levieggertcru, do you think we can bump the minimum deployment target to 15?

Copy link
Collaborator

Choose a reason for hiding this comment

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

With iOS 18 out I feel like we could. Let me check the analytics data and see where user count is at. Would like to confirm with godtools team as well.

Copy link
Collaborator

Choose a reason for hiding this comment

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

We got the go ahead to bump to iOS 15 so feel free to make that change in this PR.

@rachaelblue rachaelblue marked this pull request as ready for review November 15, 2024 20:53
Copy link

codecov bot commented Nov 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.94%. Comparing base (9c09146) to head (f58b7b4).
Report is 29 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2352      +/-   ##
===========================================
+ Coverage    95.92%   95.94%   +0.01%     
===========================================
  Files           62       62              
  Lines         5323     5323              
===========================================
+ Hits          5106     5107       +1     
+ Misses         217      216       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@levieggertcru levieggertcru left a comment

Choose a reason for hiding this comment

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

Hey @rachaelblue looking good. The only changes I'm seeing is with the coordinator (Flow).

Remember that all navigation decisions will need to go through the coordinator.

Some other things to mention:

  • I'm not crazy about this step name presentResumeLessonModal since it's describing the navigation to perform. There's a couple steps in FlowStep I need to look into changing as well that contain show in the name. Steps really should describe some action or event that has taken place and then the coordinator decides what navigation to perform when that action or event takes place.

  • As best as possible I want to avoid injecting closures into ViewModels for navigation steps. Instead should use the FlowDelegate.

Changes requested:

  • Instead of LessonViewModel.swift making the decision to present the Resume Lesson Modal, this decision should happen in the flow. I would say LessonFlow can perform this decision. So the LessonFlow would first check to see if Resume Lesson Modal should be presented before performing navigation to the lesson.

  • Remove closures in ResumeLessonProgressModalViewModel.swift and instead perform navigation steps on the FlowDelegate. If start over is tapped from the Resume Lesson Modal, then the flow will start the lesson from the beginning. If continue is tapped from the Resume Lesson Modal, then the flow will start the lesson from the last recorded progress.

@rachaelblue rachaelblue marked this pull request as draft November 19, 2024 21:06
@rachaelblue
Copy link
Collaborator Author

Hey @levieggertcru, I originally was presenting the modal from the AppFlow and then navigating to the lesson after the user made a selection, but there's a slight delay when the lesson loads/presents, and it looked awkward to have the modal disappear and see no lesson for a second. So my solution was to have the lesson and modal present nearly simultaneously so that the lesson is already behind the modal when the user makes a selection, and the page number gets updated if needed. Visually this looks better, but does add the complication that the lesson opens before we know whether the user wants to resume or restart. I tried making that happen from the lesson flow instead, but it does feel a little weird for the flow to be holding onto the viewModel in order to get page info/update the page. Let me know what you think.

@rachaelblue rachaelblue marked this pull request as ready for review November 20, 2024 01:43
@levieggertcru
Copy link
Collaborator

levieggertcru commented Nov 20, 2024

Hey @rachaelblue what if you push the LessonView onto the navigation stack with animated false and then dismiss the resume lesson modal? Is there still some delay in the LessonView itself? I know that view waits for the layout constraints to complete before doing any navigation.

@rachaelblue
Copy link
Collaborator Author

Hey @levieggertcru, that did work better to present LessonView without animation before dismissing the modal. Felt a little weird moving some initialization around in the LessonFlow now, so let me know what you think. Thanks!

levieggertcru
levieggertcru previously approved these changes Dec 4, 2024
@levieggertcru levieggertcru self-requested a review December 4, 2024 23:20
levieggertcru
levieggertcru previously approved these changes Dec 4, 2024
@levieggertcru levieggertcru self-requested a review December 5, 2024 00:10
@rachaelblue rachaelblue merged commit 07e4a7b into develop Dec 5, 2024
4 checks passed
@rachaelblue rachaelblue deleted the GT-2465-Resume-Lesson-Modal branch December 5, 2024 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants