From d66295aeddadf713e5bd6cf6db7dc4a52dc29bda Mon Sep 17 00:00:00 2001 From: Anish Sarkar <104695310+AnishSarkar22@users.noreply.github.com> Date: Tue, 19 May 2026 21:02:07 +0530 Subject: [PATCH] chore: ran linting --- .../[search_space_id]/logs/loading.tsx | 5 +- .../new-chat/[[...chat_id]]/page.tsx | 7 +- .../search-space-settings/general/page.tsx | 6 +- .../image-models/page.tsx | 6 +- .../search-space-settings/models/page.tsx | 6 +- .../search-space-settings/prompts/page.tsx | 6 +- .../public-links/page.tsx | 6 +- .../search-space-settings/roles/page.tsx | 6 +- .../team-memory/page.tsx | 6 +- .../search-space-settings/team-roles/page.tsx | 6 +- .../vision-models/page.tsx | 6 +- .../components/AgentPermissionsContent.tsx | 12 +- .../components/MemoryContent.tsx | 4 +- .../user-settings/layout-shell.tsx | 5 +- surfsense_web/app/dashboard/error.tsx | 5 +- surfsense_web/app/error.tsx | 5 +- .../agent-action-log/action-log-dialog.tsx | 7 +- .../agent-action-log/action-log-item.tsx | 4 +- .../assistant-ui/assistant-message.tsx | 3 +- .../baidu-search-api-connect-form.tsx | 4 +- .../components/google-drive-config.tsx | 23 +- .../components/teams-config.tsx | 4 +- .../assistant-ui/inline-citation.tsx | 27 +- .../components/assistant-ui/markdown-text.tsx | 3 +- .../components/assistant-ui/thread.tsx | 420 +++++++++--------- .../comment-panel/comment-panel.tsx | 2 +- .../member-mention-item.tsx | 4 +- .../components/free-chat/anonymous-chat.tsx | 3 +- .../components/inference-params-editor.tsx | 5 +- .../layout/hooks/useSidebarResize.ts | 38 +- .../layout/ui/icon-rail/IconRail.tsx | 3 +- .../ui/sidebar/DesktopLocalTabContent.tsx | 2 +- .../layout/ui/sidebar/InboxSidebar.tsx | 4 +- .../layout/ui/sidebar/MobileSidebar.tsx | 5 +- .../layout/ui/sidebar/SidebarButton.tsx | 8 +- .../layout/ui/sidebar/SidebarSection.tsx | 4 +- .../layout/ui/sidebar/SidebarUserProfile.tsx | 2 +- .../components/layout/ui/tabs/TabBar.tsx | 5 +- .../public-chat-snapshot-row.tsx | 2 +- .../components/report-panel/report-panel.tsx | 78 ++-- .../components/settings/roles-manager.tsx | 12 +- .../settings/team-memory-manager.tsx | 4 +- .../components/sources/DocumentUploadTab.tsx | 13 +- .../components/tool-ui/citation/citation.tsx | 6 +- surfsense_web/components/ui/callout-node.tsx | 5 +- surfsense_web/components/ui/equation-node.tsx | 7 +- surfsense_web/lib/chat/thread-persistence.ts | 1 - surfsense_web/lib/url.ts | 10 +- 48 files changed, 372 insertions(+), 443 deletions(-) diff --git a/surfsense_web/app/dashboard/[search_space_id]/logs/loading.tsx b/surfsense_web/app/dashboard/[search_space_id]/logs/loading.tsx index 115125531..e734d4e53 100644 --- a/surfsense_web/app/dashboard/[search_space_id]/logs/loading.tsx +++ b/surfsense_web/app/dashboard/[search_space_id]/logs/loading.tsx @@ -53,7 +53,10 @@ export default function Loading() { {/* Table Rows */} {[...Array(6)].map((_, i) => ( -
+
diff --git a/surfsense_web/app/dashboard/[search_space_id]/new-chat/[[...chat_id]]/page.tsx b/surfsense_web/app/dashboard/[search_space_id]/new-chat/[[...chat_id]]/page.tsx index ed4ed6ce1..d439cbb67 100644 --- a/surfsense_web/app/dashboard/[search_space_id]/new-chat/[[...chat_id]]/page.tsx +++ b/surfsense_web/app/dashboard/[search_space_id]/new-chat/[[...chat_id]]/page.tsx @@ -44,12 +44,12 @@ import { } from "@/components/assistant-ui/edit-message-dialog"; import { StepSeparatorDataUI } from "@/components/assistant-ui/step-separator"; import { Thread } from "@/components/assistant-ui/thread"; -import { Button } from "@/components/ui/button"; import { createTokenUsageStore, type TokenUsageData, TokenUsageProvider, } from "@/components/assistant-ui/token-usage-context"; +import { Button } from "@/components/ui/button"; import { type HitlDecision, PendingInterruptProvider, @@ -79,10 +79,7 @@ import { setActivePodcastTaskId, } from "@/lib/chat/podcast-state"; import { createStreamFlushHelpers } from "@/lib/chat/stream-flush"; -import { - consumeSseEvents, - processSharedStreamEvent, -} from "@/lib/chat/stream-pipeline"; +import { consumeSseEvents, processSharedStreamEvent } from "@/lib/chat/stream-pipeline"; import { applyTurnIdToAssistantMessageList, mergeChatTurnIdIntoMessage, diff --git a/surfsense_web/app/dashboard/[search_space_id]/search-space-settings/general/page.tsx b/surfsense_web/app/dashboard/[search_space_id]/search-space-settings/general/page.tsx index ac50c654e..09124b3b0 100644 --- a/surfsense_web/app/dashboard/[search_space_id]/search-space-settings/general/page.tsx +++ b/surfsense_web/app/dashboard/[search_space_id]/search-space-settings/general/page.tsx @@ -1,10 +1,6 @@ import { GeneralSettingsManager } from "@/components/settings/general-settings-manager"; -export default async function Page({ - params, -}: { - params: Promise<{ search_space_id: string }>; -}) { +export default async function Page({ params }: { params: Promise<{ search_space_id: string }> }) { const { search_space_id } = await params; return ; } diff --git a/surfsense_web/app/dashboard/[search_space_id]/search-space-settings/image-models/page.tsx b/surfsense_web/app/dashboard/[search_space_id]/search-space-settings/image-models/page.tsx index 22859859b..b300f8078 100644 --- a/surfsense_web/app/dashboard/[search_space_id]/search-space-settings/image-models/page.tsx +++ b/surfsense_web/app/dashboard/[search_space_id]/search-space-settings/image-models/page.tsx @@ -1,10 +1,6 @@ import { ImageModelManager } from "@/components/settings/image-model-manager"; -export default async function Page({ - params, -}: { - params: Promise<{ search_space_id: string }>; -}) { +export default async function Page({ params }: { params: Promise<{ search_space_id: string }> }) { const { search_space_id } = await params; return ; } diff --git a/surfsense_web/app/dashboard/[search_space_id]/search-space-settings/models/page.tsx b/surfsense_web/app/dashboard/[search_space_id]/search-space-settings/models/page.tsx index b14a536ed..d68194782 100644 --- a/surfsense_web/app/dashboard/[search_space_id]/search-space-settings/models/page.tsx +++ b/surfsense_web/app/dashboard/[search_space_id]/search-space-settings/models/page.tsx @@ -1,10 +1,6 @@ import { AgentModelManager } from "@/components/settings/agent-model-manager"; -export default async function Page({ - params, -}: { - params: Promise<{ search_space_id: string }>; -}) { +export default async function Page({ params }: { params: Promise<{ search_space_id: string }> }) { const { search_space_id } = await params; return ; } diff --git a/surfsense_web/app/dashboard/[search_space_id]/search-space-settings/prompts/page.tsx b/surfsense_web/app/dashboard/[search_space_id]/search-space-settings/prompts/page.tsx index fcdafdf2d..cc837299d 100644 --- a/surfsense_web/app/dashboard/[search_space_id]/search-space-settings/prompts/page.tsx +++ b/surfsense_web/app/dashboard/[search_space_id]/search-space-settings/prompts/page.tsx @@ -1,10 +1,6 @@ import { PromptConfigManager } from "@/components/settings/prompt-config-manager"; -export default async function Page({ - params, -}: { - params: Promise<{ search_space_id: string }>; -}) { +export default async function Page({ params }: { params: Promise<{ search_space_id: string }> }) { const { search_space_id } = await params; return ; } diff --git a/surfsense_web/app/dashboard/[search_space_id]/search-space-settings/public-links/page.tsx b/surfsense_web/app/dashboard/[search_space_id]/search-space-settings/public-links/page.tsx index e4b5f35e7..2cddfe3e0 100644 --- a/surfsense_web/app/dashboard/[search_space_id]/search-space-settings/public-links/page.tsx +++ b/surfsense_web/app/dashboard/[search_space_id]/search-space-settings/public-links/page.tsx @@ -1,10 +1,6 @@ import { PublicChatSnapshotsManager } from "@/components/public-chat-snapshots/public-chat-snapshots-manager"; -export default async function Page({ - params, -}: { - params: Promise<{ search_space_id: string }>; -}) { +export default async function Page({ params }: { params: Promise<{ search_space_id: string }> }) { const { search_space_id } = await params; return ; } diff --git a/surfsense_web/app/dashboard/[search_space_id]/search-space-settings/roles/page.tsx b/surfsense_web/app/dashboard/[search_space_id]/search-space-settings/roles/page.tsx index 8c43e7844..5bad50cd3 100644 --- a/surfsense_web/app/dashboard/[search_space_id]/search-space-settings/roles/page.tsx +++ b/surfsense_web/app/dashboard/[search_space_id]/search-space-settings/roles/page.tsx @@ -1,10 +1,6 @@ import { LLMRoleManager } from "@/components/settings/llm-role-manager"; -export default async function Page({ - params, -}: { - params: Promise<{ search_space_id: string }>; -}) { +export default async function Page({ params }: { params: Promise<{ search_space_id: string }> }) { const { search_space_id } = await params; return ; } diff --git a/surfsense_web/app/dashboard/[search_space_id]/search-space-settings/team-memory/page.tsx b/surfsense_web/app/dashboard/[search_space_id]/search-space-settings/team-memory/page.tsx index 987b36513..0652b012e 100644 --- a/surfsense_web/app/dashboard/[search_space_id]/search-space-settings/team-memory/page.tsx +++ b/surfsense_web/app/dashboard/[search_space_id]/search-space-settings/team-memory/page.tsx @@ -1,10 +1,6 @@ import { TeamMemoryManager } from "@/components/settings/team-memory-manager"; -export default async function Page({ - params, -}: { - params: Promise<{ search_space_id: string }>; -}) { +export default async function Page({ params }: { params: Promise<{ search_space_id: string }> }) { const { search_space_id } = await params; return ; } diff --git a/surfsense_web/app/dashboard/[search_space_id]/search-space-settings/team-roles/page.tsx b/surfsense_web/app/dashboard/[search_space_id]/search-space-settings/team-roles/page.tsx index ca2108975..a343eaacb 100644 --- a/surfsense_web/app/dashboard/[search_space_id]/search-space-settings/team-roles/page.tsx +++ b/surfsense_web/app/dashboard/[search_space_id]/search-space-settings/team-roles/page.tsx @@ -1,10 +1,6 @@ import { RolesManager } from "@/components/settings/roles-manager"; -export default async function Page({ - params, -}: { - params: Promise<{ search_space_id: string }>; -}) { +export default async function Page({ params }: { params: Promise<{ search_space_id: string }> }) { const { search_space_id } = await params; return ; } diff --git a/surfsense_web/app/dashboard/[search_space_id]/search-space-settings/vision-models/page.tsx b/surfsense_web/app/dashboard/[search_space_id]/search-space-settings/vision-models/page.tsx index 8b8a2dc6d..06aea003a 100644 --- a/surfsense_web/app/dashboard/[search_space_id]/search-space-settings/vision-models/page.tsx +++ b/surfsense_web/app/dashboard/[search_space_id]/search-space-settings/vision-models/page.tsx @@ -1,10 +1,6 @@ import { VisionModelManager } from "@/components/settings/vision-model-manager"; -export default async function Page({ - params, -}: { - params: Promise<{ search_space_id: string }>; -}) { +export default async function Page({ params }: { params: Promise<{ search_space_id: string }> }) { const { search_space_id } = await params; return ; } diff --git a/surfsense_web/app/dashboard/[search_space_id]/user-settings/components/AgentPermissionsContent.tsx b/surfsense_web/app/dashboard/[search_space_id]/user-settings/components/AgentPermissionsContent.tsx index e87798a14..5af94f7e3 100644 --- a/surfsense_web/app/dashboard/[search_space_id]/user-settings/components/AgentPermissionsContent.tsx +++ b/surfsense_web/app/dashboard/[search_space_id]/user-settings/components/AgentPermissionsContent.tsx @@ -31,7 +31,6 @@ import { } from "@/components/ui/dialog"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; -import { Skeleton } from "@/components/ui/skeleton"; import { Select, SelectContent, @@ -39,6 +38,7 @@ import { SelectTrigger, SelectValue, } from "@/components/ui/select"; +import { Skeleton } from "@/components/ui/skeleton"; import { Spinner } from "@/components/ui/spinner"; import { type AgentPermissionAction, @@ -215,8 +215,10 @@ export function AgentPermissionsContent() {

Flip{" "} - SURFSENSE_ENABLE_PERMISSION on - the backend to manage allow/deny/ask rules from this panel. + + SURFSENSE_ENABLE_PERMISSION + {" "} + on the backend to manage allow/deny/ask rules from this panel.

@@ -425,9 +427,7 @@ export function AgentPermissionsContent() { className={cn("h-8 gap-1 border px-2 text-[11px]", badge.className)} > - - {badge.label} - + {badge.label} diff --git a/surfsense_web/app/dashboard/[search_space_id]/user-settings/components/MemoryContent.tsx b/surfsense_web/app/dashboard/[search_space_id]/user-settings/components/MemoryContent.tsx index af3aefaff..3542f0925 100644 --- a/surfsense_web/app/dashboard/[search_space_id]/user-settings/components/MemoryContent.tsx +++ b/surfsense_web/app/dashboard/[search_space_id]/user-settings/components/MemoryContent.tsx @@ -222,7 +222,9 @@ export function MemoryContent() { onClick={handleEdit} disabled={editing || !editQuery.trim()} className={`h-11 w-11 shrink-0 rounded-full ${ - editing ? "" : "bg-muted-foreground/15 hover:bg-accent hover:text-accent-foreground" + editing + ? "" + : "bg-muted-foreground/15 hover:bg-accent hover:text-accent-foreground" }`} > {editing ? ( diff --git a/surfsense_web/app/dashboard/[search_space_id]/user-settings/layout-shell.tsx b/surfsense_web/app/dashboard/[search_space_id]/user-settings/layout-shell.tsx index a942c57f7..820021622 100644 --- a/surfsense_web/app/dashboard/[search_space_id]/user-settings/layout-shell.tsx +++ b/surfsense_web/app/dashboard/[search_space_id]/user-settings/layout-shell.tsx @@ -40,10 +40,7 @@ interface UserSettingsLayoutShellProps { children: React.ReactNode; } -export function UserSettingsLayoutShell({ - searchSpaceId, - children, -}: UserSettingsLayoutShellProps) { +export function UserSettingsLayoutShell({ searchSpaceId, children }: UserSettingsLayoutShellProps) { const t = useTranslations("userSettings"); const { isDesktop } = usePlatform(); const segment = useSelectedLayoutSegment(); diff --git a/surfsense_web/app/dashboard/error.tsx b/surfsense_web/app/dashboard/error.tsx index 85c31e1a0..28a22fe3c 100644 --- a/surfsense_web/app/dashboard/error.tsx +++ b/surfsense_web/app/dashboard/error.tsx @@ -40,10 +40,7 @@ export default function DashboardError({ )}
- - {copiedSection === "arguments" ? ( diff --git a/surfsense_web/components/assistant-ui/assistant-message.tsx b/surfsense_web/components/assistant-ui/assistant-message.tsx index b18f536ed..ac1732441 100644 --- a/surfsense_web/components/assistant-ui/assistant-message.tsx +++ b/surfsense_web/components/assistant-ui/assistant-message.tsx @@ -24,8 +24,6 @@ import dynamic from "next/dynamic"; import type { FC } from "react"; import { useEffect, useMemo, useRef, useState } from "react"; import { commentsEnabledAtom, targetCommentIdAtom } from "@/atoms/chat/current-thread.atom"; -import { tryGetHostname } from "@/lib/url"; - import { globalNewLLMConfigsAtom, newLLMConfigsAtom, @@ -60,6 +58,7 @@ import { useComments } from "@/hooks/use-comments"; import { useMediaQuery } from "@/hooks/use-media-query"; import { useElectronAPI } from "@/hooks/use-platform"; import { getProviderIcon } from "@/lib/provider-icons"; +import { tryGetHostname } from "@/lib/url"; import { cn } from "@/lib/utils"; // Captured once at module load — survives client-side navigations that strip the query param. diff --git a/surfsense_web/components/assistant-ui/connector-popup/connect-forms/components/baidu-search-api-connect-form.tsx b/surfsense_web/components/assistant-ui/connector-popup/connect-forms/components/baidu-search-api-connect-form.tsx index d994b178d..726371f99 100644 --- a/surfsense_web/components/assistant-ui/connector-popup/connect-forms/components/baidu-search-api-connect-form.tsx +++ b/surfsense_web/components/assistant-ui/connector-popup/connect-forms/components/baidu-search-api-connect-form.tsx @@ -75,8 +75,8 @@ export const BaiduSearchApiConnectForm: FC = ({ onSubmit, isSu API Key Required

- You'll need a Baidu AppBuilder API key to use this connector. You can get one by - signing up at{" "} + You'll need a Baidu AppBuilder API key to use this connector. You can get one by signing + up at{" "} = ({ connector, onConfi const [selectedFiles, setSelectedFiles] = useState(existingFiles); const [indexingOptions, setIndexingOptions] = useState(existingIndexingOptions); - const updateConfig = useCallback((folders: SelectedItem[], files: SelectedItem[], options: IndexingOptions) => { - if (onConfigChange) { - onConfigChange({ - ...connector.config, - selected_folders: folders, - selected_files: files, - indexing_options: options, - }); - } - }, [connector.config, onConfigChange]); + const updateConfig = useCallback( + (folders: SelectedItem[], files: SelectedItem[], options: IndexingOptions) => { + if (onConfigChange) { + onConfigChange({ + ...connector.config, + selected_folders: folders, + selected_files: files, + indexing_options: options, + }); + } + }, + [connector.config, onConfigChange] + ); const handlePicked = useCallback( (result: PickerResult) => { diff --git a/surfsense_web/components/assistant-ui/connector-popup/connector-configs/components/teams-config.tsx b/surfsense_web/components/assistant-ui/connector-popup/connector-configs/components/teams-config.tsx index aae517098..a1d387e90 100644 --- a/surfsense_web/components/assistant-ui/connector-popup/connector-configs/components/teams-config.tsx +++ b/surfsense_web/components/assistant-ui/connector-popup/connector-configs/components/teams-config.tsx @@ -18,8 +18,8 @@ export const TeamsConfig: FC = () => {

Your agent can search and read messages from Teams channels you have access to, and send - messages on your behalf. Make sure you're a member of the teams you want to - interact with. + messages on your behalf. Make sure you're a member of the teams you want to interact + with.

diff --git a/surfsense_web/components/assistant-ui/inline-citation.tsx b/surfsense_web/components/assistant-ui/inline-citation.tsx index ebfd7a65b..a788c0ce6 100644 --- a/surfsense_web/components/assistant-ui/inline-citation.tsx +++ b/surfsense_web/components/assistant-ui/inline-citation.tsx @@ -105,7 +105,11 @@ const NumericChunkCitation: FC<{ chunkId: number }> = ({ chunkId }) => { > {chunkId} - + = ({ chunkId }) => { > - - + + Surfsense documentation - + @@ -202,9 +211,7 @@ const SurfsenseDocPreviewContent: FC<{ <>
-

- {data?.title ?? "Surfsense documentation"} -

+

{data?.title ?? "Surfsense documentation"}

Chunk #{chunkId}

{data?.public_url && ( diff --git a/surfsense_web/components/assistant-ui/markdown-text.tsx b/surfsense_web/components/assistant-ui/markdown-text.tsx index 69c1831ca..ee36e8499 100644 --- a/surfsense_web/components/assistant-ui/markdown-text.tsx +++ b/surfsense_web/components/assistant-ui/markdown-text.tsx @@ -22,8 +22,6 @@ import { MentionChip } from "@/components/assistant-ui/mention-chip"; import "katex/dist/katex.min.css"; import { toast } from "sonner"; import { processChildrenWithCitations } from "@/components/citations/citation-renderer"; -import { tryGetHostname } from "@/lib/url"; - import { Table, TableBody, @@ -36,6 +34,7 @@ import { useElectronAPI } from "@/hooks/use-platform"; import { documentsApiService } from "@/lib/apis/documents-api.service"; import { getVirtualPathDisplay } from "@/lib/chat/virtual-path-display"; import { type CitationUrlMap, preprocessCitationMarkdown } from "@/lib/citations/citation-parser"; +import { tryGetHostname } from "@/lib/url"; import { cn } from "@/lib/utils"; function MarkdownCodeBlockLoading() { diff --git a/surfsense_web/components/assistant-ui/thread.tsx b/surfsense_web/components/assistant-ui/thread.tsx index 06a064840..6876ce23e 100644 --- a/surfsense_web/components/assistant-ui/thread.tsx +++ b/surfsense_web/components/assistant-ui/thread.tsx @@ -72,11 +72,7 @@ import { import { PromptPicker, type PromptPickerRef } from "@/components/new-chat/prompt-picker"; import { Avatar, AvatarFallback, AvatarGroup } from "@/components/ui/avatar"; import { Button } from "@/components/ui/button"; -import { - Collapsible, - CollapsibleContent, - CollapsibleTrigger, -} from "@/components/ui/collapsible"; +import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@/components/ui/collapsible"; import { Drawer, DrawerContent, @@ -383,7 +379,9 @@ const ClipboardChip: FC<{ text: string; onDismiss: () => void }> = ({ text, onDi size="icon" className="size-5 text-muted-foreground hover:bg-transparent hover:text-accent-foreground" > - + )} + + toggleToolGroup(toolNames)} + className="shrink-0" + /> +
+ + {group.tools.map((tool) => { + const isDisabled = disabledToolsSet.has(tool.name); + return ( +
- {iconInfo ? ( - {iconInfo.alt} - ) : ( - - )} - - {group.label} + + {formatToolName(tool.name)} - {isExpanded ? ( - - ) : ( - - )} - - - toggleToolGroup(toolNames)} - className="shrink-0" - /> -
- - {group.tools.map((tool) => { - const isDisabled = disabledToolsSet.has(tool.name); - return ( -
- - {formatToolName(tool.name)} - - toggleTool(tool.name)} - className="shrink-0" - /> -
- ); - })} -
- - ); - })} + toggleTool(tool.name)} + className="shrink-0" + /> +
+ ); + })} + + + ); + })}
)} {otherToolGroup && ( @@ -1227,124 +1223,124 @@ const ComposerAction: FC = ({ isBlockedByOtherUser = false onScroll={() => setOpenConnectorSubmenu(null)} > {regularToolGroups.map((group) => ( -
-
- {group.label} -
- {group.tools.map((tool) => { - const isDisabled = disabledToolsSet.has(tool.name); - const ToolIcon = getToolIcon(tool.name); - return ( - { - e.preventDefault(); - toggleTool(tool.name); - }} - className={cn( - "mb-1 last:mb-0 transition-all", - "hover:bg-accent hover:text-accent-foreground", - !isDisabled && "text-primary" - )} - > - - - {formatToolName(tool.name)} - - - - ); - })} +
+
+ {group.label}
- ))} + {group.tools.map((tool) => { + const isDisabled = disabledToolsSet.has(tool.name); + const ToolIcon = getToolIcon(tool.name); + return ( + { + e.preventDefault(); + toggleTool(tool.name); + }} + className={cn( + "mb-1 last:mb-0 transition-all", + "hover:bg-accent hover:text-accent-foreground", + !isDisabled && "text-primary" + )} + > + + + {formatToolName(tool.name)} + + + + ); + })} +
+ ))} {connectorToolGroups.length > 0 && (
Connector Actions
{connectorToolGroups.map((group) => { - const iconKey = group.connectorIcon ?? ""; - const iconInfo = CONNECTOR_TOOL_ICON_PATHS[iconKey]; - const toolNames = group.tools.map((t) => t.name); - const allDisabled = toolNames.every((n) => disabledToolsSet.has(n)); - return ( - - setOpenConnectorSubmenu(open ? group.label : null) - } + const iconKey = group.connectorIcon ?? ""; + const iconInfo = CONNECTOR_TOOL_ICON_PATHS[iconKey]; + const toolNames = group.tools.map((t) => t.name); + const allDisabled = toolNames.every((n) => disabledToolsSet.has(n)); + return ( + + setOpenConnectorSubmenu(open ? group.label : null) + } + > + svg:last-child]:ml-0", + !allDisabled && "text-primary" + )} > - svg:last-child]:ml-0", - !allDisabled && "text-primary" - )} - > - {iconInfo ? ( - {iconInfo.alt} - ) : ( - - )} - {group.label} - event.stopPropagation()} - onClick={(event) => event.stopPropagation()} - onCheckedChange={() => toggleToolGroup(toolNames)} - className="shrink-0 scale-[0.6]" + {iconInfo ? ( + {iconInfo.alt} - - - - {group.tools.map((tool) => { - const isDisabled = disabledToolsSet.has(tool.name); - return ( - { - e.preventDefault(); - toggleTool(tool.name); - }} - className={cn( - "mb-1 last:mb-0 transition-all", - "hover:bg-accent hover:text-accent-foreground", - !isDisabled && "text-primary" - )} - > - - {formatToolName(tool.name)} - - - - ); - })} - - - - ); - })} + ) : ( + + )} + {group.label} + event.stopPropagation()} + onClick={(event) => event.stopPropagation()} + onCheckedChange={() => toggleToolGroup(toolNames)} + className="shrink-0 scale-[0.6]" + /> + + + + {group.tools.map((tool) => { + const isDisabled = disabledToolsSet.has(tool.name); + return ( + { + e.preventDefault(); + toggleTool(tool.name); + }} + className={cn( + "mb-1 last:mb-0 transition-all", + "hover:bg-accent hover:text-accent-foreground", + !isDisabled && "text-primary" + )} + > + + {formatToolName(tool.name)} + + + + ); + })} + + + + ); + })}
)} {otherToolGroup && ( diff --git a/surfsense_web/components/chat-comments/comment-panel/comment-panel.tsx b/surfsense_web/components/chat-comments/comment-panel/comment-panel.tsx index bc4c2b636..ef569c81f 100644 --- a/surfsense_web/components/chat-comments/comment-panel/comment-panel.tsx +++ b/surfsense_web/components/chat-comments/comment-panel/comment-panel.tsx @@ -1,7 +1,7 @@ "use client"; -import { cn } from "@/lib/utils"; import { Separator } from "@/components/ui/separator"; +import { cn } from "@/lib/utils"; import { CommentComposer } from "../comment-composer/comment-composer"; import { CommentThread } from "../comment-thread/comment-thread"; import type { CommentPanelProps } from "./types"; diff --git a/surfsense_web/components/chat-comments/member-mention-picker/member-mention-item.tsx b/surfsense_web/components/chat-comments/member-mention-picker/member-mention-item.tsx index 8972c903d..015d56c76 100644 --- a/surfsense_web/components/chat-comments/member-mention-picker/member-mention-item.tsx +++ b/surfsense_web/components/chat-comments/member-mention-picker/member-mention-item.tsx @@ -31,7 +31,9 @@ export function MemberMentionItem({ type="button" className={cn( "h-auto w-full justify-start gap-3 rounded-none px-3 py-2 text-left transition-colors", - isHighlighted ? "bg-primary/15 text-accent-foreground" : "hover:bg-accent hover:text-accent-foreground" + isHighlighted + ? "bg-primary/15 text-accent-foreground" + : "hover:bg-accent hover:text-accent-foreground" )} onClick={() => onSelect(member)} onMouseEnter={onMouseEnter} diff --git a/surfsense_web/components/free-chat/anonymous-chat.tsx b/surfsense_web/components/free-chat/anonymous-chat.tsx index 93168d084..0164c870b 100644 --- a/surfsense_web/components/free-chat/anonymous-chat.tsx +++ b/surfsense_web/components/free-chat/anonymous-chat.tsx @@ -103,7 +103,8 @@ export function AnonymousChat({ model }: AnonymousChatProps) { remaining: 0, status: "exceeded", warning_threshold: quota?.warning_threshold ?? 800000, - captcha_required: errorData.detail?.captcha_required ?? quota?.captcha_required ?? false, + captcha_required: + errorData.detail?.captcha_required ?? quota?.captcha_required ?? false, }); setMessages((prev) => prev.filter((m) => m.id !== assistantId)); return; diff --git a/surfsense_web/components/inference-params-editor.tsx b/surfsense_web/components/inference-params-editor.tsx index 64de39dd8..6e9514cdc 100644 --- a/surfsense_web/components/inference-params-editor.tsx +++ b/surfsense_web/components/inference-params-editor.tsx @@ -128,7 +128,10 @@ export default function InferenceParamsEditor({ params, setParams }: InferencePa {Object.entries(params).map(([key, val]) => ( - + {key} {val.toString()} diff --git a/surfsense_web/components/layout/hooks/useSidebarResize.ts b/surfsense_web/components/layout/hooks/useSidebarResize.ts index 5df6be378..a13af1663 100644 --- a/surfsense_web/components/layout/hooks/useSidebarResize.ts +++ b/surfsense_web/components/layout/hooks/useSidebarResize.ts @@ -50,8 +50,7 @@ export function useSidebarResize(defaultWidth = SIDEBAR_MIN_WIDTH): UseSidebarRe widthRef.current = parsed; } } - } catch { - } + } catch {} }, []); const persistWidth = useCallback((width: number) => { @@ -71,32 +70,27 @@ export function useSidebarResize(defaultWidth = SIDEBAR_MIN_WIDTH): UseSidebarRe if (target.hasPointerCapture(pointerId)) { target.releasePointerCapture(pointerId); } - } catch { - } + } catch {} } captureTargetRef.current = null; pointerIdRef.current = null; }, []); - const handlePointerDown = useCallback( - (e: React.PointerEvent) => { - if (e.pointerType === "mouse" && e.button !== 0) return; + const handlePointerDown = useCallback((e: React.PointerEvent) => { + if (e.pointerType === "mouse" && e.button !== 0) return; - e.preventDefault(); - const target = e.currentTarget; - try { - target.setPointerCapture(e.pointerId); - } catch { - } - captureTargetRef.current = target; - pointerIdRef.current = e.pointerId; - startXRef.current = e.clientX; - startWidthRef.current = widthRef.current; - setIsDragging(true); - setGlobalDragCursor(true); - }, - [] - ); + e.preventDefault(); + const target = e.currentTarget; + try { + target.setPointerCapture(e.pointerId); + } catch {} + captureTargetRef.current = target; + pointerIdRef.current = e.pointerId; + startXRef.current = e.clientX; + startWidthRef.current = widthRef.current; + setIsDragging(true); + setGlobalDragCursor(true); + }, []); useEffect(() => { if (!isDragging) return; diff --git a/surfsense_web/components/layout/ui/icon-rail/IconRail.tsx b/surfsense_web/components/layout/ui/icon-rail/IconRail.tsx index fdc4930d6..a47b00e5c 100644 --- a/surfsense_web/components/layout/ui/icon-rail/IconRail.tsx +++ b/surfsense_web/components/layout/ui/icon-rail/IconRail.tsx @@ -5,8 +5,7 @@ import { Button } from "@/components/ui/button"; import { ScrollArea } from "@/components/ui/scroll-area"; import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip"; import { cn } from "@/lib/utils"; -import type { NavItem, SearchSpace } from "../../types/layout.types"; -import type { User } from "../../types/layout.types"; +import type { NavItem, SearchSpace, User } from "../../types/layout.types"; import { SidebarUserProfile } from "../sidebar/SidebarUserProfile"; import { SearchSpaceAvatar } from "./SearchSpaceAvatar"; diff --git a/surfsense_web/components/layout/ui/sidebar/DesktopLocalTabContent.tsx b/surfsense_web/components/layout/ui/sidebar/DesktopLocalTabContent.tsx index 473a4894b..71d798e22 100644 --- a/surfsense_web/components/layout/ui/sidebar/DesktopLocalTabContent.tsx +++ b/surfsense_web/components/layout/ui/sidebar/DesktopLocalTabContent.tsx @@ -4,6 +4,7 @@ import { useAtom } from "jotai"; import { Folder, FolderPlus, Search, X } from "lucide-react"; import { useCallback, useMemo, useRef, useState } from "react"; import { localExpandedFolderKeysAtom } from "@/atoms/documents/folder.atoms"; +import { Button } from "@/components/ui/button"; import { DropdownMenu, DropdownMenuContent, @@ -11,7 +12,6 @@ import { DropdownMenuLabel, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; -import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Separator } from "@/components/ui/separator"; import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip"; diff --git a/surfsense_web/components/layout/ui/sidebar/InboxSidebar.tsx b/surfsense_web/components/layout/ui/sidebar/InboxSidebar.tsx index 83f4f26f1..f757db70e 100644 --- a/surfsense_web/components/layout/ui/sidebar/InboxSidebar.tsx +++ b/surfsense_web/components/layout/ui/sidebar/InboxSidebar.tsx @@ -1047,7 +1047,9 @@ export function InboxSidebarContent({ )}

{getEmptyStateMessage().title}

-

{getEmptyStateMessage().hint}

+

+ {getEmptyStateMessage().hint} +

)}
diff --git a/surfsense_web/components/layout/ui/sidebar/MobileSidebar.tsx b/surfsense_web/components/layout/ui/sidebar/MobileSidebar.tsx index 02fa666be..83d423ace 100644 --- a/surfsense_web/components/layout/ui/sidebar/MobileSidebar.tsx +++ b/surfsense_web/components/layout/ui/sidebar/MobileSidebar.tsx @@ -108,7 +108,10 @@ export function MobileSidebar({ return ( - + Navigation {/* Vertical Search Spaces Rail - left side */} diff --git a/surfsense_web/components/layout/ui/sidebar/SidebarButton.tsx b/surfsense_web/components/layout/ui/sidebar/SidebarButton.tsx index d440fe9d3..cc7f83e1d 100644 --- a/surfsense_web/components/layout/ui/sidebar/SidebarButton.tsx +++ b/surfsense_web/components/layout/ui/sidebar/SidebarButton.tsx @@ -64,17 +64,13 @@ export function SidebarButton({ isCollapsed ? "shrink-0" : "flex-1" )} > - - {iconNode} - + {iconNode} {label} diff --git a/surfsense_web/components/layout/ui/sidebar/SidebarSection.tsx b/surfsense_web/components/layout/ui/sidebar/SidebarSection.tsx index 0c957e1fe..99162dddf 100644 --- a/surfsense_web/components/layout/ui/sidebar/SidebarSection.tsx +++ b/surfsense_web/components/layout/ui/sidebar/SidebarSection.tsx @@ -69,9 +69,7 @@ export function SidebarSection({ -
- {children} -
+
{children}
); diff --git a/surfsense_web/components/layout/ui/sidebar/SidebarUserProfile.tsx b/surfsense_web/components/layout/ui/sidebar/SidebarUserProfile.tsx index 550c83b80..bc3b36efd 100644 --- a/surfsense_web/components/layout/ui/sidebar/SidebarUserProfile.tsx +++ b/surfsense_web/components/layout/ui/sidebar/SidebarUserProfile.tsx @@ -17,6 +17,7 @@ import { import Image from "next/image"; import { useTranslations } from "next-intl"; import { useState } from "react"; +import { Button } from "@/components/ui/button"; import { DropdownMenu, DropdownMenuContent, @@ -29,7 +30,6 @@ import { DropdownMenuSubTrigger, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; -import { Button } from "@/components/ui/button"; import { Spinner } from "@/components/ui/spinner"; import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip"; import { useLocaleContext } from "@/contexts/LocaleContext"; diff --git a/surfsense_web/components/layout/ui/tabs/TabBar.tsx b/surfsense_web/components/layout/ui/tabs/TabBar.tsx index 3946fdc6d..c5fb91f4d 100644 --- a/surfsense_web/components/layout/ui/tabs/TabBar.tsx +++ b/surfsense_web/components/layout/ui/tabs/TabBar.tsx @@ -190,10 +190,7 @@ export function TabBar({ )} /> ) : null} -
+
diff --git a/surfsense_web/components/report-panel/report-panel.tsx b/surfsense_web/components/report-panel/report-panel.tsx index fc9a9f27b..e3b8b2354 100644 --- a/surfsense_web/components/report-panel/report-panel.tsx +++ b/surfsense_web/components/report-panel/report-panel.tsx @@ -317,44 +317,44 @@ export function ReportPanelContent({ setIsEditing(false); }, []); - const exportButton = !isEditing && ( - isResume ? ( - - ) : ( - - - - - handleExport("pdf")} + disabled={isLoading || !reportContent?.content || exporting !== null} + > + {exporting === "pdf" ? : } + Download report + + ) : ( + + + + + + + + + )); const versionSwitcher = !isEditing && versions.length > 1 && ( @@ -446,9 +446,7 @@ export function ReportPanelContent({ <> {/* Header — matches the Documents panel header pattern */}
-

- {isResume ? "Resume" : "Report"} -

+

{isResume ? "Resume" : "Report"}

{onClose && (

{title}

{snippet && ( -

- {snippet} -

+

{snippet}

)}
diff --git a/surfsense_web/components/ui/callout-node.tsx b/surfsense_web/components/ui/callout-node.tsx index 597276511..0c8901a1d 100644 --- a/surfsense_web/components/ui/callout-node.tsx +++ b/surfsense_web/components/ui/callout-node.tsx @@ -60,10 +60,7 @@ export function CalloutElement({ children, ...props }: PlateElementProps + - diff --git a/surfsense_web/lib/chat/thread-persistence.ts b/surfsense_web/lib/chat/thread-persistence.ts index 18ddb4ea0..4cf9b8e68 100644 --- a/surfsense_web/lib/chat/thread-persistence.ts +++ b/surfsense_web/lib/chat/thread-persistence.ts @@ -231,4 +231,3 @@ export function getRegenerateUrl(threadId: number): string { const backendUrl = process.env.NEXT_PUBLIC_FASTAPI_BACKEND_URL || "http://localhost:8000"; return `${backendUrl}/api/v1/threads/${threadId}/regenerate`; } - diff --git a/surfsense_web/lib/url.ts b/surfsense_web/lib/url.ts index 0c9227581..7bb0488d0 100644 --- a/surfsense_web/lib/url.ts +++ b/surfsense_web/lib/url.ts @@ -6,9 +6,9 @@ * `extractDomain` helpers that had subtly different error fallbacks. */ export function tryGetHostname(url: string): string | undefined { - try { - return new URL(url).hostname.replace(/^www\./, ""); - } catch { - return undefined; - } + try { + return new URL(url).hostname.replace(/^www\./, ""); + } catch { + return undefined; + } }