Skip to content

feat: add pathway cards and badges [FC-0137] - #176

Open
rpenido wants to merge 9 commits into
openedx:masterfrom
open-craft:rpenido/fal-4373/pathway-cards
Open

rpenido wants to merge 9 commits into
openedx:masterfrom
open-craft:rpenido/fal-4373/pathway-cards

Conversation

@rpenido

@rpenido rpenido commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Stacked PR: this is the third change in the catalog split from #169. #185 is already merged, so the diff against master is this PR only. Review the 8 commits here.

Description

Adds the generic pathway card, the shared card image helper, card badges, and the home page wiring.

  • Adds PathwayCard (title, org, item count, start date, category badge using the backend-provided colors) and the homePathwayCard.v1 slot.
  • Course cards now show a Course badge and share the restyled header with pathway cards (org above the title). There is no feature flag: the badge is always on, and pathway cards render only when the search response contains pathway results. This follows the review on feat: add pathway cards, badges and filters [FC-0137] #169, where the flag was asked to be removed in favour of degrading to "no pathways".
  • Adds src/generic/course-image with resolveImageUrl, IMAGE_PLACEHOLDER and onImageLoadError, replacing getFullImageUrl.
  • Adds pathwayDetailRole and resolves pathway links with resolveRouteByRole, so the site decides the URL. Until the pathway detail route lands (feat(pathways): add pathway detail page #173), a pathway card renders as a non-clickable div instead of a broken link.
  • The home course list dispatches mixed results to the course or pathway card slot.
  • The empty state in the home list now says "No items available".

Supporting information

Part of the catalog split from #169. Branch rpenido/fal-4373/pathway-cards, based on master on top of the merged #185. The role-based links and the course-image helper are taken from #173 so that PR can rebase on top of this stack with minimal conflicts.

Testing instructions

  1. Use the Node version in .nvmrc and install dependencies with npm ci.
  2. Apply the demo patch below, which makes the search client return the bundled mock mixed response for this branch only:
git apply pathway-demo-mock.patch
  1. Start the app with npm run dev and open http://apps.local.openedx.io:1998/catalog.
  2. Verify course cards show the Course badge and that pathway cards render title, org, item count, start date and category badge (Bootcamp, Tutorial).
  3. Pathway cards are not links yet, because the detail route is not part of this PR.
  4. Remove the patch with git checkout -- src/data/catalog-search/api.ts.
pathway-demo-mock.patch
diff --git a/src/data/catalog-search/api.ts b/src/data/catalog-search/api.ts
index 575012d..275d6b6 100644
--- a/src/data/catalog-search/api.ts
+++ b/src/data/catalog-search/api.ts
@@ -1,5 +1,7 @@
 import { camelCaseObject, getAuthenticatedHttpClient } from '@openedx/frontend-base';
 
+import { mockCatalogSearchResponse } from '@src/__mocks__';
+
 import { DEFAULT_PAGE_SIZE, DEFAULT_PAGE_INDEX } from './constants';
 import { getCatalogSearchUrl } from './urls';
 import { addFiltersToFormData } from './utils';
@@ -51,6 +53,10 @@ const normalizeCatalogSearchResponse = (data: any): CatalogSearchResponse => {
 export const fetchCatalogSearch = async (
   params: CatalogSearchParams,
 ): Promise<CatalogSearchResponse> => {
+  // Demo only: serve the bundled mock instead of the backend, so the pathway
+  // cards can be reviewed without a backend that returns pathways.
+  return mockCatalogSearchResponse;
+
   const {
     enableCourseSortingByStartDate = false,
     filters = {},

AI disclosure: Use Claude to help with the split and drafting this pull request description.


Private ref: FAL-4373

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Oct 28, 2026
@openedx-webhooks

openedx-webhooks commented Oct 28, 2026 •

Copy link
Copy Markdown

Thanks for the pull request, @rpenido!

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.

Details
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 Oct 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.60%. Comparing base (a734c56) to head (9536bc0).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #176      +/-   ##
==========================================
+ Coverage   99.57%   99.60%   +0.02%     
==========================================
  Files         101      107       +6     
  Lines         708      750      +42     
  Branches      177      200      +23     
==========================================
+ Hits          705      747      +42     
  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.

@rpenido rpenido changed the title feat: add pathway cards and badges feat: add pathway cards and badges [FC-0137] Oct 28, 2026
@rpenido rpenido moved this to Need Review in Learning Pathways Oct 28, 2026
@mphilbrick211 mphilbrick211 added the FC Relates to an Axim Funded Contribution project label Oct 28, 2026
@mphilbrick211 mphilbrick211 moved this from Needs Triage to Ready for Review in Contributions Oct 28, 2026
@rpenido
rpenido marked this pull request as draft October 29, 2026 15:16
@rpenido
rpenido force-pushed the rpenido/fal-4373/pathway-cards branch from 2152796 to 3f29cec Compare October 29, 2026 15:20
@rpenido
rpenido force-pushed the rpenido/fal-4373/pathway-cards branch 2 times, most recently from 25a9942 to 4b64b89 Compare October 30, 2026 17:29
@mphilbrick211 mphilbrick211 moved this from Ready for Review to Waiting on Author in Contributions Nov 4, 2026
@rpenido
rpenido force-pushed the rpenido/fal-4373/pathway-cards branch from 4b64b89 to 97a891d Compare November 10, 2026 23:08
@rpenido
rpenido force-pushed the rpenido/fal-4373/pathway-cards branch 2 times, most recently from 8aff290 to ad149af Compare November 10, 2026 23:31
@rpenido
rpenido force-pushed the rpenido/fal-4373/pathway-cards branch from ad149af to fc45ca2 Compare November 16, 2026 21:27
@rpenido
rpenido force-pushed the rpenido/fal-4373/pathway-cards branch 2 times, most recently from 06cc3c8 to 2684595 Compare November 24, 2026 16:29
@rpenido
rpenido force-pushed the rpenido/fal-4373/pathway-cards branch 3 times, most recently from 925f208 to 182afd6 Compare December 1, 2026 17:35
brian-smith-tcril pushed a commit that referenced this pull request Dec 1, 2026
- Adds `SearchResponseBase`, `CatalogSearchResult` and `CatalogSearchResponse`, where a result is a `Course` or a `Pathway`. `PathwayData` is the pathway payload type; the card component comes in the next PR.
- Normalizes `result.type` in `normalizeCatalogSearchResponse`: pathway rows stay `pathway` and every other row becomes `course`, so callers can test `type === 'course'` instead of `!== 'pathway'`. The legacy `_doc` arm is removed from `Course`.
- Adds optional `labels` to aggregation facets, and preserves the dynamic keys under `aggs.*.labels`, which are backend slugs and must be sent back verbatim as filter values. The `aggs.*.terms` fix is in #185.
- Adds the `catalogDataTable.v1` and `catalogDataTableCardView.v1` slot ids. Both carry the mixed response and wrap the deprecated `courseCatalogDataTable.v1` and `courseCatalogDataTableCardView.v1`, which keep `CourseListSearchResponse` and `totalCourses` and only receive course rows. `totalItems` is the new data table prop.
- Restores `CourseListSearchResponse` to its pre-pathway declaration and exports it next to `CatalogSearchResponse`.
- Widens the hook, `useCatalogData` and the page types to the mixed response.
- Until the pathway card exists, the home list uses a switch that skips pathway results. #176 adds the pathway card case.
@rpenido
rpenido force-pushed the rpenido/fal-4373/pathway-cards branch from 182afd6 to 63d3947 Compare December 1, 2026 17:46
@rpenido
rpenido force-pushed the rpenido/fal-4373/pathway-cards branch from 63d3947 to c35f8bf Compare December 1, 2026 17:54
@rpenido
rpenido marked this pull request as ready for review December 1, 2026 17:56
@rpenido

rpenido commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for merging the PRs @brian-smith-tcril!
This is the next one in the stack, and it has not been reviewed yet.

@brian-smith-tcril brian-smith-tcril left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Overall this is looking pretty good!

I left a couple comments. One about clickability and one about new tokens being added.

I also see quite a bit of custom styling being added in this PR. I'm going to poke at the code a bit to see if I can reduce the amount of custom css needed and leave a comment with my findings.

Comment thread src/generic/pathway-card/index.tsx Outdated
Comment on lines +43 to +48
as={pathwayDetailUrl ? Link : 'div'}
to={pathwayDetailUrl}
// TODO: Temporary use of `d-flex` to fix alignment. Remove once the related Paragon issue
// (https://github.com/openedx/paragon/issues/3792) is resolved.
className={`d-flex ${isExtraSmall ? 'w-100' : ''}`}
isClickable={!isLoading}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The PR description says

a pathway card renders as a non-clickable div instead of a broken link.

but isClickable sets the clickable class which sets cursor: pointer and the box shadow.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks @brian-smith-tcril! Fixed here: d26963e

Comment thread src/style.scss Outdated
Comment on lines +7 to +10
:root {
--catalog-course-badge-background-color: var(--pgn-color-light-500);
--catalog-course-badge-color: black;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Curious about this one as it came up in openedx/frontend-app-learner-dashboard#879 (comment)

In that thread I mentioned that the way it was implemented in that PR would mean

Courses are always going to be whatever the theme has for the text-dark-900/bg-light-500 tokens

and asked

Is the idea that site operators can't configure the colors used for courses?

and got responses saying that was "the expected behavior" and "the idea for now."

Using application-level tokens here would mean a theme author would be able to change the badge color in the catalog without changing everything that uses light-500 and dark-900, but then the badges on learner dash wouldn't match.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks @brian-smith-tcril. I missed that.
We had it in the dashboard before, and I didn't remove it here when we dropped it.
Fixed here: 7e06681

@rpenido
rpenido force-pushed the rpenido/fal-4373/pathway-cards branch from e6a8c36 to 6619b49 Compare December 1, 2026 23:15
@rpenido
rpenido force-pushed the rpenido/fal-4373/pathway-cards branch from 6619b49 to 71a7a32 Compare December 1, 2026 23:20
@rpenido

rpenido commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review @brian-smith-tcril!

I also see quite a bit of custom styling being added in this PR. I'm going to poke at the code a bit to see if I can reduce the amount of custom css needed and leave a comment with my findings.

I made an attempt here: 6619b49
In these cases, I always divided into having fewer custom styles and avoiding repeating inline styles so they don't drift.
I extracted a CatalogCardBadge component so the shared styles stay there. We still have the styles from the removed catalog-card-org duplicated inline in PathwayCard and CourseCard. Do you think I should extract those as a component as well?

@brian-smith-tcril brian-smith-tcril left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I made an attempt here: 6619b49

Thank you! Overall the PR looks like it's really coming together!

I left a few comments with (mostly design) questions.

As for

We still have the styles from the removed catalog-card-org duplicated inline in PathwayCard and CourseCard. Do you think I should extract those as a component as well?

I don't see too much benefit to extracting those styles as a component. If we really want to dive into consistency and reduce code duplication I could see making a new CatalogCard component that gets used by both CourseCard and PathwayCard, but that's totally up to you. I'm perfectly happy with having the 2 card components separate for this PR.

Comment on lines 60 to 69
<Card.Header
title={courseName}
subtitle={(
title={(
<>
<div>{courseNumber}</div>
<Badge variant="light">{courseOrg}</Badge>
<div className="x-small font-weight-normal text-gray-700">{courseOrg}</div>
{courseName}
</>
)}
subtitle={courseNumber}
size="sm"
/>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'd just like to confirm a couple things here.

I assume the reordering and moving courseOrg out of a Badge

image

to

image

was intentional based on the Figma. Is that decision documented somewhere?

One thing that stands out about that reordering is that it changes what screen readers see. With the code on master it's Name -> Number -> Org, with this change it's Org -> Name -> Number. My worry is that learners using assistive tech will now need to go through CardType -> OrgName -> CourseName for every card before knowing if it's the one they're looking for and moving to the next one where before they would immediately get CourseName when moving to a card. It's also possible this isn't an issue because the image cap comes first and has ${courseName} ${courseNumber} as the alt text.

I'm not going to block the PR on that, but it's probably worth making an issue to investigate any potential usability hit for screen reader users.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

was intentional based on the Figma. Is that decision documented somewhere?
It isn't documented. How do we go about that? It was just approved through design reviews with Chelsea and Jenna. We needed the hierarchy change in order to align with the Pathway card design.

Thank you for bringing this up though. We had a discussion this week that we'd like to do a proper testing phase with a small group of institutions, and rather label this release "beta". This gives us the legroom to investigate usability and possible accessibility issues like this. I know ASU could help us test from an accessibility standpoint, based on the awesome talk at the conference this year. cc. @crathbun428

/>
{!isLoading && (
<CatalogCardBadge
className="bg-light-500 text-dark-900"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It seems the Figma is assuming a different placeholder image cap color. The implemented version makes the badge blend into the image cap placeholder.

Figma This PR
image image

I assume this is not the intention.

Also, changing the badge colors would make them not match what is being used in other MFEs, which doesn't feel good.

It seems to me like that leaves changing the placeholder as the only real option here, but I'd like to hear from design on that one.

@cassiezamparini cassiezamparini Dec 3, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@brian-smith-tcril There was a long conversation about this on our calls and here.

Here's the snippet from the comment that pertains to what you're saying "changing the badge colors would make them not match what is being used in other MFEs, which doesn't feel good.":

Our original thinking for the LMS Pathway/Course tags was:

  • We placed the badge at the top of the card for hierarchical reasons, i.e. the learning type is identified before anything else on the card.
  • Paragon's Badge component uses saturated background/white text variants that visually match button styling, with the same fill treatment and corner radius. Because the Pathway/Course badge sits close to primary CTAs in some layouts, such as My Learning and Pathway Learn More, it competed for attention. The Badge "Light" variant solves the saturation problem, but it only provides a grey option. So we created a new style to reduce visual competition while still distinguishing Pathways from Courses.
  • The label is always the primary differentiator. "Pathway" and "Course" remain readable regardless of colour perception. The colour difference is a secondary cue, and we've checked that the two colours provide sufficient visual distinction without relying on colour alone.

I hope this answers your question?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is specifically referring to the fact that the Course badge's background color is light-500 (#E1DDDB by default), and the placeholder image also uses #E1DDDB, so when a course doesn't have an image set the badge just looks like text instead of a badge.

openedx/frontend-app-learner-dashboard#879 is also using light-500/#E1DDDB for the Course badge.

I assume (and agree) consistency between catalog and learner dash for the Course badge is intentional and important.

I also assume that having the badge appear as "just text" when using the placeholder image (what appears for every course that doesn't have an image configured) is not the desired outcome.

That leaves changing the background color used in the placeholder image as the only option that makes sense to me.

tl:dr - my question is just "should we change the placeholder image's background color so it doesn't match the Course badge color?"

Comment thread src/generic/course-card/index.tsx Resolved
}: CatalogCardBadgeProps) => (
<Badge
className={classNames(
'catalog-card-badge position-absolute py-1 px-2 font-weight-normal',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we can drop the custom class/scss file by using

Suggested change
'catalog-card-badge position-absolute py-1 px-2 font-weight-normal',
'position-absolute m-3 py-1 px-2 font-weight-normal',

here.

I also am curious about how important the custom padding/font weight is from a design perspective. For comparison

This PR Custom padding/weight removed
image image

If dropping the custom weight/padding is acceptable that would make it so we just need position-absolute m-3 in here. That'd make it so the Badge itself is out-of-the-box Paragon and the utility classes are used for positioning only.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@brian-smith-tcril When designing we pull directly from the Open edX Paragon Figma Design system, this is what the badge looks like there.

It follows these rules on padding and font weight (unless I'm missing something?):
Screenshot 2026-12-03 at 09 42 46

If this doesn't align with what you're seeing from an engineering standpoint, I am happy for you to remove any custom padding and font weight. I think we should just better align our Figma Paragon file if what we're seeing there is incorrect.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Interesting, that does appear to be a gap between Figma and code. https://paragon-openedx-v23.netlify.app/components/badge/ shows

image

@rpenido rpenido Dec 3, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Since it seems we are building around the default, I removed the custom styles here: e739287

Note: I noticed that the Card in the catalog/courses/ path had some fonts slightly smaller than those on the home page. The cause was the CardView used in catalog/courses/.
I added a small custom style to "reset" the font size. Let me know what you think @brian-smith-tcril!

Co-authored-by: Brian Smith <112954497+brian-smith-tcril@users.noreply.github.com>
@rpenido

rpenido commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks for the review @brian-smith-tcril!

I left a few comments with (mostly design) questions.

@cassiezamparini Can I have your input here?

@cassiezamparini

Copy link
Copy Markdown

@rpenido I think I've answered all comments. Let me know if I've missed anything.

@rpenido
rpenido force-pushed the rpenido/fal-4373/pathway-cards branch 2 times, most recently from d96ea28 to d32d5d4 Compare December 3, 2026 21:15
@rpenido
rpenido force-pushed the rpenido/fal-4373/pathway-cards branch from b8fc287 to 9536bc0 Compare December 4, 2026 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FC Relates to an Axim Funded Contribution project 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.

5 participants