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] Full-Bleed Header + Top Navigation #385

Merged

Conversation

IvanStepanok
Copy link
Contributor

@IvanStepanok IvanStepanok commented Apr 2, 2024

This PR introduces updated navigation and banner for the course home.

Light and Dark theme:
Simulator Screen Recording - iPhone 15 Pro Max - 2024-04-02 at 17 06 12 Simulator Screen Recording - iPhone 15 Pro Max - 2024-04-02 at 17 15 01

In the horizontal state, the top bar is always collapsed.
Simulator Screen Recording - iPhone 15 Pro Max - 2024-04-02 at 17 19 22

The iPad version doesn't have a collapsing effect.
Simulator Screen Recording - iPad (10th generation) - 2024-04-02 at 17 22 35

🚨 Breaking changes 🚨:
The COURSE_BANNER_ENABLED and COURSE_TOP_TAB_BAR_ENABLED feature flags have been removed.

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

openedx-webhooks commented Apr 2, 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 volodymyr-chekyrta changed the title Feat/fc 47 add course home header feat: [FC-0047] Full-Bleed Header + Top Navigation Apr 2, 2024
@volodymyr-chekyrta volodymyr-chekyrta added the product review PR requires product review before merging label Apr 2, 2024
@volodymyr-chekyrta
Copy link
Contributor

Ready for product review

@volodymyr-chekyrta volodymyr-chekyrta marked this pull request as ready for review April 4, 2024 15:03
@marcotuts marcotuts self-requested a review April 4, 2024 18:11
Copy link

@marcotuts marcotuts left a comment

Choose a reason for hiding this comment

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

Product review only 👍

@volodymyr-chekyrta volodymyr-chekyrta self-requested a review April 5, 2024 09:06
@volodymyr-chekyrta volodymyr-chekyrta requested a review from rnr April 17, 2024 14:11
@rnr
Copy link
Contributor

rnr commented Apr 18, 2024

Issues with loading indicator:

  1. Changed loading indicator for Course Home view (is it approved?):
Before After
  1. Loading indicator for "More" tab:
  1. Different size on Dicussions View for Refresh indicator:

@rnr
Copy link
Contributor

rnr commented Apr 18, 2024

Issues with Scroll

  1. When user scrolls on Discussion tab it doesn't collapse header (how it does on Home tab for example)
Screen.Recording.2024-04-18.at.08.36.15.mov
  1. Can't scroll to bottom on Dates tab (I guess it happens when content takes up a bit more space than is available on the screen). Strange animation for this case:
Screen.Recording.2024-04-18.at.08.35.22.mov

@rnr rnr requested review from saeedbashir and forgotvas April 18, 2024 07:04
@saeedbashir
Copy link
Contributor

saeedbashir commented Apr 18, 2024

The progress bar location is odd if we use pull to refresh while data is loading. and If we interact with UI white loading the bleeding header isn't working properly.

loading.and.scroll.issues.mov

@IvanStepanok
Copy link
Contributor Author

@rnr Thanks for your review!🙌

  1. Old loading indicators are returned.
    Simulator Screenshot - iPhone 15 Pro Max - 2024-04-18 at 13 44 02

  2. Fixed the “More” loading indicator.
    Simulator Screenshot - iPhone 15 Pro Max - 2024-04-18 at 13 45 19

  3. Pull to refresh indicators are equal now.
    Simulator Screenshot - iPhone 15 Pro Max - 2024-04-18 at 13 45 48 Simulator Screenshot - iPhone 15 Pro Max - 2024-04-18 at 13 45 42

Scroll issues

  1. The discussion tab collapsing issue is fixed.
Simulator.Screen.Recording.-.iPhone.15.Pro.Max.-.2024-04-18.at.18.22.28.mp4
  1. The animation glitch on some scroll views is fixed by adding new logic.
Screen.Recording.2024-04-18.at.18.25.03.mov

If the content height in ScrollView is not enough to collapse the header, collapsing mode are disabled. Thanks for paying attention to this bug, it's very important.🙌

@saeedbashir Thanks for your review, too!❤️

  1. Fixed a bug with changes in header size after loading data.
  2. The header is no longer transparent during loading.
  3. Progress bars are currently in the normal position.
Screen.Recording.2024-04-18.at.18.35.21.mov

If you discover any new bugs, I'd be delighted to fix them!

@rnr
Copy link
Contributor

rnr commented Apr 19, 2024

If the content height in ScrollView is not enough to collapse the header, collapsing mode are disabled.

I think we need to disable collapse mode for the 'More' tab as it tries to collapse, but we have two rows (Distributions and Announcements) at the moment. Thank you

Screen.Recording.2024-04-19.at.11.28.27.mov

@rnr
Copy link
Contributor

rnr commented Apr 19, 2024

Is it a design decision to disable this collapse mode for iPad in general?

Screen.Recording.2024-04-19.at.11.37.37.mov

Copy link
Contributor

@saeedbashir saeedbashir left a comment

Choose a reason for hiding this comment

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

  • The header is not collapsing on home and videos tab.
  • The back button is not showing the menu on long press.
Screen.Recording.2024-04-19.at.4.26.55.PM.mov

@@ -0,0 +1,173 @@
//
// TopHeaderView.swift
Copy link
Contributor

Choose a reason for hiding this comment

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

How about giving it a more meaningful name like course header view or some as per its functionality Thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renamed to CourseHeaderView

Comment on lines 15 to 25
@ObservedObject var viewModel: CourseContainerViewModel
var title: String
@Binding var collapsed: Bool
var containerWidth: CGFloat
var animationNamespace: Namespace.ID
@Binding private var isAnimatingForTap: Bool
@Environment(\.isHorizontal) private var isHorizontal

let collapsedHorizontalHeight: CGFloat = 230
let collapsedVerticalHeight: CGFloat = 260
let expandedHeight: CGFloat = 300
Copy link
Contributor

Choose a reason for hiding this comment

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

All these variables can be private.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! Fixed

Comment on lines 27 to 33
private struct GeometryName {
static let backButton = "backButton"
static let topTabBar = "topTabBar"
static let blurSecondaryBg = "blurSecondaryBg"
static let blurPrimaryBg = "blurPrimaryBg"
static let blurBg = "blurBg"
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need a struct here, how about converting it to an enum?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! Good idea

Comment on lines 63 to 66
}
}
.disabled(true)
.ignoresSafeArea()
Copy link
Contributor

Choose a reason for hiding this comment

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

The code needs formatting here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure

.ignoresSafeArea(edges: .top)
}

private func topTabBar(containerWidth: CGFloat) -> some View {
Copy link
Contributor

Choose a reason for hiding this comment

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

How about renaming it to courseMenuBar or courseTabbar? thoughts?


import SwiftUI

public struct RefreshProgressView: View {
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess it's being used for pull to refresh, how about renaming it as per functionality thoughts?


import SwiftUI

public struct ResponsiveView: View {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible to give it a meaningful name as every view is by default responsive view.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renamed to DynamicOffsetView. Good?

private let expandedHeight: CGFloat = 240
private let coordinateBoundaryLower: CGFloat = -115

@State var lastHeight: CGFloat = 240
Copy link
Contributor

Choose a reason for hiding this comment

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

It can be private

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! Fixed

.overlay(
GeometryReader { geometry -> Color in
guard idiom != .pad, enableCollapsing else {
return Color.clear
Copy link
Contributor

Choose a reason for hiding this comment

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

Color is redundant, you can directly use .clear.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! Fixed

@IvanStepanok
Copy link
Contributor Author

Screen.Recording.2024-04-21.at.21.54.55.mov

@rnr, @saeedbashir, thanks for the review, I appreciate it. Feel free to reach out if you find any new bugs or have questions. Thanks again!

saeedbashir
saeedbashir previously approved these changes Apr 22, 2024
Copy link
Contributor

@saeedbashir saeedbashir left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@IvanStepanok
Copy link
Contributor Author

Is it a design decision to disable this collapse mode for iPad in general?

Screen.Recording.2024-04-19.at.11.37.37.mov

Yes, it is approved with @sdaitzman

@forgotvas
Copy link
Contributor

forgotvas commented Apr 22, 2024

Header bar hides logo by half or more on iPad:

iPhone iPad Portrait iPad Landscape
Simulator Screenshot - iPhone 15 - 2024-04-22 at 12 36 26 big1 big2

UPDATE: It's expected behavior as teams decided on demo call.

@forgotvas
Copy link
Contributor

Back button in wrong position for pages with header on iPad:

Course home Course home (Landscape) Content Content (Landscape)
Simulator Screenshot - iPad (10th generation) - 2024-04-22 at 12 39 01 Simulator Screenshot - iPad (10th generation) - 2024-04-22 at 12 39 34 Simulator Screenshot - iPad (10th generation) - 2024-04-22 at 12 39 03 Simulator Screenshot - iPad (10th generation) - 2024-04-22 at 12 39 31

@forgotvas
Copy link
Contributor

Controller with header doesn't have navigation title:

2024-04-22.12.44.56.mov

@forgotvas
Copy link
Contributor

Resume button doesn't have paddings on top:

develop FC-0047
Simulator Screenshot - iPad (10th generation) - 2024-04-22 at 12 46 30 Simulator Screenshot - iPad (10th generation) - 2024-04-22 at 12 46 32

@forgotvas
Copy link
Contributor

Pull to refresh indicator disappeared from videos tab:

Develop:
https://github.com/openedx/openedx-app-ios/assets/480059/4ec46061-f710-4ca4-9e59-31c51a35a5a9

FC-0047:
https://github.com/openedx/openedx-app-ios/assets/480059/21c9e8b9-091a-4179-beb1-022c0661eac6

@@ -40,7 +40,6 @@ struct ContinueWithView: View {
UnitButtonView(type: .continueLesson, action: action)
.frame(width: 200)
} .padding(.horizontal, 24)
.padding(.top, 32)
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you sure that we don't need that?

@forgotvas forgotvas removed the request for review from rnr April 22, 2024 10:58
@IvanStepanok
Copy link
Contributor Author

Thanks @forgotvas, all your comments have been addressed! I've also vertically centered the banner so that it crops more evenly.

Screen.Recording.2024-04-22.at.21.51.07.mov

@forgotvas
Copy link
Contributor

Thanks, @IvanStepanok, just one was skipped - back button has wrong position it should be at same position as on content page:

course home content
Simulator Screenshot - iPad (10th generation) - 2024-04-22 at 22 35 47 Simulator Screenshot - iPad (10th generation) - 2024-04-22 at 22 42 11

@IvanStepanok
Copy link
Contributor Author

IvanStepanok commented Apr 23, 2024

@forgotvas Thanks for the good idea! The position of the back button is consistent with the design, but I asked Sam Deitzman if it was possible to change the position and they confirmed that it would indeed be better. The Back button is now on the left.

Screen.Recording.2024-04-23.at.10.34.20.mov

Copy link
Contributor

@forgotvas forgotvas left a comment

Choose a reason for hiding this comment

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

LGTM

@volodymyr-chekyrta volodymyr-chekyrta merged commit 0f7f1d4 into openedx:develop Apr 23, 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.

@volodymyr-chekyrta volodymyr-chekyrta deleted the feat/FC_47_add_course_home_header branch April 23, 2024 16:53
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 product review PR requires product review before merging
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

7 participants