Skip to content

feat(pathways): add pathway detail page - #181

Draft
navinkarkera wants to merge 38 commits into
openedx:masterfrom
open-craft:navin/fal-4380/pathway-detail
Draft

navinkarkera wants to merge 38 commits into
openedx:masterfrom
open-craft:navin/fal-4380/pathway-detail

Conversation

@navinkarkera

@navinkarkera navinkarkera commented Nov 2, 2026 •

Copy link
Copy Markdown

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

Base: navin/fal-4380/embeddable-course-about (936b6db)

This is a stacked PR. Review this diff against the embeddable Course About PR (#180), not master.
Final PR: feat(pathways): open course details in a modal.

Description:

  • Adds the pathway page: hero and facts, About and Credentials, sticky navigation with hash sync, and pathway sharing.
  • Sample data lives in src/__mocks__/pathway.ts and is loaded through an API function and a React Query hook; there is no real backend endpoint yet. Loading, request failures and a missing record each show their own state, and a failed refresh keeps the loaded record. The Enroll button is intentionally disabled and there is no Learn more button or modal yet.

Screenshots

screencapture-apps-local-openedx-io-1998-catalog-pathways-full-stack-web-development-2026-11-05-19_28_17 pr181-mobile

Testing instructions:

  • Open /catalog/pathways/data-engineering-fundamentals: the title uses the pathway and site names; the hero shows facts and the disabled Enroll button.
  • Courses: six of eight rows show; See more reveals all eight, and each row expands on its own.
  • Credentials: the featured Bootcamp Certificate stays visible above the list; the credential list also starts at six and expands to eight, independently.
  • Scrolling pins the nav and shows a bar with the start date and a disabled Enroll button; the hero's Enroll button hides while the bar is shown and returns on scroll up.
  • The About and Credentials links update the hash and leave one item active; loading #credentials starts with Credentials active.
  • Sidebar share links (X, Facebook, email) use the current URL, including the active hash.
  • Repeat the navigation and expansion checks at a narrow viewport.

AI Disclosure: Co-authored by GPT 6.1 Sol

@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.70%. Comparing base (586f5f6) to head (2ce4f47).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #181      +/-   ##
==========================================
+ Coverage   99.56%   99.70%   +0.14%     
==========================================
  Files         101      119      +18     
  Lines         682     1014     +332     
  Branches      165      272     +107     
==========================================
+ Hits          679     1011     +332     
  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/pathway-detail branch 2 times, most recently from 6ce1a11 to a046ee2 Compare November 3, 2026 10:37
@navinkarkera
navinkarkera force-pushed the navin/fal-4380/pathway-detail branch from 306e15c to ac7c699 Compare November 3, 2026 12:26
@rpenido rpenido moved this to In Progress in Learning Pathways Nov 3, 2026
The builder now returns only the rendered links; no host read the resolved href, so the field and its rationale are gone and the barrel no longer re-exports the result type.

Adds a SidebarSocial render/rerender test that fails if the destinations are cached instead of rebuilt from the live location.
@navinkarkera
navinkarkera force-pushed the navin/fal-4380/pathway-detail branch from ac7c699 to ba35c0e Compare November 3, 2026 18:46
@mphilbrick211 mphilbrick211 moved this from Needs Triage to Waiting on Author in Contributions Nov 4, 2026
<span className="d-inline-flex align-items-center">{course.pace}</span>
<span className="d-inline-flex align-items-center">
<Icon src={isBadge ? WorkspacePremium : CourseContentIcon} size="sm" className="text-info-800" />
{intl.formatMessage(isBadge ? messages.badgeCount : messages.certificateCount, { count })}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Is it possible to use <FormattedMessage> here?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Changed the count to use FormattedMessage.

Comment on lines +40 to +59
<Card
key={credential.id}
className={`pathway-detail-credential-card justify-content-center border-0 ${isBadge
? 'bg-primary-100'
: 'bg-light-100'}`}
>
<Card.Body className="d-flex flex-column align-items-center text-center p-4">
{isBadge
? <Icon src={WorkspacePremium} size="lg" className="text-info-800 mb-3" />
: <CertificateIcon aria-hidden className="mb-3" />}
<strong>
{intl.formatMessage(
isBadge ? messages.earnBadgeTitle : messages.earnCertificateTitle,
{ rule: credential.rule },
)}
</strong>
<span className="small">
{intl.formatMessage(messages.credentialCourseTitle, { title: credential.courseTitle })}
</span>
</Card.Body>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Could you extract this Card into a separate component? That way, it would look cleaner.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Moved the card into PathwayCredentialCard.

Comment thread src/pathway-detail/PathwayHero.tsx Outdated
}

export const PathwayHero = ({ pathway, isNavSticky }: PathwayHeroProps) => {
const intl = useIntl();

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 think you can use <FormattedMessage> here and simplify this component

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Changed the hero text to use FormattedMessage.

Comment thread src/pathway-detail/data.ts Outdated
* The screenshots' course summaries disagreed there ("1 badge" for a course
* whose credential is a certificate, and vice versa); the list is authoritative.
*/
export const DATA_ENGINEERING_PATHWAY: PathwayDetailData = {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Can we convert these fixtures into mocks and use them in tests, as well as for test data in the UI, without a backend? I think we should follow the convention that @rpenido proposed. If so, this PR would need the API and API hooks layer.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Moved the sample data to the shared mocks. The page now gets it through an API function and a query hook.

Comment thread src/pathway-detail/messages.ts Outdated

const messages = defineMessages({
notFound: {
id: 'category.not-found-page.title',

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nit

Suggested change
id: 'category.not-found-page.title',
id: 'category.pathway-detail.not-found-page.title',

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Changed it to catalog.pathway-detail.not-found-page.title to match the other messages.

Comment thread src/pathway-detail/messages.ts Outdated
description: 'Email body for sharing the pathway.',
},
pageTitle: {
id: 'pathway.page.title',

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
id: 'pathway.page.title',
id: 'catalog.pathway-detail.page.title',

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Changed it to catalog.pathway-detail.page.title.

const visibleCourses = pathway.courses.slice(0, showAllCourses ? undefined : INITIAL_VISIBLE_COUNT);

return (
<>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This <> is unnecessary.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This fragment was there for the course modal in #182. I removed it from #181 and added it back with the modal in #182.

const visibleCourses = pathway.courses.slice(0, showAllCourses ? undefined : INITIAL_VISIBLE_COUNT);

return (
<>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This <> is unnecessary.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Same fix here. The fragment is removed in #181 and added with the modal in #182.

<section id="about" className="pathway-detail-section d-flex flex-column gap-3">
<h2 className="h3 mb-2">{intl.formatMessage(messages.aboutHeading)}</h2>
{pathway.about.map(paragraph => (
<p key={paragraph}>{paragraph}</p>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nit: Using paragraph as a key can be volatile; at some point, two identical paragraph entries could exist.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Changed this to use the index as the key. These are plain text paragraphs, so I added a small lint exception.

@ChrisChV

ChrisChV commented Nov 5, 2026

Copy link
Copy Markdown

@navinkarkera, could you also add screenshots to the PR description?

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.
@navinkarkera
navinkarkera force-pushed the navin/fal-4380/pathway-detail branch 2 times, most recently from b6040ce to 896aa27 Compare November 5, 2026 06:52
@navinkarkera

Copy link
Copy Markdown
Author

@ChrisChV Done.

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

@navinkarkera Looks good 👍

  • I tested this: I followed the testing instructions and verified the new page
  • 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