From 992e40835af1600a0961ec2454fb78ff43aec3c6 Mon Sep 17 00:00:00 2001 From: Martin Kagamino Lehoux Date: Mon, 7 Sep 2026 22:31:23 +0200 Subject: Add routine archives: archive date, searchable archived list, frozen page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Stamp archived_at on the archived snapshot; copy it on edit - loadArchived(projectId) + collapsible fuzzy-searched "Archivées" section on the project page - Archived routine pages open read-only with the health chart ending at the archive date; edit/complete actions reject archived routines --- src/lib/components/fuzzy-search.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/lib/components') diff --git a/src/lib/components/fuzzy-search.ts b/src/lib/components/fuzzy-search.ts index 31597b0..ade48fe 100644 --- a/src/lib/components/fuzzy-search.ts +++ b/src/lib/components/fuzzy-search.ts @@ -5,19 +5,19 @@ export type FuzzyItem = { id: number; name: string }; export const FUZZ_LIMIT = 8; export const FUZZ_THRESHOLD = 0.2; -export type FuzzyMatch = KeyResult; +export type FuzzyMatch = KeyResult; /** Fuzzy-match `items` against `query`, ranked best-first. Empty/whitespace * query returns no matches. Results carry `.score`, `.target`, `.highlight()` * and `.obj` (the matched item). */ -export function matchItems( - items: FuzzyItem[], +export function matchItems( + items: T[], query: string, { limit = FUZZ_LIMIT, threshold = FUZZ_THRESHOLD, }: { limit?: number; threshold?: number } = {}, -): FuzzyMatch[] { +): FuzzyMatch[] { const q = query.trim(); if (q === '') return []; const snap = fuzzysort.snapshot(items, { key: 'name' }); -- cgit v1.3