diff --git a/surfsense_web/app/dashboard/[search_space_id]/editor/[documentId]/page.tsx b/surfsense_web/app/dashboard/[search_space_id]/editor/[documentId]/page.tsx index 8ac20a606..1f51d9975 100644 --- a/surfsense_web/app/dashboard/[search_space_id]/editor/[documentId]/page.tsx +++ b/surfsense_web/app/dashboard/[search_space_id]/editor/[documentId]/page.tsx @@ -26,7 +26,9 @@ import { notesApiService } from "@/lib/apis/notes-api.service"; import { authenticatedFetch, getBearerToken, redirectToLogin } from "@/lib/auth-utils"; // BlockNote types -type BlockNoteInlineContent = string | { text?: string; type?: string; styles?: Record }; +type BlockNoteInlineContent = + | string + | { text?: string; type?: string; styles?: Record }; interface BlockNoteBlock { type: string; diff --git a/surfsense_web/components/assistant-ui/attachment.tsx b/surfsense_web/components/assistant-ui/attachment.tsx index 152f54127..9750b24d9 100644 --- a/surfsense_web/components/assistant-ui/attachment.tsx +++ b/surfsense_web/components/assistant-ui/attachment.tsx @@ -41,23 +41,23 @@ const useAttachmentSrc = () => { const { file, src } = useAssistantState( useShallow(({ attachment }): { file?: File; src?: string } => { if (!attachment || attachment.type !== "image") return {}; - + // First priority: use File object if available (for new uploads) if (attachment.file) return { file: attachment.file }; - + // Second priority: use stored imageDataUrl (for persisted messages) // This is stored in our custom ChatAttachment interface const customAttachment = attachment as { imageDataUrl?: string }; if (customAttachment.imageDataUrl) { return { src: customAttachment.imageDataUrl }; } - + // Third priority: try to extract from content array (standard assistant-ui format) if (Array.isArray(attachment.content)) { const contentSrc = attachment.content.filter((c) => c.type === "image")[0]?.image; if (contentSrc) return { src: contentSrc }; } - + return {}; }) ); @@ -297,9 +297,7 @@ const MessageAttachmentChip: FC = () => { }; export const UserMessageAttachments: FC = () => { - return ( - - ); + return ; }; export const ComposerAttachments: FC = () => { diff --git a/surfsense_web/components/assistant-ui/thread.tsx b/surfsense_web/components/assistant-ui/thread.tsx index d2b82000f..d59835649 100644 --- a/surfsense_web/components/assistant-ui/thread.tsx +++ b/surfsense_web/components/assistant-ui/thread.tsx @@ -505,7 +505,13 @@ const Composer: FC = () => { setMentionedDocuments([]); setMentionedDocumentIds([]); } - }, [showDocumentPopover, isThreadRunning, composerRuntime, setMentionedDocuments, setMentionedDocumentIds]); + }, [ + showDocumentPopover, + isThreadRunning, + composerRuntime, + setMentionedDocuments, + setMentionedDocumentIds, + ]); // Handle document removal from inline editor const handleDocumentRemove = useCallback( diff --git a/surfsense_web/components/prompt-kit/chain-of-thought.tsx b/surfsense_web/components/prompt-kit/chain-of-thought.tsx index d7b466a02..ca9698b31 100644 --- a/surfsense_web/components/prompt-kit/chain-of-thought.tsx +++ b/surfsense_web/components/prompt-kit/chain-of-thought.tsx @@ -69,10 +69,7 @@ function useEntranceAnimation(delay = 0): boolean { /** * Check if an extension belongs to a specific category */ -function isExtensionInCategory( - ext: string, - category: FileExtensionCategory -): boolean { +function isExtensionInCategory(ext: string, category: FileExtensionCategory): boolean { return (FILE_EXTENSIONS[category] as readonly string[]).includes(ext); } @@ -172,8 +169,7 @@ function parseAndRenderWithBadges(text: string): React.ReactNode { // Chain of Thought Components // ============================================================================ -export interface ChainOfThoughtItemProps - extends React.HTMLAttributes { +export interface ChainOfThoughtItemProps extends React.HTMLAttributes { children: React.ReactNode; } @@ -183,10 +179,7 @@ export const ChainOfThoughtItem: React.FC = ({ ...props }) => (
{typeof children === "string" ? parseAndRenderWithBadges(children) : children} @@ -290,10 +283,7 @@ export interface ChainOfThoughtProps { className?: string; } -export const ChainOfThought: React.FC = ({ - children, - className, -}) => { +export const ChainOfThought: React.FC = ({ children, className }) => { const childrenArray = React.Children.toArray(children); return ( diff --git a/surfsense_web/components/tool-ui/deepagent-thinking.tsx b/surfsense_web/components/tool-ui/deepagent-thinking.tsx index 22c4777f7..5694035bc 100644 --- a/surfsense_web/components/tool-ui/deepagent-thinking.tsx +++ b/surfsense_web/components/tool-ui/deepagent-thinking.tsx @@ -135,10 +135,7 @@ export function parseThinkingResult(data: unknown): DeepAgentThinkingResult { /** * Check if title contains any of the keywords */ -function titleContainsKeywords( - title: string, - keywords: readonly string[] -): boolean { +function titleContainsKeywords(title: string, keywords: readonly string[]): boolean { const titleLower = title.toLowerCase(); return keywords.some((keyword) => titleLower.includes(keyword)); } @@ -180,15 +177,8 @@ interface ThinkingStepDisplayProps { /** * Component to display a single thinking step with controlled open state */ -const ThinkingStepDisplay: FC = ({ - step, - isOpen, - onToggle, -}) => { - const icon = useMemo( - () => getStepIcon(step.status, step.title), - [step.status, step.title] - ); +const ThinkingStepDisplay: FC = ({ step, isOpen, onToggle }) => { + const icon = useMemo(() => getStepIcon(step.status, step.title), [step.status, step.title]); const isInProgress = step.status === STEP_STATUS.IN_PROGRESS; const isCompleted = step.status === STEP_STATUS.COMPLETED;