Skip to content

feat(pathways): open course details in a modal - #182

Draft
navinkarkera wants to merge 43 commits into
openedx:masterfrom
open-craft:navin/fal-4380/course-details-modal
Draft

navinkarkera wants to merge 43 commits into
openedx:masterfrom
open-craft:navin/fal-4380/course-details-modal

Conversation

@navinkarkera

@navinkarkera navinkarkera commented Nov 2, 2026 •

Copy link
Copy Markdown

Branch: navin/fal-4380/course-details-modal (f6d41e8)

Base: navin/fal-4380/pathway-detail (896aa27)

This is a stacked PR. Review this diff against the pathway detail PR (#181), not master.
This is the final PR in the stack.

Description:

  • Every pathway course gets a Learn more button that opens the embedded Course About in a modal, with actions hidden and sharing pointed at the course's About URL.
  • The course is fetched only while the dialog is open; loading, request failures and an empty record are handled, and loaded content survives a failed refresh.
  • Pathway fixture course IDs (static slugs, not real LMS keys) show the bundled mock in every environment, with no request and no cache write; real course IDs fetch the Course About record. The standalone page still fetches.

Testing instructions (default preview):

  • Open /catalog/pathways/data-engineering-fundamentals, expand "SQL for Data Engineers" and click Learn more.
  • The header shows the pathway name; the body is the bundled fixture, same for every course.
  • No Enroll/View course action and no Studio link appear; the pathway URL stays unchanged.
  • The modal's share links target /catalog/courses/sql-for-data-engineers/about, not the pathway.
  • Close with the header button and Escape; at a narrow viewport content stacks and sharing stays usable.

Testing instructions (real API): replace one course ID in src/__mocks__/pathway.ts with a real LMS course key and restart the dev server; the static slugs otherwise 404.

  • Slow network: a loader, and the request starts only when the dialog opens.
  • Block the request for an uncached course: the support alert replaces the body.
  • Return an empty course record: the same support alert replaces the body.
  • With the page loaded while online, go offline and open an uncached course: a loader instead of a blank body.
  • Load a course, close the dialog, block the request and reopen it: the loaded content stays.

@openedx-webhooks openedx-webhooks added open-source-contribution PR author is not from Axim or 2U core contributor PR author is a Core Contributor (who may or may not have write access to this repo). labels Nov 2, 2026
@openedx-webhooks

Copy link
Copy Markdown

Thanks for the pull request, @navinkarkera!

This repository is currently maintained by @openedx/committers-frontend.

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 approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To 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:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If 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 PR

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


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:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@codecov

codecov Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.71%. Comparing base (586f5f6) to head (3238c91).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #182      +/-   ##
==========================================
+ Coverage   99.56%   99.71%   +0.15%     
==========================================
  Files         101      120      +19     
  Lines         682     1041     +359     
  Branches      165      297     +132     
==========================================
+ Hits          679     1038     +359     
  Misses          2        2              
  Partials        1        1              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@navinkarkera
navinkarkera force-pushed the navin/fal-4380/course-details-modal branch 3 times, most recently from 4a52df9 to 84aaba8 Compare November 3, 2026 11:25
@navinkarkera
navinkarkera force-pushed the navin/fal-4380/course-details-modal branch from 84aaba8 to 480fdf4 Compare November 3, 2026 12:26
Only the LMS /static/images/ and /asset paths are resolved to the LMS base URL; data:, blob:, protocol-relative and other sources stay as authored. Drop the unused exports on the local body props and intro actions.
A query that is no longer pending but has no data, including a successful
null payload, now renders the existing support alert instead of nothing.
Loaded content is still shown when a background refetch fails.
The scrollspy can move the address to a section that is already active, and
a tab click lets the anchor update the hash after the click render. Both left
the sidebar's share destinations on the previous address.

Track the address's section hash in state and derive the active section from
it, so synchronizing '' -> '#about' re-renders even though the active tab does
not change. Scrollspy still uses replaceState; a click performs the fragment
navigation before the state update, so the anchor's default finds the address
unchanged and the page keeps one history entry, fragment scrolling and
modified-click behaviour. Rendering no longer mutates history, so routes with
no pathway keep their address.

Select credential cards by their visible course line and drop the unused
credential-kind class names, which had no style rules.
The page reads the bundled sample record through React Query until a pathway endpoint exists, with explicit loading, error and missing-record states. The navigation hook now mounts with the loaded view so its observers attach, and the loaded view is keyed by record.
A failed pathway request is a support problem, not a bad URL, so the danger alert uses the shared error copy with the configured INFO_EMAIL. The sidebar shares through the shared current-page target constant, and a cached pathway switch resets each expanded list through the keyed loaded view.
No content change: the sample mock ends with a single newline.
The static pathway fixture course IDs are slugs the LMS cannot resolve in every environment, so key the bundled modal content off those IDs instead of the development environment; real course keys keep fetching, with their loading, error and cache behaviour.

Drop the modal's own absolute URL construction and pass the routed URL to the shared share-link resolver, and use the Paragon heading line-height token.
The pathway fixture moved to src/__mocks__/pathway.ts, so the modal and its tests take the shared record instead of the removed sync module. The paused-query case now loads the page before going offline, so only the dialog's query starts paused.
@navinkarkera
navinkarkera force-pushed the navin/fal-4380/course-details-modal branch 3 times, most recently from fcb97a1 to f6d41e8 Compare November 5, 2026 06:52

@ChrisChV ChrisChV left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍

  • I tested this: I followed the testing instructions
  • I read through the code and considered the security, stability and performance implications of the changes.
  • I tested that the UI can be used with a keyboard only (tab order, keyboard controls).
  • Includes tests for bugfixes and/or features added.
  • Includes documentation
  • Includes fixtures that create objects required for manual testing.

@navinkarkera navinkarkera moved this from In Progress to Upstream review in Learning Pathways Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core contributor PR author is a Core Contributor (who may or may not have write access to this repo). open-source-contribution PR author is not from Axim or 2U

Projects

Status: Waiting on Author
Status: Upstream review

Development

Successfully merging this pull request may close these issues.

4 participants