refactor(search): remove NLP/smart-search feature entirely #772
@@ -209,7 +209,7 @@ describe('SearchFilterBar – smart-mode chip lifecycle hooks', () => {
|
|||||||
smartMode: true,
|
smartMode: true,
|
||||||
onModeToggle
|
onModeToggle
|
||||||
});
|
});
|
||||||
await page.getByRole('button', { name: /KI/ }).click();
|
await page.getByRole('button', { name: /Smart/ }).click();
|
||||||
expect(onModeToggle).toHaveBeenCalledOnce();
|
expect(onModeToggle).toHaveBeenCalledOnce();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import { bulkSelectionStore } from '$lib/document/bulkSelection.svelte';
|
|||||||
import { getErrorMessage, parseBackendError } from '$lib/shared/errors';
|
import { getErrorMessage, parseBackendError } from '$lib/shared/errors';
|
||||||
import { csrfFetch } from '$lib/shared/cookies';
|
import { csrfFetch } from '$lib/shared/cookies';
|
||||||
import * as m from '$lib/paraglide/messages.js';
|
import * as m from '$lib/paraglide/messages.js';
|
||||||
import { languageTag } from '$lib/paraglide/runtime';
|
import { getLocale } from '$lib/paraglide/runtime';
|
||||||
import type { components } from '$lib/generated/api';
|
import type { components } from '$lib/generated/api';
|
||||||
|
|
||||||
type NlQueryInterpretation = components['schemas']['NlQueryInterpretation'];
|
type NlQueryInterpretation = components['schemas']['NlQueryInterpretation'];
|
||||||
@@ -225,7 +225,7 @@ async function runSmartSearch() {
|
|||||||
const res = await csrfFetch('/api/search/nl', {
|
const res = await csrfFetch('/api/search/nl', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: { 'Content-Type': 'application/json' },
|
headers: { 'Content-Type': 'application/json' },
|
||||||
body: JSON.stringify({ query, lang: languageTag() })
|
body: JSON.stringify({ query, lang: getLocale() })
|
||||||
});
|
});
|
||||||
if (!res.ok) {
|
if (!res.ok) {
|
||||||
const backend = await parseBackendError(res);
|
const backend = await parseBackendError(res);
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ describe('SmartModeToggle', () => {
|
|||||||
it('shows the smart label when smartMode is true', async () => {
|
it('shows the smart label when smartMode is true', async () => {
|
||||||
render(SmartModeToggle, { smartMode: true });
|
render(SmartModeToggle, { smartMode: true });
|
||||||
const btn = page.getByRole('button');
|
const btn = page.getByRole('button');
|
||||||
await expect.element(btn).toHaveTextContent('KI');
|
await expect.element(btn).toHaveTextContent('Smart');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('shows the keyword label when smartMode is false', async () => {
|
it('shows the keyword label when smartMode is false', async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user