-
Notifications
You must be signed in to change notification settings - Fork 4k
fix: use MFE-aware URL instead of legacy when generating block URL #36526
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
base: master
Are you sure you want to change the base?
fix: use MFE-aware URL instead of legacy when generating block URL #36526
Conversation
Thanks for the pull request, @efortish! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are 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. 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. |
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.
Thank you for the contribution! I see this issue fixes the access of the notes from the course tab, where now it redirects to the correct unit. Now, I think previously this also redirected to the corresponding component with the annotation within the unit which is also broken right now. Can you help me confirm this? If this is the case, I think it'd be a good idea to open a follow up PR to also fix this issue. Let me know what you think!
Co-authored-by: Maria Grimaldi <[email protected]>
Hello @mariajgrimaldi , thank you so much for the review, Can you please explain to me what are you referring with |
Description
When using the Notes feature in a course with the Learning MFE enabled, clicking on a note from the Notes tab redirected users to the last visited unit rather than to the unit containing the note. This happened because the Notes component was generating URLs using the legacy format without considering whether the Learning MFE was active.
Objective
Fix the EdxNotes feature to properly navigate to note locations when the Learning MFE is enabled, ensuring that when a user clicks on a note from the Notes tab, they are directed to the correct unit containing that note rather than to the last visited unit.
Technical Approach
The issue was identified in the
get_block_context
function within helpers.py. This function was using a hardcoded approach to generate URLs for vertical blocks, which always produced URLs in the legacy format:The solution was to replace the legacy URL generation logic with a call to the existing
get_courseware_url
function from url_helpers.py. This function already handles proper URL generation based on whether the Learning MFE is active or not:Achievements
Correct navigation to notes: Users can now click on notes in the Notes tab and be taken directly to the unit containing the note, regardless of whether they're using the legacy or MFE experience.
Consistent user experience: The navigation behavior is now consistent between the legacy view and Learning MFE, providing a seamless experience for users.
Proper URL generation: The Notes component now generates URLs that are compatible with both legacy and MFE views by leveraging the platform's existing URL generation infrastructure.
Testing cases
2025-04-14.23-38-31.mp4
Related Issues
[TC_LEARNER_39] Notes tab linking not working