diff --git a/web/src/app/(dashboard)/admins/page.tsx b/web/src/app/(dashboard)/admins/page.tsx index 9a0d1a2..d7f3510 100644 --- a/web/src/app/(dashboard)/admins/page.tsx +++ b/web/src/app/(dashboard)/admins/page.tsx @@ -102,6 +102,8 @@ export default function AdminsPage() { variant="destructive" size="icon" className="size-8 text-muted-foreground hover:text-destructive" + title="Delete admin" + aria-label="Delete admin" onClick={() => handleDelete(admin.id)} > diff --git a/web/src/app/(dashboard)/lexicons/page.tsx b/web/src/app/(dashboard)/lexicons/page.tsx index 8f06ef7..f3bc6b7 100644 --- a/web/src/app/(dashboard)/lexicons/page.tsx +++ b/web/src/app/(dashboard)/lexicons/page.tsx @@ -31,7 +31,7 @@ import { DataTableToolbar } from "@/components/data-table/data-table-toolbar"; import { SiteHeader } from "@/components/site-header"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; -import { Eye, Trash2 } from "lucide-react"; +import { Eye, Rows3, Trash2 } from "lucide-react"; export default function LexiconsPage() { const { getToken } = useAuth(); @@ -188,13 +188,36 @@ export default function LexiconsPage() { header: "", cell: ({ row }) => (
+ {row.original.lexicon_type === "record" && ( + + )} + @@ -203,6 +226,8 @@ export default function LexiconsPage() { variant="destructive" size="icon" className="size-8 text-muted-foreground hover:text-destructive" + title="Delete lexicon" + aria-label="Delete lexicon" onClick={(e) => { e.stopPropagation(); handleDelete(row.original); diff --git a/web/src/app/(dashboard)/records/page.tsx b/web/src/app/(dashboard)/records/page.tsx index ae80d13..298714c 100644 --- a/web/src/app/(dashboard)/records/page.tsx +++ b/web/src/app/(dashboard)/records/page.tsx @@ -1,6 +1,6 @@ "use client"; -import { useCallback, useEffect, useMemo, useState } from "react"; +import { useCallback, useEffect, useMemo, useRef, useState } from "react"; import { type ColumnDef, type RowSelectionState, @@ -9,6 +9,7 @@ import { useReactTable, } from "@tanstack/react-table"; +import { useSearchParams } from "next/navigation"; import { useAuth } from "@/lib/auth-context"; import { getStats, @@ -79,6 +80,9 @@ function formatCellValue(value: unknown): string { export default function RecordsPage() { const { getToken } = useAuth(); + const searchParams = useSearchParams(); + const initialCollection = searchParams.get("collection") ?? ""; + const appliedInitial = useRef(false); const [collections, setCollections] = useState([]); const [selectedCollection, setSelectedCollection] = useState(""); const [records, setRecords] = useState([]); @@ -105,6 +109,17 @@ export default function RecordsPage() { .catch((e) => setError(e.message)); }, [getToken]); + // Auto-select collection from URL search param on initial load. + useEffect(() => { + if (appliedInitial.current || !initialCollection || collections.length === 0) + return; + if (collections.some((c) => c.collection === initialCollection)) { + appliedInitial.current = true; + handleSelectCollection(initialCollection); + } + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [collections, initialCollection]); + const fetchRecords = useCallback( async (collection: string, cursor?: string) => { setLoading(true); @@ -382,6 +397,7 @@ export default function RecordsPage() {