mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-06 20:15:17 +02:00
feat(chat): add cached thread prefetching for faster navigation
This commit is contained in:
parent
8b704b2fef
commit
168c0d2f89
9 changed files with 356 additions and 139 deletions
|
|
@ -3,7 +3,7 @@
|
|||
import { useSetAtom } from "jotai";
|
||||
import { FileText } from "lucide-react";
|
||||
import type { FC } from "react";
|
||||
import { useState } from "react";
|
||||
import { useId, useState } from "react";
|
||||
import { openCitationPanelAtom } from "@/atoms/citation/citation-panel.atom";
|
||||
import { useCitationMetadata } from "@/components/assistant-ui/citation-metadata-context";
|
||||
import { CitationPanelContent } from "@/components/citation-panel/citation-panel";
|
||||
|
|
@ -120,12 +120,14 @@ interface UrlCitationProps {
|
|||
* page title and snippet (extracted deterministically from web_search tool results).
|
||||
*/
|
||||
export const UrlCitation: FC<UrlCitationProps> = ({ url }) => {
|
||||
const reactId = useId();
|
||||
const citationInstanceId = `url-cite-${reactId.replace(/:/g, "")}`;
|
||||
const domain = tryGetHostname(url) ?? url;
|
||||
const meta = useCitationMetadata(url);
|
||||
|
||||
return (
|
||||
<Citation
|
||||
id={`url-cite-${url}`}
|
||||
id={citationInstanceId}
|
||||
href={url}
|
||||
title={meta?.title || domain}
|
||||
snippet={meta?.snippet}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue