Skip to content

feat: add pathway cards, badges and filters [FC-0137] - #169

Closed
rpenido wants to merge 21 commits into
openedx:masterfrom
open-craft:rpenido/navin/fal-4374/public-explore-update
Closed

rpenido wants to merge 21 commits into
openedx:masterfrom
open-craft:rpenido/navin/fal-4374/public-explore-update

Conversation

@rpenido

@rpenido rpenido commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Description

This pull request compiles the pathway work from #148 and #149 into a single change that prepares the catalog (Explore) page for mixed course/pathway results and adds pathway cards, badges, and a Categories filter.

image image

Supporting information

Testing instructions

  1. Use the Node version in .nvmrc and install dependencies with npm ci.
  2. Set ENABLE_PATHWAY_PILOT_UI: true in site.config.dev.tsx (it defaults to false). While the flag is on, the catalog search client serves the bundled mock mixed catalog, so no backend search call is made.
  3. Start the dev server with npm run dev and open http://apps.local.openedx.io:1998/catalog. A running Open edX (Tutor dev) instance is still needed for login and other APIs, but the catalog search itself is served from the mock.
  4. On the Explore page and the home page, verify that pathway cards render with title, org, item count, start date, and category badge (Bootcamp, Tutorial), that course cards show the Course badge, and that the Categories filter lists the category terms. The filter renders when ENABLE_COURSE_DISCOVERY is true, which site.config.dev.tsx sets.
  5. Set ENABLE_PATHWAY_PILOT_UI back to false (or remove it), restart, and verify that course cards no longer show the Course badge and the mock mixed data is not used. Conflicts between the flag and the Categories filter are expected: the filter depends on the response aggregation, not on the flag.

Other information

  • Related to:
  • This change compiles the internal tasks FAL-4373 (Pathway Card and Badges, from feat: add pathway cards and badges #148) and FAL-4374 (Public Explore page updates, from feat(explore): prepare catalog for pathways and category filters #149).
  • ENABLE_PATHWAY_PILOT_UI defaults to false because the backend pathways API is still pending. Today the flag gates the course card badge and switches the catalog search to the bundled mock; pathway cards render whenever the response contains a result with type: 'pathway'.
  • The mock short-circuit in fetchCatalogListSearch is development/testing only and is excluded from coverage.
  • Backend assumptions this frontend relies on: the search endpoint can return courses and pathways in one result set; it exposes a category aggregation whose terms are usable as filter options, with an optional labels map; courses always carry the reserved course category and participate in that aggregation; other category slugs (for example bootcamps and tutorials) are arbitrary registered slugs, not hardcoded in the frontend; the existing generic filter request mechanism is reused; and pathway results include the fields the cards render (display name, org, item count, optional image, start date, and category).

AI disclosure: Use GPT 5.6 Sol to help with development as well as drafting detailed pull request description.


Private refs:

rpenido and others added 9 commits October 5, 2026 17:49
Adds PathwayCard with a type badge that honors operator-supplied
background and text colors, plus the HomePathwayCardSlot that offers it
to consumers.

The card and its style follow the frontend-base layout: imports come
from @openedx/frontend-base, the pilot gate reads ENABLE_PATHWAY_PILOT_UI
through getAppConfig, and the slot uses the Slot API under the
org.openedx.frontend.slot.catalog.homePathwayCard.v1 id.

isValidCssColor moves to src/utils, the only module both cards reach for.

Co-Authored-By: Navin Karkera <navin@opencraft.com>
Co-Authored-By: Navin Karkera <navin@opencraft.com>
Generalize course-specific catalog naming for mixed course and pathway
results. Render a Categories filter from the backend category aggregation,
supporting courses and custom pathway types such as bootcamps and
tutorials.

CourseCatalogIntroSlot becomes ExploreIntroSlot under the
org.openedx.frontend.slot.catalog.exploreIntro.v1 id, since the page is no
longer courses-only. Its result count prop is now resultsCount;
courseDataResultsLength is still passed so plugins written against the old
name keep working.

Extend the mock with dummy category terms for temporary UI testing.

Co-Authored-By: Navin Karkera <navin@opencraft.com>
The catalog will list pathways alongside courses, so its cached search
response is no longer course-specific. Rename useCourseData to
useCatalogData and courseData/previousCourseData to
catalogData/previousCatalogData.

Co-Authored-By: Navin Karkera <navin@opencraft.com>
Split the search response envelope from its result list so the mixed
catalog response can reuse it, and reuse CourseData instead of restating
the course payload.

Aggregation facets gain an optional labels map for the category facet the
catalog will read from.

Co-Authored-By: Navin Karkera <navin@opencraft.com>
Introduce a generic search response envelope and a discriminated mixed
result type so the catalog can render courses and pathways from one ranked,
paginated response. Rename useCourseListSearch to useCatalogListSearch and
update consumers (CatalogPage, CoursesList, data-table card slot) to branch
on result type and render pathway cards. Add ADR-0003 documenting the generic
catalog search endpoint decision.

Unlike the original branch, fetchData keeps carrying
enableCourseSortingByStartDate forward, per the upstream fix for the sort
setting resetting on refetch.

Co-Authored-By: Navin Karkera <navin@opencraft.com>
Read category display labels from the facet's labels map instead of
capitalizing the slug, and stop camelCasing the dynamic keys under
aggregation terms and labels: those are backend slugs that go back to the
API as filter values.

Rename the pathway badge fields from type* to category*, matching the
category metadata the search response will carry.

Co-Authored-By: Navin Karkera <navin@opencraft.com>
The card view renders one card per result, so results are dispatched by
type to either the course or pathway card slot. Cover the dispatch, and
the new pathway card slot, with tests, and document both slots' props.

Co-Authored-By: Navin Karkera <navin@opencraft.com>
@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Oct 12, 2026
@openedx-webhooks

openedx-webhooks commented Oct 12, 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.

@rpenido
rpenido marked this pull request as draft October 12, 2026 18:38
@codecov

codecov Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.59%. Comparing base (97aaec1) to head (305dfd9).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #169      +/-   ##
==========================================
+ Coverage   99.56%   99.59%   +0.03%     
==========================================
  Files         101      105       +4     
  Lines         682      744      +62     
  Branches      168      188      +20     
==========================================
+ Hits          679      741      +62     
  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 force-pushed the rpenido/navin/fal-4374/public-explore-update branch 2 times, most recently from 28c6a10 to b16d590 Compare October 12, 2026 21:55
@rpenido rpenido added the create-sandbox open-craft-grove should create a sandbox environment from this PR label Oct 12, 2026
@rpenido
rpenido force-pushed the rpenido/navin/fal-4374/public-explore-update branch 5 times, most recently from 1d98a2c to 69db0aa Compare October 13, 2026 12:38
@rpenido
rpenido force-pushed the rpenido/navin/fal-4374/public-explore-update branch from 69db0aa to f3a45e5 Compare October 13, 2026 13:22
@rpenido
rpenido force-pushed the rpenido/navin/fal-4374/public-explore-update branch 2 times, most recently from 7496fa4 to 2130dda Compare October 13, 2026 14:03
@rpenido rpenido removed the create-sandbox open-craft-grove should create a sandbox environment from this PR label Oct 13, 2026
@rpenido
rpenido force-pushed the rpenido/navin/fal-4374/public-explore-update branch from 2130dda to 3b8419e Compare October 13, 2026 14:09
Comment thread src/generic/pathway-card/index.tsx Outdated
to={pathwayId ? `/pathways/${pathwayId}` : undefined}
// 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={`pathway-card d-flex ${isExtraSmall ? 'w-100' : 'pathway-card-desktop'}`}

@ChrisChV ChrisChV Oct 16, 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.

@rpenido From #169 (comment):

They are aligned to me, and I didn't find anything different in the code.
Can you check if it is still happening and give me more info on the applied styles?

Something interesting is happening here. In my local environment, specifically while working on the learner-dashboard, I’ve also defined a pathway-card class. The issue is that, in frontend-base, the CSS for all applications is global; as a result, these styles overlap. In this case, the dashboard’s styling has been applied here in catalog, effectively overwriting the intended styles.

We can fix this by making those styles more specific: dashboard-pathway-card and catalog-pathway-card.

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.

The classes were not declared here, so I removed them: d9c9f80

@rpenido
rpenido force-pushed the rpenido/navin/fal-4374/public-explore-update branch from f32056c to bdf9260 Compare October 17, 2026 00:16

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

Looks good 👍

  • 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

@ChrisChV

Copy link
Copy Markdown

@kdmccormick and @ormsbee, this is ready for review!

@rpenido rpenido changed the title feat: add pathway cards, badges and filters feat: add pathway cards, badges and filters [FC-0137] Oct 20, 2026
@rpenido rpenido moved this from In Progress to Need Review in Learning Pathways Oct 20, 2026
@mphilbrick211 mphilbrick211 added the FC Relates to an Axim Funded Contribution project label Oct 22, 2026
@mphilbrick211 mphilbrick211 moved this from Needs Triage to Ready for Review in Contributions Oct 22, 2026

@kdmccormick kdmccormick left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@rpenido It's exciting to see so much progress at once, but this PR is very large and will be hard to review as it is. Could you break it into more manageable pieces? For example, #148 was a manageable size. If you rebased that, we be happy to review it now.

I'd also advocate for the removal of the ENABLE_PATHWAY_PILOT_UI flag unless it's absolutely necessary. I know the backend APIs aren't in place, but it would be fine for the app to attempt hit the Pathways APIs and gracefully degrade to "no pathways" if the APIs return 404.

@rpenido

rpenido commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks for the input, @kdmccormick!

It's exciting to see so much progress at once, but this PR is very large and will be hard to review as it is. Could you break it into more manageable pieces? For example, #148 was a manageable size. If you rebased that, we be happy to review it now.

Sure! One thing that is adding a lot for the diff here is that we did some renames course -> catalog so the data is better represented. I will try to extract these changes and apply them before, as they should have plenty of lines, but no feature change and should be easier to review. Then, I will add the features on top of it as follow-up.

I'd also advocate for the removal of the ENABLE_PATHWAY_PILOT_UI flag unless it's absolutely necessary.

The main point of the flag now is to render dummy data so we can test, validate the design, and do demos in the sync meeting using the sandbox. The alternative for that would be maintaining branches with the mock data so we can have a demo sandbox (and keeping it in sync would require an increasing effort as we progress).

If you think we can postpone the demos for when we have the backend ready (or have a better idea on how we can do it), we can remove them without issues. Meanwhile, I'll check if @cassiezamparini already did a review pass in the designs.

@cassiezamparini

Copy link
Copy Markdown

@rpenido I've looked at the designs, they're looking good. There are some cosmetic changes I'd like to make to better the overall feel, so it's closer to the proposed UI. But for now you have bigger fish to fry!

@rpenido rpenido closed this Oct 28, 2026
@github-project-automation github-project-automation Bot moved this from Ready for Review to Done in Contributions Oct 28, 2026
@github-project-automation github-project-automation Bot moved this from Need Review to Done in Learning Pathways Oct 28, 2026
@kdmccormick

Copy link
Copy Markdown
Member

thank you @rpenido !! this is super helpful.

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: Done
Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants