extra facets from the url for channel page - #3695
Open
abeglova wants to merge 2 commits into
Open
Conversation
abeglova
marked this pull request as ready for review
July 29, 2026 15:47
OpenAPI ChangesNo changes detected Unexpected changes? Ensure your branch is up-to-date with |
abeglova
force-pushed
the
ab/extra-facet-channel-page
branch
from
July 29, 2026 15:51
eccba9a to
2c79748
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Extends the “show facets implied by URL filters” behavior (introduced for the main search page) to channel searches, so channel pages can surface and request aggregations for facets that appear in the URL even when they’re not part of that channel type’s default facet set. This fits into the shared SearchDisplay + request-building flow by ensuring both SSR prefetch and client-side channel search compute consistent facet manifests/aggregation lists.
Changes:
- Pass URL search params into channel facet computation so URL-implied facets are included in
facetNames/facetManifest. - Add channel-specific logic to compute “extra facet names” from the URL while excluding channel defaults and channel-config (saved) filters.
- Add ChannelPage tests verifying extra facets are aggregated/rendered and that default facets are not duplicated.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| frontends/main/src/app/(site)/c/[channelType]/[name]/page.tsx | Builds URLSearchParams from Next.js search params and passes them into channel facet calculation for SSR prefetch. |
| frontends/main/src/app-pages/ChannelPage/searchRequests.ts | Computes extra facet names from URL params (excluding defaults/saved filters) and threads them into the channel facet manifest + facet name list. |
| frontends/main/src/app-pages/ChannelPage/ChannelSearch.tsx | Passes current URL search params into getFacets so client-side rendering matches SSR behavior. |
| frontends/main/src/app-pages/ChannelPage/ChannelSearch.test.tsx | Adds coverage for URL-surfaced facets and ensures no duplication for facets already shown by default. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What are the relevant tickets?
closes https://github.com/mitodl/hq/issues/12383
Description (What does it do?)
#3655 updates the main search to add extra facets if there is a filter in the url. This does the same for channel searches. Filter parameters that are part of the saved filter for the channel are ignored
How can this be tested?
http://open.odl.local:8062/c/unit/ocw?level=undergraduate should show the level facet
http://open.odl.local:8062/c/unit/ocw?offered_by=ocw and http://open.odl.local:8062/c/unit/ocw?offered_by=mitxonline should look exactly like the normal ocw unit search