Collapse search into zero-learning starters

This commit is contained in:
master
2026-03-07 19:48:46 +02:00
parent 1088ae1bc4
commit f23ca585d4
8 changed files with 175 additions and 324 deletions

View File

@@ -161,6 +161,37 @@ test.describe('Unified Search - Experience Quality UX', () => {
expect(String(turnBody['content'] ?? '')).toMatch(/critical findings/i);
});
test('keeps the empty state to page context, recent history, and executable starters only', async ({ page }) => {
await mockSearchResponses(page, (query) => {
if (query.includes('critical findings')) {
return criticalFindingResponse;
}
return emptyResponse(query);
});
await page.goto('/security/triage');
await expect(page.locator('aside.sidebar')).toBeVisible({ timeout: 15_000 });
const searchInput = page.locator('app-global-search input[type="text"]');
await searchInput.focus();
await waitForResults(page);
await expect(page.locator('.search__context-title')).toContainText(/findings triage/i);
await expect(page.locator('.search__domain-guide')).toHaveCount(0);
await expect(page.locator('.search__quick-link')).toHaveCount(0);
const starterChip = page.locator('[data-starter-kind]', {
hasText: /critical findings/i,
}).first();
await expect(starterChip).toBeVisible();
await starterChip.click();
await expect(searchInput).toHaveValue(/critical findings/i);
await waitForResults(page);
await waitForEntityCards(page, 1);
});
test('renders did-you-mean directly below the search bar and removes teaching controls', async ({ page }) => {
const capturedRequests: Array<Record<string, unknown>> = [];
await page.route('**/search/query**', async (route) => {
@@ -191,6 +222,8 @@ test.describe('Unified Search - Experience Quality UX', () => {
await expect(page.locator('.search__segment')).toHaveCount(0);
await expect(page.locator('.search__scope-chip')).toHaveCount(0);
await expect(page.locator('.search__rescue-card')).toHaveCount(0);
await expect(page.locator('.search__domain-guide')).toHaveCount(0);
await expect(page.locator('.search__quick-link')).toHaveCount(0);
const searchBarBox = await searchBar.boundingBox();
const didYouMeanBox = await didYouMean.boundingBox();
@@ -276,8 +309,8 @@ test.describe('Unified Search - Experience Quality UX', () => {
await expect(page.locator('[data-answer-status="grounded"]')).toContainText(
/current-page findings matched first/i,
);
await expect(page.locator('.search__scope-hint')).toContainText(/weighted toward findings/i);
await expect(page.locator('[data-overflow-results]')).toContainText(/also relevant outside findings/i);
await expect(page.locator('.search__scope-hint')).toHaveCount(0);
await expect(page.locator('[data-overflow-results]')).toContainText(/also relevant elsewhere/i);
await expect(page.locator('[data-overflow-results]')).toContainText(/policy results remain relevant/i);
await expect(page.locator('[data-role="domain-filter"]')).toHaveCount(0);
await expect(page.locator('app-synthesis-panel')).toHaveCount(0);