-
Notifications
You must be signed in to change notification settings - Fork 205
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: legacy course navigation #1239
base: master
Are you sure you want to change the base?
feat: legacy course navigation #1239
Conversation
Thanks for the pull request, @ArturGaspar! What's next?Please work through the following steps to get your changes ready for engineering review: 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. 🔘 Update the status of your PRYour PR is currently marked as a draft. After completing the steps above, update its status by clicking "Ready for Review", or removing "WIP" from the title, as appropriate. 🔘 Let us know that your PR is ready for review:Who will review my changes?This repository is currently maintained by Where can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:
When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
@ArturGaspar Thank you for this contribution! Please let me know when internal review is done and the build is green. @jmakowski1123 This is a user-facing change so we'll most likely need a feature ticket for it. Could you please confirm? |
@ArturGaspar, this needs to pass through the client's UX QA first, so we can convert the PR to a draft for now. cc: @itsjeyd |
@@ -123,6 +123,13 @@ const OutlineTab = ({ intl }) => { | |||
} | |||
}, [location.search]); | |||
|
|||
// Remove the initial # sign. |
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.
We should add a higher-level comment above this one to explain what we do here (and why).
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.
@Agrendalath Please let me know if it's good in the latest version now.
@@ -86,7 +87,7 @@ const SequenceLink = ({ | |||
return ( | |||
<li> | |||
<div className={classNames('', { 'mt-2 pt-2 border-top border-light': !first })}> | |||
<div className="row w-100 m-0"> | |||
<div className={classNames('row w-100 m-0', { 'bg-light-200': selected })}> |
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.
I recalled that the legacy approach also scrolls the page down to the highlighted unit. This is particularly useful on mobile devices. We cannot rely on adding id={id}
(e.g., to the <li>
tag), but we could do something like this:
const sequenceLinkRef = useRef(null);
const mutationObserver = useRef(null);
// Scroll to the selected element.
useEffect(() => {
if (selected) {
mutationObserver.current = new MutationObserver((mutationsList, observer) => {
// Check if the element is already in the DOM.
if (sequenceLinkRef.current && document.body.contains(sequenceLinkRef.current)) {
sequenceLinkRef.current.scrollIntoView({ behavior: 'smooth' });
// Disconnect the observer once the element is found and scrolled to.
observer.disconnect();
}
});
mutationObserver.current.observe(document.body, { childList: true, subtree: true });
}
// Clean up the observer on component unmount.
return () => {
if (mutationObserver.current) {
mutationObserver.current.disconnect();
}
};
}, [selected]);
sequenceLinkRef
can be added to the li
element.
However, this would only work for the sequences. We should think of something that could be reused for sections and sequences.
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.
I did it without the MutationObserver and it appears to work as expected, and for both section and subsection links. Implementation is in src/course-home/outline-tab/hooks.js
.
@@ -86,7 +87,7 @@ const SequenceLink = ({ | |||
return ( | |||
<li> | |||
<div className={classNames('', { 'mt-2 pt-2 border-top border-light': !first })}> | |||
<div className="row w-100 m-0"> | |||
<div className={classNames('row w-100 m-0', { 'bg-light-200': selected })}> |
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.
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.
I initially did it that way because the first and last elements appear a bit taller than the others (due to the container having more padding), but I have changed this now and updated the screenshots in the PR.
f158ea9
to
d6a40d8
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1239 +/- ##
==========================================
+ Coverage 87.30% 87.96% +0.65%
==========================================
Files 275 277 +2
Lines 4717 4743 +26
Branches 1190 1199 +9
==========================================
+ Hits 4118 4172 +54
+ Misses 580 555 -25
+ Partials 19 16 -3 ☔ View full report in Codecov by Sentry. |
93fb125
to
cbe1c51
Compare
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.
@ArturGaspar, looks good! Just two minor comments.
I'm not leaving a "formal" +1 on this PR yet, as we want to wait for the client's QA.
@@ -173,7 +182,11 @@ const OutlineTab = ({ intl }) => { | |||
<Section | |||
key={sectionId} | |||
courseId={courseId} | |||
defaultOpen={sections[sectionId].resumeBlock} | |||
defaultOpen={ | |||
(selectedSectionId !== undefined) |
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.
(selectedSectionId !== undefined) | |
(selectedSectionId) |
Nit: it should be less error-prone if we checked all falsy values.
@import "~@edx/paragon/scss/core/core"; | ||
@import "~@edx/brand/paragon/overrides"; | ||
|
||
.section > div > div > .collapsible-body { |
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.
.section > div > div > .collapsible-body { | |
.section .collapsible-body { |
This should be specific enough - we should not strictly rely on the Paragon's implementation.
cbe1c51
to
9a04514
Compare
9a04514
to
1f092c8
Compare
Add an option to enable the legacy course navigation where clicking a breadcrumb leads to the course index page highlighting the selected section.
1f092c8
to
2a6b218
Compare
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.
👍
- I tested this: checked that the legacy course navigation works as expected
- I read through the code
- I checked for accessibility issues: n/a
- Includes documentation: n/a
@ArturGaspar, please mark this PR as ready for review. I left one review comment on the backport PR (open-craft#6 (comment)) instead of this one. I'm mentioning this for the full context |
There is a larger project in play now to bring back the sidebar navigation experience, which was the original experience that was replaced by the breadcrumbs. Part of the consideration in that project is how many navigation options we need, and the breadcrumb pathway is being reconsidered in that context. We need to come to a decision first about which navigation experience the core product supports as the primary one, before investing in this. Suggest to put this on temporarily on hold. https://openedx.atlassian.net/wiki/spaces/OEPM/pages/3909779457/Feature+Enhancement+Proposal+Restore+the+left-sidebar+navigation+in+the+learner+experience |
@jmakowski1123, the project you mentioned sounds like a significant change. Do you know if there is any timeline for making this decision? This PR brings back the legacy (non-MFE) experience - it only changes the action triggered by clicking on the text in the course navigation. If we decide to delete the breadcrumbs, the scope of that project won't be altered in any way by this change. cc: @itsjeyd |
I'd like to push for agreement/decision by the end of Jan, with the goal of beginning implementation in Feb for hopeful inclusion in Redwood. You can follow, and join, the conversation here, please feel free to join the wiki thread: https://openedx.atlassian.net/wiki/spaces/OEPM/pages/3909779457/Feature+Enhancement+Proposal+Restore+the+left-sidebar+navigation+in+the+learner+experience |
Hey @jmakowski1123, based on a brief look at the wiki thread it seems like product review is still in progress. Do you have any updates about the timeline for this work? |
Hey @cassiezamparini, would you have time to help get the ball rolling again here in terms of product review? |
@itsjeyd Sure thing! I'll add this to my to-do list for tomorrow :) |
@itsjeyd It looks like this feature is on hold based on the comments from @jmakowski1123 in this thread. But I see you linked to my comment on the sidebar query. I'll follow up on this on the Wiki. Also in order to do a product review, we need to follow the new process @ArturGaspar @Agrendalath - as outlined here. Please review the link above and follow the steps I mention below:
Please let me know if anything is unclear. We are still in the process of ironing out this new product review process, so your feedback will be welcomed. |
@itsjeyd @Agrendalath @ArturGaspar In relation to Feature Enhancement Proposal: Restore the left-sidebar navigation in the learner experience:
Thoughts? |
@cassiezamparini Thanks for looking into the status of product review for this PR!
I don't know what GA means, and I'm not sure how to proceed from here. If the dev phase is starting now, does that mean we can consider this PR approved from the product perspective? -- Either way, it's probably worth noting that my involvement here is limited to OSPR management (which currently doesn't include tracking individual steps of the product review process) 🙂 From that perspective, the main question to answer is the one above, i.e. whether product review is done and we can move forward with finding engineering reviewers for this PR. -- |
Internal-Ref: https://tasks.opencraft.com/browse/BB-8160 |
As part of the project to reimplement the left sidebar navigation (full MVP spec here), I do not think it is necessary to invest in any legacy navigation experiences. The project to reimplement the left sidebar nav is a separate project from this proposal, and I think it will be possible to close this proposal as a result of the other project. I'm assuming the point of proposing to revive the legacy breadcrumb experience is to make it easier for learners to see where they are in the course outline? This problem will be solved when we reimplement the left sidebar, as learners will be able to wayfind through the course outline without leaving the content. The left sidebar will be revived for the Redwood release in June and will be the default experience out of the box. @ArturGaspar does this meet your needs, and if so, can we close this proposal? |
@jmakowski1123 It is possible that the sidebar navigation would fulfil our needs, so I am converting this PR to a draft until the released version can be evaluated. Thank you. |
Hey @ArturGaspar and @Agrendalath, just checking in:
Do you have any updates on when this evaluation would happen? |
@itsjeyd, it's in progress. We should have more info within the next two months. cc: @ArturGaspar |
Sounds good, thanks @Agrendalath. |
@Agrendalath It's been two months now, so checking in to see if you have any updates to share :) |
@itsjeyd, we haven't gotten a clear decision about this yet. It may take another month or two. |
Description
Add an option to enable the legacy course navigation where clicking a breadcrumb leads to the course index page highlighting the selected section.
Testing instructions