Repository navigation
Conversation
|
Thanks for the pull request, @rpenido! 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. DetailsWhere 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. |
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
2152796 to
3f29cec
Compare
25a9942 to
4b64b89
Compare
4b64b89 to
97a891d
Compare
8aff290 to
ad149af
Compare
ad149af to
fc45ca2
Compare
06cc3c8 to
2684595
Compare
925f208 to
182afd6
Compare
- 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.
182afd6 to
63d3947
Compare
63d3947 to
c35f8bf
Compare
|
Thanks for merging the PRs @brian-smith-tcril! |
brian-smith-tcril
left a comment
There was a problem hiding this comment.
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.
| 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} |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Thanks @brian-smith-tcril! Fixed here: d26963e
| :root { | ||
| --catalog-course-badge-background-color: var(--pgn-color-light-500); | ||
| --catalog-course-badge-color: black; | ||
| } |
There was a problem hiding this comment.
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-500tokens
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.
There was a problem hiding this comment.
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
e6a8c36 to
6619b49
Compare
6619b49 to
71a7a32
Compare
|
Thanks for the review @brian-smith-tcril!
I made an attempt here: 6619b49 |
brian-smith-tcril
left a comment
There was a problem hiding this comment.
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.
| <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" | ||
| /> |
There was a problem hiding this comment.
I'd just like to confirm a couple things here.
I assume the reordering and moving courseOrg out of a Badge
to
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.
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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 |
|---|---|
![]() |
![]() |
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.
There was a problem hiding this comment.
@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?
There was a problem hiding this comment.
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?"
| }: CatalogCardBadgeProps) => ( | ||
| <Badge | ||
| className={classNames( | ||
| 'catalog-card-badge position-absolute py-1 px-2 font-weight-normal', |
There was a problem hiding this comment.
I think we can drop the custom class/scss file by using
| '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 |
|---|---|
![]() |
![]() |
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.
There was a problem hiding this comment.
@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?):

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.
There was a problem hiding this comment.
Interesting, that does appear to be a gap between Figma and code. https://paragon-openedx-v23.netlify.app/components/badge/ shows
There was a problem hiding this comment.
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>
|
Thanks for the review @brian-smith-tcril!
@cassiezamparini Can I have your input here? |
|
@rpenido I think I've answered all comments. Let me know if I've missed anything. |
d96ea28 to
d32d5d4
Compare
d32d5d4 to
e739287
Compare
b8fc287 to
9536bc0
Compare




Description
Adds the generic pathway card, the shared card image helper, card badges, and the home page wiring.
PathwayCard(title, org, item count, start date, category badge using the backend-provided colors) and thehomePathwayCard.v1slot.Coursebadge 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".src/generic/course-imagewithresolveImageUrl,IMAGE_PLACEHOLDERandonImageLoadError, replacinggetFullImageUrl.pathwayDetailRoleand resolves pathway links withresolveRouteByRole, 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.Supporting information
Part of the catalog split from #169. Branch
rpenido/fal-4373/pathway-cards, based onmasteron top of the merged #185. The role-based links and thecourse-imagehelper are taken from #173 so that PR can rebase on top of this stack with minimal conflicts.Testing instructions
.nvmrcand install dependencies withnpm ci.npm run devand open http://apps.local.openedx.io:1998/catalog.Coursebadge and that pathway cards render title, org, item count, start date and category badge (Bootcamp,Tutorial).git checkout -- src/data/catalog-search/api.ts.pathway-demo-mock.patch
AI disclosure: Use Claude to help with the split and drafting this pull request description.
Private ref: FAL-4373