fix(web): ship degraded search readiness state
This commit is contained in:
@@ -1407,11 +1407,13 @@ export class GlobalSearchComponent implements OnInit, OnDestroy {
|
||||
if (term.length < 1) {
|
||||
this.searchResponse.set(null);
|
||||
this.suggestionViability.set(null);
|
||||
this.suggestionViabilityStatus.set('idle');
|
||||
this.isLoading.set(false);
|
||||
this.selectedIndex.set(0);
|
||||
return of(null);
|
||||
}
|
||||
|
||||
this.refreshSuggestionViability();
|
||||
this.isLoading.set(true);
|
||||
const ambient = this.buildAmbientSnapshot();
|
||||
return this.searchClient.search(term, undefined, 10, ambient).pipe(
|
||||
|
||||
@@ -363,6 +363,18 @@ test.describe('Unified Search - Experience Quality UX', () => {
|
||||
});
|
||||
|
||||
test('shows search-readiness guidance instead of blaming the query when the live search corpus is unavailable', async ({ page }) => {
|
||||
const zeroMatchResponse = {
|
||||
...emptyResponse('database connectivity'),
|
||||
diagnostics: {
|
||||
ftsMatches: 0,
|
||||
vectorMatches: 0,
|
||||
entityCardCount: 0,
|
||||
durationMs: 38,
|
||||
usedVector: true,
|
||||
mode: 'hybrid',
|
||||
},
|
||||
};
|
||||
|
||||
await page.unroute('**/api/v1/search/suggestions/evaluate');
|
||||
await page.route('**/api/v1/search/suggestions/evaluate', async (route) =>
|
||||
route.fulfill({
|
||||
@@ -370,7 +382,7 @@ test.describe('Unified Search - Experience Quality UX', () => {
|
||||
body: '',
|
||||
}),
|
||||
);
|
||||
await mockSearchResponses(page, () => emptyResponse('database connectivity'));
|
||||
await mockSearchResponses(page, () => zeroMatchResponse);
|
||||
|
||||
await page.goto('/releases/versions');
|
||||
await expect(page.locator('aside.sidebar')).toBeVisible({ timeout: 15_000 });
|
||||
|
||||
Reference in New Issue
Block a user