lint and tsc

This commit is contained in:
Reece
2026-03-12 12:55:48 +00:00
parent 1becfbe8de
commit 539e6d77a0
5 changed files with 43 additions and 56 deletions
@@ -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) {
@@ -10,7 +10,6 @@ import {
ColorSwatch,
SimpleGrid,
Text,
Box,
} from '@mantine/core';
import { useTranslation } from 'react-i18next';
import { SmartFolder } from '@app/types/smartFolders';
@@ -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<OutputFileRecord[]>([]);
@@ -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);
}
},
@@ -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;
@@ -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() {
<SmartFolderSidebarPanel />
</div>
) : (
<>
<div style={{ flex: 1, minHeight: 0, overflow: 'hidden', display: 'flex', flexDirection: 'column' }}>
{searchQuery.trim().length > 0 ? (
<div className="flex-1 flex flex-col overflow-y-auto">
<SearchResults
filteredTools={filteredTools}
onSelect={(id) => handleToolSelect(id as ToolId)}
searchQuery={searchQuery}
/>
<div style={{ flex: 1, minHeight: 0, overflow: 'hidden', display: 'flex', flexDirection: 'column' }}>
{searchQuery.trim().length > 0 ? (
<div className="flex-1 flex flex-col overflow-y-auto">
<SearchResults
filteredTools={filteredTools}
onSelect={(id) => handleToolSelect(id as ToolId)}
searchQuery={searchQuery}
/>
</div>
) : leftPanelView === 'toolPicker' ? (
<div className="flex-1 flex flex-col overflow-auto">
<ToolPicker
selectedToolKey={selectedToolKey}
onSelect={(id) => handleToolSelect(id as ToolId)}
filteredTools={filteredTools}
isSearching={Boolean(searchQuery && searchQuery.trim().length > 0)}
/>
</div>
) : (
<div className="flex-1 flex flex-col overflow-hidden">
<div className="flex-1 min-h-0 overflow-hidden">
<ScrollArea h="100%">
{selectedToolKey ? (
<ToolRenderer
selectedToolKey={selectedToolKey}
onPreviewFile={setPreviewFile}
/>
) : (
<div className="tool-panel__placeholder">
{t('toolPanel.placeholder', 'Choose a tool to get started')}
</div>
)}
</ScrollArea>
</div>
) : leftPanelView === 'toolPicker' ? (
<div className="flex-1 flex flex-col overflow-auto">
<ToolPicker
selectedToolKey={selectedToolKey}
onSelect={(id) => handleToolSelect(id as ToolId)}
filteredTools={filteredTools}
isSearching={Boolean(searchQuery && searchQuery.trim().length > 0)}
/>
</div>
) : (
<div className="flex-1 flex flex-col overflow-hidden">
<div className="flex-1 min-h-0 overflow-hidden">
<ScrollArea h="100%">
{selectedToolKey ? (
<ToolRenderer
selectedToolKey={selectedToolKey}
onPreviewFile={setPreviewFile}
/>
) : (
<div className="tool-panel__placeholder">
{t('toolPanel.placeholder', 'Choose a tool to get started')}
</div>
)}
</ScrollArea>
</div>
</div>
)}
</div>
<div style={{ flex: '0 0 50%', minHeight: 0, overflow: 'hidden', display: 'flex', flexDirection: 'column' }}>
<SmartFolderSection />
</div>
</>
</div>
)}
</div>
)}
</div>
</div>