Expose exact music filters in desktop and local agent clients

This commit is contained in:
karl committed 2026-10-13 18:37:51 +02:00
1 parent 2eace15a33
commit c33047998b
6 files changed
+263 -35

No files matched your search

+9 -1
View File
@@ -1,6 +1,6 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import { LatestLane, AutomaticIndexGate, emptySearchState, semanticAvailable, SEMANTIC_SETTLE_MS, scopedFilters } from '../src/search-state.ts';
import { LatestLane, AutomaticIndexGate, emptySearchState, semanticAvailable, SEMANTIC_SETTLE_MS, hasSearchInput, scopedFilters } from '../src/search-state.ts';
const settle = () => new Promise(resolve => setImmediate(resolve));
test('coalesces queued keystrokes and discards stale responses', async () => {
@@ -107,3 +107,11 @@ test('same-query scope change discards old lane output and runs latest scoped re
assert.equal(accepted[0].filters.code_only, true);
assert.equal(accepted[0].filters.extension, 'rs');
});
test('exact music fields allow metadata-only searches without general filter browsing', () => {
assert.equal(hasSearchInput('', scopedFilters('all', {media_artist: ' Artist '})), true);
assert.equal(hasSearchInput('', scopedFilters('all', {media_title: 'Song'})), true);
assert.equal(hasSearchInput(' ', scopedFilters('all', {media_artist: ' ', extension: 'mp3'})), false);
assert.equal(hasSearchInput('violin', scopedFilters('all', {})), true);
});