From a1a2cc73e2aadee9d2b515d2c7935e6fabbd5186 Mon Sep 17 00:00:00 2001 From: Dave Date: Fri, 16 Oct 2026 18:45:44 +0200 Subject: [PATCH] feat(search): invoice + delivery-note search, richer colour-coded preview - Orders now match on customer invoice numbers and delivery-note numbers carried on their lines (tagged "invoice" / "delivery note"). - New Delivery Notes source: DN number, customer PO, customer and company names; preview pulls lines and invoices for visible hits only. - Quick-overview dialog moved to search-preview.tsx and redesigned: type-tinted header, status pills, stat tiles, invoice chips with QuickBooks links, line list, icon timeline with dates and gaps. Fixes the dialog being pinned at 24rem by the primitive's sm:max-w-sm. - Result list: per-type colour (icon tile, accent border, badge, row hover), status pills per row, and a jump bar; mobile-tightened. - Stock-order preview now fetches ordered_value/created (Value row and age chip were always empty); supplier names keep their original case. Co-Authored-By: Claude Opus 5.5 --- src/app/(app)/search/page.test.tsx | 51 +- src/app/(app)/search/page.tsx | 272 ++++----- src/app/(app)/search/search-preview.tsx | 575 +++++++++++++++++ src/lib/server/quotes-search-service.ts | 4 + .../server/universal-search-service.test.ts | 38 +- src/lib/server/universal-search-service.ts | 578 ++++++++++++++++-- 6 files changed, 1296 insertions(+), 222 deletions(-) create mode 100644 src/app/(app)/search/search-preview.tsx diff --git a/src/app/(app)/search/page.test.tsx b/src/app/(app)/search/page.test.tsx index 16c6128..b40ea04 100644 --- a/src/app/(app)/search/page.test.tsx +++ b/src/app/(app)/search/page.test.tsx @@ -358,7 +358,56 @@ describe("UniversalSearchPage — timeline rendering", () => { await waitFor(() => expect(screen.getByText(/^Timeline$/)).toBeInTheDocument()); expect(screen.getByText("Order raised")).toBeInTheDocument(); expect(screen.getByText("Driver assigned")).toBeInTheDocument(); - expect(screen.getByText("2026-10-12")).toBeInTheDocument(); + // Dates render as "12 Oct 2026", with the raw value on