feat: improve YearHistogramSlider empty/loading states and add to mobile filters#862
Draft
thostetler wants to merge 7 commits intoadsabs:masterfrom
Draft
Conversation
SCIX-871 test: add searchStatus facet gating integration tests SCIX-871 feat: gate facets on searchStatus to prevent stale data after empty/failed searches SCIX-871 fix: drive searchStatus from search page to gate facets SCIX-871 perf: use useLayoutEffect to start facets in same frame as search results
SCIX-871 fix: use varied two-column skeleton rows in facets during search loading SCIX-871 fix: use spinner instead of skeleton rows in facets during search loading
- Replace useLayoutEffect with useIsomorphicLayoutEffect (falls back to useEffect on the server) to eliminate the React SSR warning that fires when useLayoutEffect is used on a server-rendered page. - Move setQuery/submitQuery inside the numFound > 0 branch so empty-result searches do not open a Sentry performance span that can never close (providers.tsx only closes spans when docs.current is non-empty).
NumFound's SortStats sub-component and YearHistogramSlider both read latestQuery directly and fire API requests even when the main search has errored, showing stale data from the previous query. Gate both on searchStatus === 'success' so they stay quiet until the search completes successfully.
enabled:false stops new requests but React Query keeps the cached data in memory. Gate histogramData derivation on searchStatus so the stale histogram clears immediately when the search transitions away from success.
…ile filters - Show HistogramSliderLoader spinner during search loading instead of falling through to the no-data state - Show a centered "No data" placeholder when search completes with no histogram data, replacing the collapsed empty layout - Add showExpand prop to optionally hide the expand button - Add YearHistogramSlider to the mobile filters drawer - Exclude /v1 from Next.js middleware matcher so API proxy rewrites are not intercepted during local network development
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #862 +/- ##
========================================
- Coverage 62.7% 62.6% -0.0%
========================================
Files 323 323
Lines 38011 38049 +38
Branches 1723 1722 -1
========================================
+ Hits 23802 23808 +6
- Misses 14169 14201 +32
Partials 40 40
🚀 New features to boost your workflow:
|
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.
The year histogram had no meaningful state when data was unavailable, and was missing from the mobile filters drawer entirely.