-
Notifications
You must be signed in to change notification settings - Fork 16
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
feat: [FC-0047] Course progress and collapsing sections #446
feat: [FC-0047] Course progress and collapsing sections #446
Conversation
Thanks for the pull request, @IvanStepanok! Please note that it may take us up to several weeks or months to complete a review and merge your PR. Feel free to add as much of the following information to the ticket as you can:
All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here. Please let us know once your PR is ready for our review and all tests are green. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good overall; please address the following feedback
Task { | ||
await viewModel.getCourseBlocks(courseID: courseID, withProgress: false) | ||
} | ||
viewModel.updateCourseProgress = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The View shouldn't update Published variables; please encapsulate this logic to the VM function, let's say updateCourseIfNeeded()
public struct CourseProgressView: View { | ||
private var progress: CourseProgress | ||
|
||
public init(progress: CourseProgress) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove extra space
public init(progress: CourseProgress)
-> public init(progress: CourseProgress)
} | ||
|
||
.cornerRadius(10) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove extra line
}
.cornerRadius(10)
Button(action: { | ||
if let chapterIndex, let sequentialIndex { | ||
viewModel.trackSequentialClicked(sequential) | ||
viewModel.router.showCourseVerticalView( | ||
courseID: viewModel.courseStructure?.id ?? "", | ||
courseName: viewModel.courseStructure?.displayName ?? "", | ||
title: sequential.displayName, | ||
chapters: course.childs, | ||
chapterIndex: chapterIndex, | ||
sequentialIndex: sequentialIndex | ||
) | ||
} | ||
}, label: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please format Button to the "each param on own line" style.
Button(
action: {
...
,
label: {
...
It's not really critical, but the animation works weird when there is only 1 element in it. Screen.Recording.2024-05-31.at.17.18.45.mov |
@volodymyr-chekyrta Thanks for the review! All requested changes have been made🙌 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
PR is ready for product/design review.
Hi @IvanStepanok, this looks great overall! A couple of design questions/feedback I wanted to check on:
Both of these are color-related, and the video compression makes it a bit ambiguous whether these colors are already being used, so I wanted to confirm |
Hi @sdaitzman and thanks for paying so much attention to details! |
Thanks so much @IvanStepanok! Just to confirm, is the download icon in dark mode using Other than that, everything looks great to me/ready to merge from a design standpoint, thanks for these updates! |
Hi, @sdaitzman |
@@ -60,6 +64,7 @@ public extension DataLayer { | |||
certificate = try values.decode(Certificate.self, forKey: .certificate) | |||
org = try values.decode(String.self, forKey: .org) | |||
isSelfPaced = try values.decode(Bool.self, forKey: .isSelfPaced) | |||
courseProgress = try values.decode(DataLayer.CourseProgress.self, forKey: .courseProgress) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add ?
after try
since this parameter is optional
@@ -108,21 +107,19 @@ public struct CourseOutlineView: View { | |||
? viewModel.courseVideosStructure | |||
: viewModel.courseStructure { | |||
|
|||
// MARK: - Sections | |||
if viewModel.config.uiComponents.courseNestedListEnabled { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@IvanStepanok
we had logic when courseNestedListEnabled==true
we skip VerticalsView and go to content directly. Could you please add the same? Thank you
|
||
var controllers = navigationController.viewControllers | ||
|
||
if isCourseNestedListEnabled || currentCourseTabSelection == CourseTab.dates.rawValue { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this condition should be present. please use new added flag here. Thank you
@@ -114,7 +111,7 @@ public class PipManager: PipManagerProtocol { | |||
viewControllers.append(try await containerController(for: holder)) | |||
} | |||
|
|||
if !isNestedListEnabled && holder.selectedCourseTab != CourseTab.dates.rawValue { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the same here - please use here new added flag. Thank you
@IvanStepanok 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future. |
Quick Preview
Screen.Recording.2024-05-31.at.18.31.30.mov
Pay attention⚠️
❌ "COURSE_NESTED_LIST_ENABLED" removed
✅ "COURSE_DROPDOWN_NAVIGATION_ENABLED" added
Old implementations in CourseStructureNestedListView.swift and CourseStructureView.swift are removed.
Design:
https://www.figma.com/design/iZ56YMjbRMShCCDxqrqRrR/Open-edX-Mobile-App-All-Screens-v2.1?node-id=9177-44208&t=kHcQmxzck33FVrAT-0