From 539e6d77a00f945aa9bc145624eaefe57dcceabb Mon Sep 17 00:00:00 2001 From: Reece Date: Thu, 12 Mar 2026 12:55:48 +0000 Subject: [PATCH] lint and tsc --- .../smartFolders/SmartFolderHomePage.tsx | 2 +- .../SmartFolderManagementModal.tsx | 1 - .../smartFolders/SmartFolderWorkbenchView.tsx | 13 ++-- .../smartFolders/WatchFolderFileList.tsx | 5 -- .../src/core/components/tools/ToolPanel.tsx | 78 +++++++++---------- 5 files changed, 43 insertions(+), 56 deletions(-) diff --git a/frontend/src/core/components/smartFolders/SmartFolderHomePage.tsx b/frontend/src/core/components/smartFolders/SmartFolderHomePage.tsx index f3259b1d0e..b315d163a5 100644 --- a/frontend/src/core/components/smartFolders/SmartFolderHomePage.tsx +++ b/frontend/src/core/components/smartFolders/SmartFolderHomePage.tsx @@ -536,7 +536,7 @@ export function SmartFolderHomePage() { }); await folderStorage.storeInputFile(folder.id, inputFileId, file, file.name); try { - const resultFiles = await executeAutomationSequence(automation, [file], toolRegistry); + const resultFiles = await executeAutomationSequence(automation, [file], toolRegistry as any); const existingRuns = await folderRunStateStorage.getFolderRunState(folder.id); const newRuns: SmartFolderRunEntry[] = [...existingRuns]; for (const resultFile of resultFiles) { diff --git a/frontend/src/core/components/smartFolders/SmartFolderManagementModal.tsx b/frontend/src/core/components/smartFolders/SmartFolderManagementModal.tsx index 1cee295216..eafefa477a 100644 --- a/frontend/src/core/components/smartFolders/SmartFolderManagementModal.tsx +++ b/frontend/src/core/components/smartFolders/SmartFolderManagementModal.tsx @@ -10,7 +10,6 @@ import { ColorSwatch, SimpleGrid, Text, - Box, } from '@mantine/core'; import { useTranslation } from 'react-i18next'; import { SmartFolder } from '@app/types/smartFolders'; diff --git a/frontend/src/core/components/smartFolders/SmartFolderWorkbenchView.tsx b/frontend/src/core/components/smartFolders/SmartFolderWorkbenchView.tsx index b1a68d6e1b..0f85507899 100644 --- a/frontend/src/core/components/smartFolders/SmartFolderWorkbenchView.tsx +++ b/frontend/src/core/components/smartFolders/SmartFolderWorkbenchView.tsx @@ -33,7 +33,7 @@ import { SMART_FOLDER_VIEW_ID, SMART_FOLDER_WORKBENCH_ID } from '@app/components import { automationStorage } from '@app/services/automationStorage'; import { folderStorage } from '@app/services/folderStorage'; import { executeAutomationSequence } from '@app/utils/automationExecutor'; -import { SmartFolderRunEntry, SmartFolder } from '@app/types/smartFolders'; +import { SmartFolderRunEntry } from '@app/types/smartFolders'; import { AutomationConfig } from '@app/types/automation'; import { iconMap } from '@app/components/tools/automate/iconMap'; import { fileStorage } from '@app/services/fileStorage'; @@ -78,15 +78,14 @@ export function SmartFolderWorkbenchView({ data }: SmartFolderWorkbenchViewProps const { folderRecord, fileIds, - pendingFileIds, processingFileIds, processedFileIds, addFile, updateFileMetadata, getFileMetadata, - } = useFolderData(folderId); + } = useFolderData(folderId ?? ''); - const { recentRuns, setRecentRuns } = useFolderRunState(folderId); + const { recentRuns, setRecentRuns } = useFolderRunState(folderId ?? ''); const [isDragOver, setIsDragOver] = useState(false); const [outputFiles, setOutputFiles] = useState([]); @@ -134,7 +133,7 @@ export function SmartFolderWorkbenchView({ data }: SmartFolderWorkbenchViewProps const resultFiles = await executeAutomationSequence( auto, [inputFile], - toolRegistry, + toolRegistry as any, () => {}, () => {}, () => {} @@ -143,7 +142,7 @@ export function SmartFolderWorkbenchView({ data }: SmartFolderWorkbenchViewProps const newRuns: SmartFolderRunEntry[] = [...recentRuns]; for (const resultFile of resultFiles) { const outputId = `output-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`; - await folderStorage.storeOutputFile(folderId, outputId, resultFile, resultFile.name); + await folderStorage.storeOutputFile(folderId!, outputId, resultFile, resultFile.name); newRuns.push({ inputFileId, displayFileId: outputId, status: 'processed' }); } @@ -175,7 +174,7 @@ export function SmartFolderWorkbenchView({ data }: SmartFolderWorkbenchViewProps const inputFileId = `input-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`; const originalFileId = sourceFileId ?? (file as any).fileId as string | undefined; await addFile(inputFileId, { status: 'pending', inputFileId, name: file.name, ...(originalFileId ? { originalFileId } : {}) }); - await folderStorage.storeInputFile(folderId, inputFileId, file, file.name); + await folderStorage.storeInputFile(folderId!, inputFileId, file, file.name); runAutomation(file, inputFileId); } }, diff --git a/frontend/src/core/components/smartFolders/WatchFolderFileList.tsx b/frontend/src/core/components/smartFolders/WatchFolderFileList.tsx index 60edd3b09c..14533b59f8 100644 --- a/frontend/src/core/components/smartFolders/WatchFolderFileList.tsx +++ b/frontend/src/core/components/smartFolders/WatchFolderFileList.tsx @@ -113,11 +113,6 @@ function FileRow({ .map(id => folders.find(f => f.id === id)) .filter(Boolean) as typeof folders; - // Accent colour from first membership for the left border - const accentColor = memberFolderIds.length > 0 - ? folders.find(f => f.id === memberFolderIds[0])?.accentColor - : undefined; - const hasTags = isInCurrentFolder || otherFolders.length > 0; const hasBottomRow = !!file.size || hasTags; diff --git a/frontend/src/core/components/tools/ToolPanel.tsx b/frontend/src/core/components/tools/ToolPanel.tsx index ee60389745..a37fefc346 100644 --- a/frontend/src/core/components/tools/ToolPanel.tsx +++ b/frontend/src/core/components/tools/ToolPanel.tsx @@ -18,7 +18,6 @@ import { useToolPanelGeometry } from '@app/hooks/tools/useToolPanelGeometry'; import { useRightRail } from '@app/contexts/RightRailContext'; import { Tooltip } from '@app/components/shared/Tooltip'; import '@app/components/tools/ToolPanel.css'; -import { SmartFolderSection } from '@app/components/smartFolders/SmartFolderSection'; import { SmartFolderSidebarPanel } from '@app/components/smartFolders/SmartFolderSidebarPanel'; import { useSmartFolderSidebar } from '@app/hooks/useSmartFolderSidebar'; @@ -173,48 +172,43 @@ export default function ToolPanel() { ) : ( - <> -
- {searchQuery.trim().length > 0 ? ( -
- handleToolSelect(id as ToolId)} - searchQuery={searchQuery} - /> +
+ {searchQuery.trim().length > 0 ? ( +
+ handleToolSelect(id as ToolId)} + searchQuery={searchQuery} + /> +
+ ) : leftPanelView === 'toolPicker' ? ( +
+ handleToolSelect(id as ToolId)} + filteredTools={filteredTools} + isSearching={Boolean(searchQuery && searchQuery.trim().length > 0)} + /> +
+ ) : ( +
+
+ + {selectedToolKey ? ( + + ) : ( +
+ {t('toolPanel.placeholder', 'Choose a tool to get started')} +
+ )} +
- ) : leftPanelView === 'toolPicker' ? ( -
- handleToolSelect(id as ToolId)} - filteredTools={filteredTools} - isSearching={Boolean(searchQuery && searchQuery.trim().length > 0)} - /> -
- ) : ( -
-
- - {selectedToolKey ? ( - - ) : ( -
- {t('toolPanel.placeholder', 'Choose a tool to get started')} -
- )} -
-
-
- )} -
-
- -
- +
+ )} +
)}