Feature/sc 45587/wire up search result page and tabs to backend#3495
Conversation
…ities' into feature/sc-45587/wire-up-search-result-page-and-tabs-to-backend
…onent' into feature/sc-45587/wire-up-search-result-page-and-tabs-to-backend
…ities' into feature/sc-45587/wire-up-search-result-page-and-tabs-to-backend
…ult-page-and-tabs-to-backend
📊 Code Quality Score: 15/100
Was this score accurate? 👍 Yes · 👎 No Scored by GitVelocity · How are scores calculated? |
saengel
left a comment
There was a problem hiding this comment.
Some small questions, and a bigger one - where are you wiring up the card component? I don't see it here.
There was a problem hiding this comment.
Pull request overview
This PR wires up the multi-entity Search page UI to the /api/entity-search backend by adding per-tab result counts and a Books-tab sidebar category filter UI, and extends the backend author-works aggregation so it can be consistently sorted (alpha/year) while preserving the aggregated view.
Changes:
- Added a count-only entity search API call on the frontend and integrated per-tab count badges (Books/Authors/Topics).
- Introduced a Books-tab sidebar filter UI based on TOC categories, plus small CSS tweaks for sidebar/list alignment.
- Enhanced backend author-works aggregation to include a sortable
compDateand support explicit sorts while keeping aggregation.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| static/js/sefaria/search.js | Adds entitySearchCount() for count-only requests used by tab badges. |
| static/js/SearchPage.jsx | Fetches and renders entity counts per tab; adds Books-tab sidebar filter UI. |
| static/js/SearchFilters.jsx | Avoids rendering undefined filter counts; adds BookSearchFilters wrapper. |
| static/css/s2.css | Adjusts sidebar spacing and list padding for the search filters UI. |
| sefaria/model/topic.py | Adds composition-year collapse logic and exposes compDate on author aggregation rows. |
| sefaria/helper/search.py | Keeps author aggregation under explicit sorts by sorting rows in code using compDate. |
| docs/arch_docs/search_improvements_arch.md | Updates architecture doc to match the new “explicit sorts keep aggregation” behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if type == "book": | ||
| if sort == "relevance" and not category_paths: | ||
| if not category_paths: | ||
| author = _resolve_author(query, es_client) | ||
| if author is not None: | ||
| return _author_works_response(author) | ||
| return _author_works_response(author, sort=sort) |
There was a problem hiding this comment.
Where is it calling size=0? I don't see that in the code anymore. I thought I got rid of it. Where do you see it (other than in the comment)?
saengel
left a comment
There was a problem hiding this comment.
Merge conflicts need to be addressed - but then good to go! Thank you!
…ult-page-and-tabs-to-backend
Description
Adds UI filters and results count. Also displays result cards.