fix(bookkeeping): journal search finds a voucher by its label, with a spinner while searching (#1808)

"Sök verifikationstext" only matched journal_entries.description, so typing
A209 never returned voucher A209 itself: only other vouchers whose text
mentioned it. Users read that as "the voucher is missing".

A label-shaped needle (A209, a 209, A-209) now also matches
voucher_series + voucher_number via a PostgREST OR (needle double-quoted so
commas/parentheses stay literal); other needles keep the plain description
ILIKE. parseVoucher accepts one space or hyphen between series and number.
The search box shows a spinner while a server-side search is in flight;
before, the only signal was the list dimming.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Mattsson
2026-08-23 02:33:24 +02:00
committed by GitHub
co-authored by Claude Fable 5
parent 9622382579
commit d4c42fd8db
5 changed files with 87 additions and 6 deletions
+9 -1
View File
@@ -1050,8 +1050,16 @@ export default function JournalEntryList({
value={searchInput}
onChange={(e) => setSearchInput(e.target.value)}
containerClassName="min-w-0 max-w-none"
className="pr-7"
className={cn('pr-7', loading && search && 'pr-12')}
/>
{loading && search && (
// Search is server-side and can take a moment on a large ledger;
// without this the only signal was the list dimming.
<Loader2
className="absolute right-7 top-1/2 h-3.5 w-3.5 -translate-y-1/2 animate-spin text-muted-foreground"
aria-hidden="true"
/>
)}
{searchInput && (
<button
type="button"