push various minor updates

This commit is contained in:
pablodanswer
2025-02-03 21:23:45 -08:00
parent b928201397
commit b97819189b
2 changed files with 27 additions and 8 deletions

View File

@@ -112,7 +112,6 @@ export const AgenticMessage = ({
toggleDocDisplay?: (agentic: boolean) => void; toggleDocDisplay?: (agentic: boolean) => void;
}) => { }) => {
const [noShowingMessage, setNoShowingMessage] = useState(isComplete); const [noShowingMessage, setNoShowingMessage] = useState(isComplete);
const [streamedContent, setStreamedContent] = useState(content as string);
const [lastKnownContentLength, setLastKnownContentLength] = useState(0); const [lastKnownContentLength, setLastKnownContentLength] = useState(0);
@@ -157,6 +156,9 @@ export const AgenticMessage = ({
return preprocessLaTeX(processed); return preprocessLaTeX(processed);
}; };
const [streamedContent, setStreamedContent] = useState(
processContent(content) as string
);
const finalContent = processContent(content) as string; const finalContent = processContent(content) as string;
const finalAlternativeContent = processContent(alternativeContent) as string; const finalAlternativeContent = processContent(alternativeContent) as string;
@@ -401,10 +403,9 @@ export const AgenticMessage = ({
allowDocuments={() => setAllowDocuments(true)} allowDocuments={() => setAllowDocuments(true)}
docSidebarToggled={docSidebarToggled || false} docSidebarToggled={docSidebarToggled || false}
finishedGenerating={ finishedGenerating={
finalContent.length > 10 && finalContent.length > 2 &&
streamedContent.length == finalContent.length streamedContent.length == finalContent.length
} }
// overallAnswerGenerating={false}
overallAnswerGenerating={ overallAnswerGenerating={
!!( !!(
secondLevelSubquestions && secondLevelSubquestions &&

View File

@@ -21,7 +21,8 @@ interface SourcesDisplayProps {
const SourceCard: React.FC<{ const SourceCard: React.FC<{
document: OnyxDocument; document: OnyxDocument;
hideDocumentDisplay?: boolean; hideDocumentDisplay?: boolean;
}> = ({ document, hideDocumentDisplay = false }) => { setPresentingDocument: (document: OnyxDocument) => void;
}> = ({ document, hideDocumentDisplay = false, setPresentingDocument }) => {
const truncatedtext = document.match_highlights[0] const truncatedtext = document.match_highlights[0]
? document.match_highlights[0].slice(0, 80) ? document.match_highlights[0].slice(0, 80)
: document.blurb?.slice(0, 80) || ""; : document.blurb?.slice(0, 80) || "";
@@ -32,12 +33,28 @@ const SourceCard: React.FC<{
return ( return (
<button <button
onClick={() => openDocument(document, () => {})} onClick={() =>
className="w-full max-w-[260px] h-[80px] p-3 bg-[#f1eee8] text-left hover:bg-[#ebe7de] cursor-pointer rounded-lg flex flex-col justify-between overflow-hidden" openDocument(document, () => setPresentingDocument(document))
}
className="w-full max-w-[260px] h-[80px] p-3 bg-[#f1eee8]
text-left hover:bg-[#ebe7de]
cursor-pointer rounded-lg
flex flex-col justify-between
overflow-hidden"
> >
<div className="text-black text-xs line-clamp-2 font-medium leading-tight overflow-hidden"> <div
<span className="break-words">{documentSummary}</span> className="
text-black text-xs
font-medium leading-tight
whitespace-normal
break-all
line-clamp-2
overflow-hidden
"
>
{documentSummary}
</div> </div>
<div className="flex items-center gap-1 mt-1"> <div className="flex items-center gap-1 mt-1">
<ResultIcon doc={document} size={14} /> <ResultIcon doc={document} size={14} />
<div className="text-[#4a4a4a] text-xs leading-tight truncate flex-1 min-w-0"> <div className="text-[#4a4a4a] text-xs leading-tight truncate flex-1 min-w-0">
@@ -82,6 +99,7 @@ export const SourcesDisplay: React.FC<SourcesDisplayProps> = ({
}`} }`}
> >
<SourceCard <SourceCard
setPresentingDocument={setPresentingDocument}
hideDocumentDisplay={hideDocumentDisplay} hideDocumentDisplay={hideDocumentDisplay}
document={doc} document={doc}
/> />