Skip to content

feat: support mixed course and pathway search responses [FC-0137] - #175

Merged
brian-smith-tcril merged 17 commits into
openedx:masterfrom
open-craft:rpenido/fal-4374/mixed-catalog-search
Dec 1, 2026
Merged

brian-smith-tcril merged 17 commits into
openedx:masterfrom
open-craft:rpenido/fal-4374/mixed-catalog-search

Conversation

@rpenido

@rpenido rpenido commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

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

Description

This PR teaches the catalog search data layer to return mixed course and pathway results. It does not render pathways yet; the cards land in the next PR. The request still goes to the legacy course_list_search endpoint, which returns courses only, so there is no visible change.

Changes:

  • 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 fix: preserve facet term keys in catalog search responses [FC-0137] #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. feat: add pathway cards and badges [FC-0137] #176 adds the pathway card case.

Supporting information

Part of the catalog split from #169. Branch rpenido/fal-4374/mixed-catalog-search, based on master on top of the merged #174. The API contract this prepares for is in docs/decisions/0003-use-a-generic-catalog-search-endpoint.rst, added by the previous PR.

Testing instructions

  1. Use the Node version in .nvmrc and install dependencies with npm ci.
  2. Start the app with npm run dev against a running Open edX instance.
  3. Open http://apps.local.openedx.io:1998/catalog and http://apps.local.openedx.io:1998/catalog/courses and verify nothing changed: the endpoint returns courses only, so no pathway is rendered.
  4. Override catalogDataTable or catalogDataTableCardView from a site config and verify the custom component receives the mixed CatalogSearchResponse. Repeat with the deprecated courseCatalogDataTable and courseCatalogDataTableCardView ids and verify they receive course rows only.

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


Private ref: FAL-4374

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

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.57%. Comparing base (56bc146) to head (a412eb4).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #175      +/-   ##
==========================================
+ Coverage   99.56%   99.57%   +0.01%     
==========================================
  Files         101      101              
  Lines         682      708      +26     
  Branches      169      166       -3     
==========================================
+ Hits          679      705      +26     
  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 refactor: support mixed course and pathway search responses refactor: support mixed course and pathway search responses [FC-0137] Oct 28, 2026
@rpenido rpenido moved this to Need Review in Learning Pathways Oct 28, 2026
@kdmccormick

Copy link
Copy Markdown
Member

This looks solid to me 👍🏻

I'll Brian take a pass once the PR below this (#174) is ready

@mphilbrick211 mphilbrick211 moved this from Needs Triage to In Eng Review in Contributions Oct 28, 2026
@mphilbrick211 mphilbrick211 added the FC Relates to an Axim Funded Contribution project label Oct 28, 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.

Pending #174 , this look good to me.

@brian-smith-tcril , could you also give this one a technical review? Just the last commit (refactor: support mixed course and pathway search responses); the others commits are in #174

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

Thanks for splitting these PRs up! I looked through a bit of the diff against #174 and things are mostly looking good! I did notice a couple things, so I had Claude write up a few inline comments.

The inline comments were drafted with Claude Code and reviewed before posting.

Comment on lines +21 to +24
type CourseResult = Extract<CatalogSearchResult, { type: 'course' | '_doc' }>;

/** The home list renders course cards only until pathway cards land. */
const isCourseResult = (result: CatalogSearchResult): result is CourseResult => result.type !== 'pathway';

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 could use switch/case to clarify the intention here, with pathway rendering nothing for now and course plus default rendering the course card:

{catalogData?.results?.map((result) => {
  switch (result.type) {
    case 'pathway':
      return null;
    case 'course':
    default:
      return <HomeCourseCardSlot key={result.id} original={result} />;
  }
})}

This makes the "anything we don't recognize is a course" behavior explicit. It also means the isCourseResult guard and the CourseResult type can go away since the switch narrows the type for us (and sets up a pathway case for #176 and #177 to use).

@rpenido rpenido Nov 10, 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.

Good call, updated to a switch/case in e405209. The isCourseResult guard and CourseResult type are gone; pathway returns null for now, and course/default render the course card.

Comment thread src/data/catalog-search/types.ts Outdated
Comment on lines +24 to +38
export type CatalogSearchResult =
| {
id: string;
index?: string;
type: 'course' | '_doc';
title?: string;
data: CourseData;
}
| {
id: string;
index?: string;
type: 'pathway';
title?: string;
data: PathwayData;
};

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.

Could this be Course | Pathway instead of two new object types? They already have the same fields (id, index?, type, data), and the card slots already take them as original?: Course (and original?: Pathway once #176 lands). The only thing missing is for type to be specific enough to tell them apart:

// src/generic/course-card/types.ts
export interface Course {
  // ...
  type: 'course' | '_doc';
}

// src/generic/pathway-card/types.ts
export interface Pathway {
  // ...
  type: 'pathway';
}

// src/data/catalog-search/types.ts
export type CatalogSearchResult = Course | Pathway;

On the course side the only fallout I found is mockCourseResponse in src/__mocks__/course.ts, which doesn't set type today and would need type: '_doc'. This also drops title, which nothing reads and which the ADR's new response shape leaves out anyway.

@rpenido rpenido Nov 10, 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.

Agreed, done in 96d61f8. CatalogSearchResult is now Course | Pathway, Course.type is 'course' | '_doc', Pathway.type is 'pathway', and title is gone. mockCourseResponse now sets type: '_doc'.

Comment thread src/home/HomePage.test.tsx Outdated
Comment on lines +36 to +42
/**
* The search response can mix courses and pathways; narrow to the course arm
* before reading course-only fields off `data`.
*/
type CourseResult = Extract<CatalogSearchResult, { type: 'course' | '_doc' }>;
const isCourseResult = (result: CatalogSearchResult): result is CourseResult => result.type !== 'pathway';
const courseResults = mockCatalogSearchResponse.results.filter(isCourseResult);

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.

Could the mock export its course rows with the course type already on them?

export const mockCourseResults: Course[] = [ /* the three rows */ ];

export const mockCatalogSearchResponse: CatalogSearchResponse = {
  // ...
  results: mockCourseResults,
};

Then this test can read mockCourseResults[index] and this block isn't needed. When #176 adds pathway rows, they can go in a mockPathwayResults next to it, and the tests that only care about courses don't have to change.

@rpenido rpenido Nov 10, 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.

Good idea, done in 30b97b0. The mock now exports mockCourseResults: Course[], the search response reuses it, and the HomePage and CatalogPage tests read it directly. The filter guard is gone from both.

Comment thread src/generic/pathway-card/types.ts Outdated
Comment on lines +27 to +31
/** Future category badge fields. */
category?: string;
categoryLabel?: string;
categoryBackgroundColor?: string;
categoryTextColor?: string;

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.

"Future" confused me here (same on PathwayCardProps above). I tracked it back to db76b2d in #169, when the response shape was still to be decided; now that the ADR specifies it, I'd drop the comment.

Also, the ADR's Category registry section says

Pathway data includes required category and category_label and optional category_background_color/category_text_color.

but all four are optional here. I'm not sure which one is right, but we should make sure they're aligned.

@rpenido rpenido Nov 10, 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.

Good catch. I made both colors required as well in 083aa69, since the backend always provides them, and updated the ADR in #174 (5e5d27e). PathwayData now requires category, categoryLabel, categoryBackgroundColor, and categoryTextColor. Since the backend owns the colors, I am planning to drop the frontend default badge palette for pathways in #176 and render the backend colors directly.

Comment thread src/generic/pathway-card/types.ts Outdated
@@ -0,0 +1,40 @@
export interface PathwayCardProps {

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.

Nothing in this PR reads PathwayCardProps (its first reader is PathwayCard in #176). I think it makes more sense to wait until there's something using it to add it.

@rpenido rpenido Nov 10, 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.

Agreed, done in e413e5b. PathwayCardProps is removed from this PR; it will be added in #176 with the card component.

Comment on lines +36 to +40
...camelCaseObject(facet),
// Preserve dynamic slug/label keys exactly.
terms: facet.terms,
...(facet.labels ? { labels: facet.labels } : {}),
},

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.

Keeping terms verbatim fixes a bug on master: camelCaseObject was rewriting the facet term keys that transformAggregationsToFilterChoices sends back as filter values, so any org or slug lodash alters (open-edx → openEdx) never matched. Since that stands on its own, would you mind breaking it out (with the test for it) into a separate PR ahead of this one? labels is new with the ADR's response and belongs here.

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.

Nice! Created #185 for it.

@rpenido
rpenido force-pushed the rpenido/fal-4374/mixed-catalog-search branch 3 times, most recently from 297c6f2 to 19520c3 Compare November 10, 2026 22:56
@rpenido
rpenido force-pushed the rpenido/fal-4374/mixed-catalog-search branch 2 times, most recently from 625e07f to 47a89ee Compare November 10, 2026 23:31
@rpenido

rpenido commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

Hi @brian-smith-tcril! This is the next one in the stack. I already rebased it, and I think I addressed your previous review.
Please let me know if we need any adjustments here!

@brian-smith-tcril

brian-smith-tcril commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

This one is looking great! Had Claude write up a comment with something I noticed but I think we're really close here!

Note

This comment was written by Claude (Claude Code) and reviewed before posting.

The change to CatalogSearchResponse in src/data/catalog-search/types.ts changes the shape of displayData on two existing slots. CourseCatalogDataTableSlotProps and CourseCatalogDataTableCardViewSlotProps both declare displayData?: CatalogSearchResponse, so even though neither slot file is in this diff, a widget on courseCatalogDataTable.v1 or courseCatalogDataTableCardView.v1 goes from getting course rows to getting course-or-pathway rows. For example, a widget that reads row.data.number from displayData.results gets a type error, because a row can now be a pathway and pathways have no number.

I think those two slots need new ids, so the new slots can carry the new type while the old ones keep the shape they have today:

  • CatalogSearchResponse stays as it is here, and is what the new slots carry.

  • CourseListSearchResponse stops being an alias and keeps the declaration from before this PR as it was, still @deprecated. The old slots' displayData is typed with it. That includes index and title as they were (the new type makes index optional and drops title): a site could be running a search backend that sends them, and a widget typed against the old shape should keep compiling.

  • The new slots are catalog.catalogDataTable.v1 and catalog.catalogDataTableCardView.v1. Each one renders the old slot inside it, like CatalogIntroSlot does, and passes it displayData with the pathway rows filtered out:

    <Slot id="org.openedx.frontend.slot.catalog.catalogDataTableCardView.v1" displayData={displayData}>
      <Slot id="org.openedx.frontend.slot.catalog.courseCatalogDataTableCardView.v1" displayData={courseDisplayData}>
        <CardView ... />
      </Slot>
    </Slot>

@rpenido

rpenido commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author

This one is looking great! Had Claude write up a comment with something I noticed but I think we're really close here!

Thanks, @brian-smith-tcril!

You are right that the old ids cannot keep a course-only contract while also rendering pathways, so here is the end state we would like to agree on before moving the ids:

  1. catalogDataTableCardView.v1 is the only card view. It receives the mixed response and dispatches per row to the course or pathway card slot: one grid, response order.
  2. courseCatalogDataTableCardView.v1 keeps CourseListSearchResponse and the old course-only CardView, but only renders when the response has no pathway rows. Its override stops applying once pathways exist, which is a response the old contract never covered.
  3. Same rule for the table: catalogDataTable.v1 receives the mixed response and owns totalItems; courseCatalogDataTable.v1 renders only in the course-only case with totalCourses.
  4. So this PR stays data-layer only: we restore CourseListSearchResponse to the old declaration and pass courseCatalogDataTable.v1 and courseCatalogDataTableCardView.v1 course rows only. The new ids, the dispatch, and the conditional land in feat: add pathways and category filters to the catalog page [FC-0137] #177, where pathways first render. It is still a draft, so nothing is released with the old ids carrying the union.

To be explicit about the trade-off: this shape still has a breaking change ( 💥 ), and I think it is unavoidable. Once a response contains pathways, the old card view cannot keep both its course-only props and its place in the single grid; it either stops rendering, receives rows it was not written for, or silently hides the pathway rows. We picked "stops rendering", so the break is scoped to mixed responses, and the deprecated READMEs in #178 would say exactly that: the old ids keep working for course-only responses and stop applying once pathways are present.

The shape in #177 would be:

<Slot id="...catalogDataTableCardView.v1" displayData={displayData}>
  {hasPathways ? (
    <CardView CardComponent={ResultCard} />
  ) : (
    <Slot id="...courseCatalogDataTableCardView.v1" displayData={courseDisplayData}>
      <CardView CardComponent={CatalogDataTableCourseCardSlot} />
    </Slot>
  )}
</Slot>

The current #177 dispatch lives under the old id (card view, pathway card), so that is the part we would move.

Does this work for you?

@brian-smith-tcril

Copy link
Copy Markdown
Contributor

I don't think there's an unavoidable breaking change here. With my previous suggested shape

<Slot id="...catalogDataTableCardView.v1" displayData={displayData}>
  <Slot id="...courseCatalogDataTableCardView.v1" displayData={courseDisplayData}>
    <CardView CardComponent={ResultCard} />
  </Slot>
</Slot>

the idea would be to filter that data going into courseCatalogDataTableCardView.v1 to be only course data.

It seems filtering/conditionally doing things based on if something is a course or pathway will need to happen in a few places, and I think having 'course' | '_doc' as the type for courses is biting us a bit. If we update normalizeCatalogSearchResponse to also normalize type using something like

switch (result.type) {
  case 'pathway':
    return { ...result, type: 'pathway' };
  case 'course':
  default:
    return { ...result, type: 'course' };
}

then we could filter what we get here nicely (as in, not assuming !pathway == course) with something like

const courseDisplayData = displayData && {
  ...displayData,
  results: displayData.results.filter((result) => result.type === 'course'),
};

This would make it so ...courseCatalogDataTableCardView.v1 only ever renders courses (as it does pre-pathways) so that doesn't seem like a breaking change, and ...catalogDataTableCardView.v1 would show all the results.

This would leave the conditional rendering of the ...catalogDataTableCourseCard.v1 and pathway equivalent slots up to the ResultCard component, which feels like a reasonable home for that.

It's possible I'm missing something here, so please push back if I am!

Looking forward to hearing your thoughts!

@rpenido

rpenido commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

My bad @brian-smith-tcril! Your proposed shape works.
I updated it here: 295ed83 (normalization) and 7d32329 (ids)

@brian-smith-tcril

Copy link
Copy Markdown
Contributor

Thanks for updating this! I asked Claude to give it another pass and this is what it came up with:

Note

This comment was written by Claude (Claude Code) and reviewed before posting.

The new commits have the slot shape from the thread above:

  • catalogDataTable.v1 and catalogDataTableCardView.v1 carry CatalogSearchResponse, and each one always renders the old slot inside it, the same way CatalogIntroSlot does.
  • CourseListSearchResponse is back to the declaration master has, and the deprecated props types are still exported next to the new ones.
  • totalItems is on the new data table slot, with totalCourses kept on the old one.
  • type is normalized in normalizeCatalogSearchResponse, so the filter can be result.type === 'course', and both cases have a test.

A few things came up while reading the three commits:

toCourseResponse changes title and index on the old slots' rows

After the filter, toCourseResponse rebuilds each course row with title set to data.content.displayName and index defaulted to ''. That changes what a widget on courseCatalogDataTable.v1 or courseCatalogDataTableCardView.v1 gets at runtime compared to master:

  • A site whose search backend sends its own title gets it overwritten with the display name.
  • For a backend that sends no title, the value goes from undefined to a string.
  • A row with no index gets ''.

Could the old slots get the same row objects the response has, with only the pathway rows dropped? Something like this type-checks (npm run build passes with it), and the Course import in utils.ts is no longer needed:

return {
  ...data,
  results: data.results.filter(
    (result) => result.type === 'course',
  ) as CourseListSearchResponse['results'],
};

toCourseResponse runs on every render

It is called inline in the JSX of both slots (CatalogDataTableSlot and CatalogDataTableCardViewSlot), so each old slot gets a new displayData object on every render. On master the old slots got the object CatalogPage memoizes, which only changes when the response does. A widget with an effect or a memo that depends on displayData would rerun it on every render. It'd be great to wrap the call in useMemo.

The READMEs describe the new ids, but the examples are for the old ones

  • CatalogDataTableSlot/README.md and CatalogDataTableCardViewSlot/README.md have the new id and props at the top, but all three examples in each still use the old slotId, and the props example is typed with the deprecated CourseCatalogDataTableSlotProps / CourseCatalogDataTableCardViewSlotProps. So the new ids have no example and the old ids have no page of their own. CatalogIntroSlot has a README.md whose examples use the new id and keeps the old page as README.courseCatalogIntro.v1.md. Would it make sense to do the same for these two?
  • The card view example imports from CourseCatalogDataTableSlots/CourseCatalogDataTableCardViewSlot/CatalogDataTableCourseCardSlot, and that folder is now CatalogDataTableCardViewSlot.
  • The data table README's warning says the deprecated id "renders the course-only table". The DataTable inside it is given displayData?.results from the mixed response, so the default table under the old id shows every row; what is course-only is the displayData prop the old id receives.

PR title and description

Since this now adds two slot ids, would feat: be a better fit for the title? 7d32329 already uses it. The description also still describes the earlier shape ("Review the 8 commits here", "a course | '_doc' arm", "Widens ... the data table displayData types to the mixed response"). It'd be great to have it mention the new slot ids, totalItems, the restored CourseListSearchResponse, and that a legacy row's type now reads 'course' where it used to read '_doc'.

Tests for the slots

toCourseResponse and the type normalization are covered, but nothing renders CatalogDataTableSlot or CatalogDataTableCardViewSlot and checks what a widget on the old ids receives. It'd be nice to have a test that gives the slot a response with a course row and a pathway row and checks that a widget on the old id only gets the course row.

@rpenido rpenido changed the title refactor: support mixed course and pathway search responses [FC-0137] feat: support mixed course and pathway search responses [FC-0137] Nov 24, 2026
@rpenido

rpenido commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @brian-smith-tcril! All five points are addressed:

  • toCourseResponse now only filters and casts, so the deprecated ids get the same row objects the response has (a83212d).
  • Both slots wrap the call in useMemo (34e70f4).
  • The new ids have their own READMEs, with the old pages at README.courseCatalogDataTable.v1.md and README.courseCatalogDataTableCardView.v1.md. Examples use the new ids and props, and the card view import path is fixed (dbccc18, c3126bf).
  • The title is now feat: ... and the description covers the new ids, totalItems, the restored CourseListSearchResponse and the type normalization.
  • test: cover the deprecated slot contracts renders both slots with a course and a pathway row and asserts the deprecated ids receive only the course row (597883a).

One note: a site that replaces courseCatalogDataTable.v1 or courseCatalogDataTableCardView.v1 receives only course rows, so no pathway cards render there, as they are filtered out. Is that the desired behavior, right? I'm not super happy with it, but I think it is the best we can do without adding a breaking change to the components that use the old id.

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

This looks great! Thanks for working through it with me!

Approving with a couple README suggestions.

As for

One note: a site that replaces courseCatalogDataTable.v1 or courseCatalogDataTableCardView.v1 receives only course rows, so no pathway cards render there, as they are filtered out. Is that the desired behavior, right? I'm not super happy with it, but I think it is the best we can do without adding a breaking change to the components that use the old id.

It also doesn't feel perfect to me, but it feels like the best way to avoid surprising behavior. I would expect someone using the courseCatalog* slots to have built it with only courses in mind, and there's no way to know how any given plugin would react to suddenly getting pathways data.

I'd also think it should be pretty easy for plugin authors to update their plugins to use the new catalog* slots and make sure everything works as they want it to when pathways data is included.


### Slot ID: `org.openedx.frontend.slot.catalog.catalogDataTable.v1`

> **Deprecated id:** `org.openedx.frontend.slot.catalog.catalogDataTable.v1` is still rendered for compatibility. It still receives a course-only `CourseListSearchResponse` with `totalCourses`. New code should use the id above.

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.

Suggested change
> **Deprecated id:** `org.openedx.frontend.slot.catalog.catalogDataTable.v1` is still rendered for compatibility. It still receives a course-only `CourseListSearchResponse` with `totalCourses`. New code should use the id above.
> **Deprecated id:** `org.openedx.frontend.slot.catalog.courseCatalogDataTable.v1` is still rendered for compatibility. It still receives a course-only `CourseListSearchResponse` with `totalCourses`. New code should use the id above.


### Slot ID: `org.openedx.frontend.slot.catalog.catalogDataTableCardView.v1`

> **Deprecated id:** `org.openedx.frontend.slot.catalog.catalogDataTableCardView.v1` is still rendered for compatibility. It still receives a course-only `CourseListSearchResponse`. New code should use the id above.

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.

Suggested change
> **Deprecated id:** `org.openedx.frontend.slot.catalog.catalogDataTableCardView.v1` is still rendered for compatibility. It still receives a course-only `CourseListSearchResponse`. New code should use the id above.
> **Deprecated id:** `org.openedx.frontend.slot.catalog.courseCatalogDataTableCardView.v1` is still rendered for compatibility. It still receives a course-only `CourseListSearchResponse`. New code should use the id above.


> **Deprecated id:** `org.openedx.frontend.slot.catalog.catalogDataTableCardView.v1` is still rendered for compatibility. It still receives a course-only `CourseListSearchResponse`. New code should use the id above.

> **Previous documentation:** [README.catalogDataTableCardView.v1.md](./README.catalogDataTableCardView.v1.md).

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.

Suggested change
> **Previous documentation:** [README.catalogDataTableCardView.v1.md](./README.catalogDataTableCardView.v1.md).
> **Previous documentation:** [README.courseCatalogDataTableCardView.v1.md](./README.courseCatalogDataTableCardView.v1.md).


> **Deprecated id:** `org.openedx.frontend.slot.catalog.catalogDataTable.v1` is still rendered for compatibility. It still receives a course-only `CourseListSearchResponse` with `totalCourses`. New code should use the id above.

> **Previous documentation:** [README.catalogDataTable.v1.md](./README.catalogDataTable.v1.md).

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.

Suggested change
> **Previous documentation:** [README.catalogDataTable.v1.md](./README.catalogDataTable.v1.md).
> **Previous documentation:** [README.courseCatalogDataTable.v1.md](./README.courseCatalogDataTable.v1.md).


### Slot Props

* `displayData?: CatalogSearchResponse` — the catalog search response (results, total count, aggregations, and other metadata).

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.

Suggested change
* `displayData?: CourseListSearchResponse` — the catalog search response (results, total count, aggregations, and other metadata) including only courses.


### Slot Props

* `displayData?: CatalogSearchResponse` — the catalog search response containing results, total count, aggregations, and other metadata.

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.

Suggested change
* `displayData?: CourseListSearchResponse` — the catalog search response for courses only containing results, total count, aggregations, and other metadata.

+ if (!displayData?.results) { return null; }
+ return (
+ <div style={{ display: 'grid', gridTemplateColumns: 'repeat(2, 1fr)', gap: '2rem' }}>
+ {displayData.results.map((course) => (

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 one is optional, if you'd rather leave it and wait until we have a slot that can handle pathways here that works for me.

Suggested change
+ {displayData.results.map((course) => (
+ {displayData.results.filter((result) => result.type === 'course').map((course) => (

@brian-smith-tcril
brian-smith-tcril merged commit adb7edf into openedx:master Dec 1, 2026
6 checks passed
@github-project-automation github-project-automation Bot moved this from In Eng Review to Done in Contributions Dec 1, 2026
@github-project-automation github-project-automation Bot moved this from Upstream review to Done in Learning Pathways Dec 1, 2026
@openedx-semantic-release-bot

Copy link
Copy Markdown

🎉 This PR is included in version 1.0.0-alpha.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

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 released on @latest

Projects

Status: Done
Status: Done

Development

Successfully merging this pull request may close these issues.

6 participants