diff --git a/app/(dashboard)/vani/page.tsx b/app/(dashboard)/vani/page.tsx index aacf7d1..c7232dc 100644 --- a/app/(dashboard)/vani/page.tsx +++ b/app/(dashboard)/vani/page.tsx @@ -36,6 +36,7 @@ export default function VaniPage() { rows: [], }); const [busy, setBusy] = useState(false); + const [link, setLink] = useState(""); const refresh = () => vani @@ -85,6 +86,27 @@ export default function VaniPage() { } }; + // Pasting the link is the primary path: it names one exact item, where + // search can only match words. A slug searched as text finds its + // neighbours, not itself. + const pinByLink = async () => { + const url = link.trim(); + if (!url) return; + setBusy(true); + try { + const pick = await vani.setByURL({ day, url }); + toast.success(`Set ${pick.payload.title} for ${day}`); + setLink(""); + await refresh(); + } catch (err) { + toast.error( + err instanceof Error ? err.message : "Could not use that link", + ); + } finally { + setBusy(false); + } + }; + const clear = async (pick: VaniPick) => { if ( !window.confirm( @@ -121,7 +143,29 @@ export default function VaniPage() {
-
+
+ setLink(e.target.value)} + onKeyDown={(e) => e.key === "Enter" && void pinByLink()} + placeholder="Paste a link — /transcriptions/720720sb-london" + className={`${field} min-w-0 flex-1`} + /> + +
+

+ Or search by words. A slug only matches its own words, so paste the + link when you know exactly which item you want. +

+ +