Skip to content

extra facets from the url for channel page - #3695

Open
abeglova wants to merge 2 commits into
mainfrom
ab/extra-facet-channel-page
Open

extra facets from the url for channel page#3695
abeglova wants to merge 2 commits into
mainfrom
ab/extra-facet-channel-page

Conversation

@abeglova

Copy link
Copy Markdown
Contributor

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

@abeglova
abeglova marked this pull request as ready for review July 29, 2026 15:47
Copilot AI review requested due to automatic review settings July 29, 2026 15:47
@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown

OpenAPI Changes

No changes detected

View full changelog

Unexpected changes? Ensure your branch is up-to-date with main (consider rebasing).

@abeglova abeglova changed the title Ab/extra facet channel page extra facets from the url for channel page Jul 29, 2026
@abeglova
abeglova force-pushed the ab/extra-facet-channel-page branch from eccba9a to 2c79748 Compare July 29, 2026 15:51

Copilot AI 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.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants