feat: [FC-86] Course search for catalog page#42
feat: [FC-86] Course search for catalog page#42brian-smith-tcril merged 10 commits intoopenedx:masterfrom
Conversation
|
Thanks for the pull request, @PKulkoRaccoonGang! 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 #42 +/- ##
==========================================
+ Coverage 98.57% 98.74% +0.16%
==========================================
Files 89 94 +5
Lines 845 953 +108
Branches 136 154 +18
==========================================
+ Hits 833 941 +108
Misses 12 12 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
b737605 to
2769cce
Compare
8a179ae to
5850d4d
Compare
|
I'm trying to understand the functionality leading to the It seems to me the main thing is that if a user searches for something with no results, the search box is cleared but we still display the previous search in the heading Screencast.From.2025-11-06.12-36-29.mp4I think my main question here is: do we need to clear the search box? Could we simplify the logic if we just kept the search that led to zero results in the search box? I also noticed some redirect behavior I don't fully understand the reasoning behind Screencast.From.2025-11-06.12-41-03.mp4 |
831f3ab to
30d4b63
Compare
@brian-smith-tcril thanks! This logic was there to match the behavior in the legacy version. In my latest changes, I tried removing it. I also cleaned up some unnecessary search logic related to the Screen.Recording.2025-11-07.at.14.15.01.mov |
brian-smith-tcril
left a comment
There was a problem hiding this comment.
Overall this is looking good!
I left a few comments, including one with a minimal search-on-type implementation in a diff.
I did notice that with search on type the skeleton cards popping in and out feels quite jumpy/sudden. I'd like to do a bit more digging to see if we might be able to defer the displayData in some way too.
https://react.dev/reference/react/useDeferredValue#indicating-that-the-content-is-stale has a nice example that looks quite similar to the backend example from the paragon docs site https://paragon-openedx.netlify.app/components/datatable/#backend-filtering-and-sorting
|
I made an issue on the Paragon repo to dig into the skeleton card jumpiness (it's an issue for the table view as well, just more intense with the cards) |
src/catalog/CatalogPage.tsx
Outdated
There was a problem hiding this comment.
In my continued efforts to make this less jumpy, I decided to try to figure out a good value for this.
I landed on
skeletonCardCount={Math.min(displayData?.total ?? DEFAULT_PAGE_SIZE, DEFAULT_PAGE_SIZE)}which doesn't account for pagination (specifically the last page being shorter than DEFAULT_PAGE_SIZE), but looks quite nice when combined with openedx/paragon#3992
There was a problem hiding this comment.
Thanks! That definitely looks better
2dad3c0 to
d44f7ff
Compare
d44f7ff to
4d25f17
Compare
|
I did some local testing of the latest version of this branch and things are looking great! I added diff --git a/src/generic/course-card/index.tsx b/src/generic/course-card/index.tsx
index db3a2e7..ead8eab 100644
--- a/src/generic/course-card/index.tsx
+++ b/src/generic/course-card/index.tsx
@@ -31,6 +31,7 @@ export const CourseCard = ({ original: courseData, isLoading }: CourseCardProps)
src={getFullImageUrl(courseData?.data.imageUrl)}
fallbackSrc={noCourseImg}
srcAlt={`${courseData?.data.content.displayName} ${courseData?.data.number}`}
+ skeletonDuringImageLoad={true}
/>
<Card.Header
title={courseData?.data.content.displayName}
to see how everything looks with the image skeleton loader, and ran into a couple small UX oddities. I think they're on the Paragon side, so I made openedx/paragon#4002. I'd love to hear any thoughts on that issue. |
b417dc8 to
b714e69
Compare
brian-smith-tcril
left a comment
There was a problem hiding this comment.
LGTM!
One last little comment but we can clean that up in a follow-up.
Thank you so much for working with me to get the UX to a great place with this PR. I'm extremely happy with how it turned out!
| setSearchInput(value); | ||
| handleSearch(value); | ||
| }} | ||
| submitButtonLocation="external" |
There was a problem hiding this comment.
| submitButtonLocation="external" |
With search-on-type I think we can move back to not having the external button.
Note
Dependencies:
frontend-app-catalog[FC-0086] openedx-platform#37130Note
The plugin slots for the course catalog page will be added in the next PR.
Description
Added course search functionality on the course catalog page.
Useful information
Initial setup
tutor-mfeplugin from the draft PR that adds support for Catalog MFE.2, or create more than 20 coursesHow Has This Been Tested?
http://apps.local.openedx.io:1998/catalog/courses).ENABLE_COURSE_DISCOVERYsetting, which is configured via the Site Configuration.