diff --git a/frontend/e2e/nl-search.spec.ts b/frontend/e2e/nl-search.spec.ts index bd869582..65ede99f 100644 --- a/frontend/e2e/nl-search.spec.ts +++ b/frontend/e2e/nl-search.spec.ts @@ -13,8 +13,10 @@ const interpretation = { dateFrom: '1914-01-01', dateTo: '1918-12-31', keywords: ['krieg'], + resolvedTags: [{ id: '33333333-3333-3333-3333-333333333333', name: 'Weltkrieg', color: 'sage' }], rawQuery: 'Was hat Walter an Emma im Krieg geschrieben?', - keywordsApplied: true + keywordsApplied: true, + tagsApplied: true }; const nlResponse = { diff --git a/frontend/src/routes/documents/+page.svelte b/frontend/src/routes/documents/+page.svelte index b9a2ece5..5481e729 100644 --- a/frontend/src/routes/documents/+page.svelte +++ b/frontend/src/routes/documents/+page.svelte @@ -10,6 +10,7 @@ import BulkSelectionBar from '$lib/document/BulkSelectionBar.svelte'; import TimelineDensityFilter from '$lib/document/TimelineDensityFilter.svelte'; import SmartSearchStatus from '../search/SmartSearchStatus.svelte'; import InterpretationChipRow from '../search/InterpretationChipRow.svelte'; +import type { ChipType } from '../search/chip-types.js'; import DisambiguationPicker from '../search/DisambiguationPicker.svelte'; import { bulkSelectionStore } from '$lib/document/bulkSelection.svelte'; import { getErrorMessage, parseBackendError } from '$lib/shared/errors'; @@ -269,8 +270,6 @@ function paramsFromInterpretation(interp: NlQueryInterpretation) { }; } -type ChipType = 'sender' | 'directional' | 'date' | 'keyword'; - function removeChip(type: ChipType, value?: string) { if (!nlInterpretation) return; const p = paramsFromInterpretation(nlInterpretation); diff --git a/frontend/src/routes/search/InterpretationChipRow.svelte b/frontend/src/routes/search/InterpretationChipRow.svelte index 8e9cdbc0..62a26c81 100644 --- a/frontend/src/routes/search/InterpretationChipRow.svelte +++ b/frontend/src/routes/search/InterpretationChipRow.svelte @@ -3,8 +3,9 @@ import { SvelteSet } from 'svelte/reactivity'; import { m } from '$lib/paraglide/messages.js'; import type { components } from '$lib/generated/api'; +import type { ChipType } from './chip-types.js'; + type NlQueryInterpretation = components['schemas']['NlQueryInterpretation']; -type ChipType = 'sender' | 'directional' | 'date' | 'keyword'; let { interpretation, diff --git a/frontend/src/routes/search/InterpretationChipRow.svelte.spec.ts b/frontend/src/routes/search/InterpretationChipRow.svelte.spec.ts index f3164389..59b82e0b 100644 --- a/frontend/src/routes/search/InterpretationChipRow.svelte.spec.ts +++ b/frontend/src/routes/search/InterpretationChipRow.svelte.spec.ts @@ -17,8 +17,10 @@ const makeInterpretation = ( resolvedPersons: [], ambiguousPersons: [], keywords: [], + resolvedTags: [], rawQuery: 'test', keywordsApplied: true, + tagsApplied: false, ...overrides }); diff --git a/frontend/src/routes/search/chip-types.ts b/frontend/src/routes/search/chip-types.ts new file mode 100644 index 00000000..d78c58b8 --- /dev/null +++ b/frontend/src/routes/search/chip-types.ts @@ -0,0 +1 @@ +export type ChipType = 'sender' | 'directional' | 'date' | 'keyword' | 'theme';