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

feat: [FC-0047] Course progress and collapsing sections #446

Merged

Conversation

IvanStepanok
Copy link
Contributor

@IvanStepanok IvanStepanok commented May 31, 2024

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

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label May 31, 2024
@openedx-webhooks
Copy link

openedx-webhooks commented May 31, 2024

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:

  • supporting documentation
  • Open edX discussion forum threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

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.

@volodymyr-chekyrta
Copy link
Contributor

The arrow is pointing in the wrong direction
image

@volodymyr-chekyrta
Copy link
Contributor

By design, arrows should be displayed only in sections with assignments.

Design Device
image image

Copy link
Contributor

@volodymyr-chekyrta volodymyr-chekyrta left a 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
Copy link
Contributor

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) {
Copy link
Contributor

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)

Comment on lines 35 to 37
}

.cornerRadius(10)
Copy link
Contributor

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)

Comment on lines 72 to 84
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: {
Copy link
Contributor

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: {
...

@volodymyr-chekyrta
Copy link
Contributor

It's not really critical, but the animation works weird when there is only 1 element in it.
The element appears before the container is resized.

Screen.Recording.2024-05-31.at.17.18.45.mov

@volodymyr-chekyrta volodymyr-chekyrta changed the title feat: course home navigation feat: [FC-0047] Course progress and collapsing sections May 31, 2024
@IvanStepanok
Copy link
Contributor Author

@volodymyr-chekyrta Thanks for the review! All requested changes have been made🙌

Copy link
Contributor

@volodymyr-chekyrta volodymyr-chekyrta left a 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.

@volodymyr-chekyrta volodymyr-chekyrta marked this pull request as ready for review May 31, 2024 15:35
@sdaitzman
Copy link

Hi @IvanStepanok, this looks great overall! A couple of design questions/feedback I wanted to check on:

  1. In light mode, sections should use the light theme shade color #F9FAFB as their background color. It looks like this might be missing from the video
  2. In dark mode, the download icon should use the lighter dark theme accent text color #879FF5 for contrast/accessibility reasons

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

@IvanStepanok
Copy link
Contributor Author

Hi @sdaitzman and thanks for paying so much attention to details!
Please, take a look at my changes. The download icon had the wrong color, but in the light theme, not in the dark☺️

Simulator Screenshot - iPhone 15 - 2024-06-04 at 23 20 50

@sdaitzman
Copy link

Thanks so much @IvanStepanok! Just to confirm, is the download icon in dark mode using #879FF5? In that screenshot, I see a value of #5378F8, but it's possible that's just an image encoding/color space variation.

Other than that, everything looks great to me/ready to merge from a design standpoint, thanks for these updates!

Screenshot 2024-06-05 at 10 31 19 AM

@IvanStepanok
Copy link
Contributor Author

Hi, @sdaitzman
For some reason when you load icons and make a screenshot, they have a little difference in color measurement. I think is because of different color profiles used on real device and the simulator. I found a topic about this, but anyway, I think all we can do is just accept the rules🙌

@@ -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)
Copy link
Contributor

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 {
Copy link
Contributor

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 {
Copy link
Contributor

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 {
Copy link
Contributor

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

@volodymyr-chekyrta volodymyr-chekyrta merged commit d380551 into openedx:develop Jun 7, 2024
3 checks passed
@openedx-webhooks
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open-source-contribution PR author is not from Axim or 2U
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants