From 898f84656634f15695999f5f036489aaa4c48895 Mon Sep 17 00:00:00 2001 From: Aman Thanvi Date: Thu, 3 Sep 2026 11:35:49 -0400 Subject: [PATCH] build(deps): resolve compatible update backlog Consolidate the compatible Dependabot updates on one tested lockfile, align React and Next package families, adopt the new Next lint rules without suppressions, format the affected tagging harnesses for Prettier 3.9, and pin the patched @humanfs/node release. --- apps/web/package.json | 16 +- apps/web/src/components/SearchPalette.tsx | 126 +++- .../production-backfill/local-review.test.ts | 17 +- .../synthetic-reference/target-panel.ts | 11 +- .../tagging/synthetic-reference/types.ts | 5 +- package.json | 3 +- packages/shared/package.json | 2 +- pnpm-lock.yaml | 641 ++++++++---------- tools/content/package.json | 4 +- tools/ingest/package.json | 4 +- 10 files changed, 417 insertions(+), 412 deletions(-) diff --git a/apps/web/package.json b/apps/web/package.json index a2b3fb06..851ff818 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -14,20 +14,20 @@ }, "dependencies": { "convex": "^1.39.1", - "geist": "^1.7.0", - "next": "16.2.12", - "react": "19.2.4", - "react-dom": "19.2.4", + "geist": "^1.7.2", + "next": "16.3.4", + "react": "19.2.8", + "react-dom": "19.2.8", "react-markdown": "^10.1.0", "remark-gfm": "^4.0.1" }, "devDependencies": { "@types/node": "^24.13.3", - "@types/react": "^19", - "@types/react-dom": "^19", + "@types/react": "^19.2.18", + "@types/react-dom": "^19.2.7", "eslint": "^9.39.5", - "eslint-config-next": "16.2.12", - "prettier": "^3.8.1", + "eslint-config-next": "16.3.4", + "prettier": "^3.9.6", "typescript": "^6.0.3", "vitest": "^4.1.11" } diff --git a/apps/web/src/components/SearchPalette.tsx b/apps/web/src/components/SearchPalette.tsx index abd10d12..3690c08a 100644 --- a/apps/web/src/components/SearchPalette.tsx +++ b/apps/web/src/components/SearchPalette.tsx @@ -54,7 +54,9 @@ function normalizeQuery(value: string): string { } function matchesNav(query: string, item: NavItem): boolean { - const haystack = [item.label, item.href, ...(item.keywords ?? [])].join(' ').toLowerCase(); + const haystack = [item.label, item.href, ...(item.keywords ?? [])] + .join(' ') + .toLowerCase(); return query.split(' ').every((token) => !token || haystack.includes(token)); } @@ -78,26 +80,27 @@ export function SearchPalette() { const q = normalizeQuery(query); useEffect(() => { - if (!open || q.length < 2) { - setEntries([]); - setSearching(false); - return; - } + if (!open || q.length < 2) return; const controller = new AbortController(); setSearching(true); const handle = window.setTimeout(async () => { try { - const response = await fetch(`/api/v1/search?q=${encodeURIComponent(q)}`, { - signal: controller.signal, - }); + const response = await fetch( + `/api/v1/search?q=${encodeURIComponent(q)}`, + { + signal: controller.signal, + }, + ); if (!response.ok) throw new Error(`search ${response.status}`); const body = (await response.json()) as { results?: EntryResult[] }; setEntries((body.results ?? []).slice(0, 8)); + setActiveIndex(0); setSearching(false); } catch (error) { if ((error as Error).name !== 'AbortError') { setEntries([]); + setActiveIndex(0); setSearching(false); } } @@ -111,7 +114,12 @@ export function SearchPalette() { const items = useMemo(() => { if (!q) { - return NAV_ITEMS.map((item) => ({ kind: 'nav', id: item.id, label: item.label, href: item.href })); + return NAV_ITEMS.map((item) => ({ + kind: 'nav', + id: item.id, + label: item.label, + href: item.href, + })); } const list: PaletteItem[] = [ @@ -121,11 +129,19 @@ export function SearchPalette() { label: `Search for “${q}”`, href: `/search?q=${encodeURIComponent(q)}`, }, - ...entries.map( - (entry): PaletteItem => ({ kind: 'entry', id: `entry-${entry.id}`, href: entryHref(entry), entry }), - ), + ...entries.map((entry): PaletteItem => ({ + kind: 'entry', + id: `entry-${entry.id}`, + href: entryHref(entry), + entry, + })), ...NAV_ITEMS.filter((item) => matchesNav(q, item)).map( - (item): PaletteItem => ({ kind: 'nav', id: item.id, label: item.label, href: item.href }), + (item): PaletteItem => ({ + kind: 'nav', + id: item.id, + label: item.label, + href: item.href, + }), ), ]; return list; @@ -134,6 +150,8 @@ export function SearchPalette() { function close() { setOpen(false); setQuery(''); + setEntries([]); + setSearching(false); setActiveIndex(0); triggerRef.current?.focus(); } @@ -141,21 +159,25 @@ export function SearchPalette() { function openPalette() { setQuery(''); setEntries([]); + setSearching(false); setActiveIndex(0); setOpen(true); } + function updateQuery(value: string) { + const nextQuery = normalizeQuery(value); + setQuery(value); + if (nextQuery === q) return; + setEntries([]); + setSearching(nextQuery.length >= 2); + setActiveIndex(0); + } + function navigate(href: string) { close(); router.push(href); } - // Reset the selection whenever the option list changes — including when - // debounced results arrive — so Enter never fires on a shifted item. - useEffect(() => { - setActiveIndex(0); - }, [items]); - useEffect(() => { function onKeyDown(e: KeyboardEvent) { const key = e.key.toLowerCase(); @@ -243,9 +265,25 @@ export function SearchPalette() { aria-expanded={open} aria-label="Search" > - Search…