Skip to content

Feature/sc 45587/wire up search result page and tabs to backend#3495

Merged
stevekaplan123 merged 10 commits into
search-sk-sddfrom
feature/sc-45587/wire-up-search-result-page-and-tabs-to-backend
Jul 9, 2026
Merged

Feature/sc 45587/wire up search result page and tabs to backend#3495
stevekaplan123 merged 10 commits into
search-sk-sddfrom
feature/sc-45587/wire-up-search-result-page-and-tabs-to-backend

Conversation

@stevekaplan123

@stevekaplan123 stevekaplan123 commented Jul 8, 2026

Copy link
Copy Markdown
Member

Description

Adds UI filters and results count. Also displays result cards.

…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
@stevekaplan123 stevekaplan123 requested a review from saengel July 9, 2026 08:10
@stevekaplan123 stevekaplan123 marked this pull request as ready for review July 9, 2026 08:10
@gitvelocity-reviewer

Copy link
Copy Markdown

📊 Code Quality Score: 15/100

38 × 0.4 = 15.2 → 15

Category Score Factors
🔭 Scope 10/20 4 files across UI components, CSS, and search service; new tab count behavior and sidebar component; new API method
🏗️ Architecture 8/20 New BookSearchFilters component; refactored sidebar rendering logic; new entitySearchCount method in search service; clean separation of concerns
⚙️ Implementation 9/20 Async fetch with stale-query guard; FilterNode mutation pattern; conditional sidebar rendering; entity count formatting with boundary handling; caching in search service
⚠️ Risk 6/20 UI-only changes, no data migration; new API endpoint dependency; incomplete feature (filters don't apply to search) is low risk; potential setState on unmounted component
✅ Quality 3/15 No tests added for new functionality; CSS comment math inconsistency (45+20≠80); missing newline at EOF; incomplete feature not documented; ~0% test coverage on new code
🔒 Perf / Security 2/5 Caching implemented for entity count API calls; no security concerns identified; no benchmarks or load testing

Was this score accurate? 👍 Yes · 👎 No

Scored by GitVelocity · How are scores calculated?

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

Some small questions, and a bigger one - where are you wiring up the card component? I don't see it here.

Comment thread static/js/sefaria/search.js Outdated
Comment thread sefaria/helper/search.py

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

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 compDate and 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.

Comment thread static/js/SearchPage.jsx
Comment thread static/js/SearchPage.jsx Outdated
Comment thread sefaria/helper/search.py
Comment on lines 561 to +565
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)

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.

@stevekaplan123 what do you think?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)?

@stevekaplan123 stevekaplan123 requested a review from saengel July 9, 2026 11:15

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

Merge conflicts need to be addressed - but then good to go! Thank you!

@stevekaplan123 stevekaplan123 merged commit ffbd47f into search-sk-sdd Jul 9, 2026
9 of 10 checks passed
@stevekaplan123 stevekaplan123 deleted the feature/sc-45587/wire-up-search-result-page-and-tabs-to-backend branch July 9, 2026 13:07
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.

3 participants