Zero Results Display for Search - #3500
Open
saengel wants to merge 9 commits into
Open
Conversation
saengel
marked this pull request as ready for review
July 29, 2026 15:31
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a dedicated “zero results” (null state) UI for search, rendering a tab-specific empty state when a search returns no hits, and disables sort/filter controls where they don’t apply.
Changes:
- Introduces a new
NoSearchResultsReact component for tab-specific zero-results rendering. - Updates
SearchPage(and related sort/filter controls) to render the null state per tab and disable controls when there are no results. - Adds English i18n strings and CSS styling for the new null state and disabled controls.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| static/js/sheets/SheetsWithRefPage.jsx | Switches the “Sheets With Ref” page layout to reuse SearchPage (but currently breaks sheet rendering due to missing required props). |
| static/js/sefaria/i18n/interface/en.json | Adds English copy for the per-tab null state. |
| static/js/SearchSortDropdown.jsx | Adds a disabled rendering path for entity sort dropdowns. |
| static/js/SearchResultList.jsx | Adds disabled states for sort/filter UI elements. |
| static/js/SearchPage.jsx | Renders NoSearchResults on 0 hits (sources + entities) and disables sort/filter controls when empty. |
| static/js/NoSearchResults.jsx | New component implementing the per-tab null state UI and CTA/caption rendering. |
| static/css/s2.css | Styles for the null state component and disabled sort/filter controls. |
Comments suppressed due to low confidence (3)
static/js/sefaria/i18n/interface/en.json:376
- Grammar: "Something seem wrong?" should be "Something seems wrong?".
"search.null.books.caption": "Something seem wrong? Report a bug or contact us.",
static/js/sefaria/i18n/interface/en.json:380
- Grammar: "Something seem wrong?" should be "Something seems wrong?".
"search.null.sources.caption": "Something seem wrong? Report a bug or contact us.",
static/js/sefaria/i18n/interface/en.json:384
- Grammar: "Something seem wrong?" should be "Something seems wrong?".
"search.null.topics.caption": "Something seem wrong? Report a bug or contact us.",
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+37
to
+41
| // The caption key value is "Something seem wrong? Report a bug or contact us." | ||
| // We split around the two link phrases to keep them clickable. | ||
| const CAPTION_LINK_PATTERN = /(Report a bug|contact us)/; | ||
|
|
||
| function renderCaption(captionKey) { |
stevekaplan123
requested changes
Jul 29, 2026
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.
Description
Null state rendering on a per-tab basis when searches return 0 results.
Code Changes
A new
static/js/NoSearchResults.jsxcomponent with associated CSS, and rendering on a per-tab basis instatic/js/SearchPage.jsx. Once the backend has been wired up to populate the tabs, we will need to add a conditional for rendering the null state component only in cases of 0 results.Notes