Skip to content

A modern platform for visual, flexible, and extensible graph-based investigations. For cybersecurity analysts and investigators.

style(frontend): apply prettier formatting workspace-wide

dextmorgn501ebee93281
diff --git a/flowsint-app/components.json b/flowsint-app/components.json
index cc9c9808..7ce20549 100644
--- a/flowsint-app/components.json
+++ b/flowsint-app/components.json
@@ -1,21 +1,21 @@
{
- "$schema": "https://ui.shadcn.com/schema.json",
- "style": "new-york",
- "rsc": false,
- "tsx": true,
- "tailwind": {
- "config": "",
- "css": "src/renderer/src/styles.css",
- "baseColor": "neutral",
- "cssVariables": true,
- "prefix": ""
- },
- "aliases": {
- "components": "@/components",
- "utils": "@/lib/utils",
- "ui": "@/components/ui",
- "lib": "@/lib",
- "hooks": "@/hooks"
- },
- "iconLibrary": "lucide"
- }
\ No newline at end of file
+ "$schema": "https://ui.shadcn.com/schema.json",
+ "style": "new-york",
+ "rsc": false,
+ "tsx": true,
+ "tailwind": {
+ "config": "",
+ "css": "src/renderer/src/styles.css",
+ "baseColor": "neutral",
+ "cssVariables": true,
+ "prefix": ""
+ },
+ "aliases": {
+ "components": "@/components",
+ "utils": "@/lib/utils",
+ "ui": "@/components/ui",
+ "lib": "@/lib",
+ "hooks": "@/hooks"
+ },
+ "iconLibrary": "lucide"
+}
diff --git a/flowsint-app/src/api/README-query-keys.md b/flowsint-app/src/api/README-query-keys.md
index bb8bc744..904ab928 100644
--- a/flowsint-app/src/api/README-query-keys.md
+++ b/flowsint-app/src/api/README-query-keys.md
@@ -5,6 +5,7 @@ This project now uses the [@lukemorales/query-key-factory](https://tanstack.com/
## Overview
Query Key Factory provides:
+
- **Type-safe query keys** with auto-completion
- **Centralized key management** - all keys in one place
- **Easy invalidation** - no more hardcoded key strings
@@ -31,13 +32,13 @@ import { investigationService } from '@/api/investigation-service'
// Before (hardcoded keys)
const { data } = useQuery({
queryKey: ['investigations', 'list'],
- queryFn: investigationService.get,
+ queryFn: investigationService.get
})
// After (using query key factory)
const { data } = useQuery({
queryKey: queryKeys.investigations.list,
- queryFn: investigationService.get,
+ queryFn: investigationService.get
})
```
@@ -47,13 +48,13 @@ const { data } = useQuery({
// Before
const { data } = useQuery({
queryKey: ['investigations', investigationId],
- queryFn: () => investigationService.getById(investigationId),
+ queryFn: () => investigationService.getById(investigationId)
})
// After
const { data } = useQuery({
queryKey: queryKeys.investigations.detail(investigationId),
- queryFn: () => investigationService.getById(investigationId),
+ queryFn: () => investigationService.getById(investigationId)
})
```
@@ -66,17 +67,17 @@ const createAnalysisMutation = useMutation({
mutationFn: analysisService.create,
onSuccess: (data, variables) => {
const queryClient = useQueryClient()
-
+
// Invalidate specific queries
queryClient.invalidateQueries({
queryKey: queryKeys.investigations.analyses(variables.investigation_id)
})
-
+
// Invalidate general lists
queryClient.invalidateQueries({
queryKey: queryKeys.analyses.list
})
- },
+ }
})
```
@@ -87,28 +88,27 @@ const updateAnalysisMutation = useMutation({
mutationFn: analysisService.update,
onSuccess: (data, variables) => {
const queryClient = useQueryClient()
-
+
// Update cache directly for better UX
- queryClient.setQueryData(
- queryKeys.analyses.detail(variables.analysisId),
- data
- )
-
+ queryClient.setQueryData(queryKeys.analyses.detail(variables.analysisId), data)
+
// Invalidate related queries
queryClient.invalidateQueries({
queryKey: queryKeys.analyses.byInvestigation(data.investigation_id)
})
- },
+ }
})
```
## Available Query Keys
### Auth
+
- `queryKeys.auth.session`
- `queryKeys.auth.currentUser`
### Investigations
+
- `queryKeys.investigations.list`
- `queryKeys.investigations.detail(investigationId)`
- `queryKeys.investigations.sketches(investigationId)`
@@ -116,6 +116,7 @@ const updateAnalysisMutation = useMutation({
- `queryKeys.investigations.flows(investigationId)`
### Sketches/Graphs
+
- `queryKeys.sketches.list`
- `queryKeys.sketches.detail(sketchId)`
- `queryKeys.sketches.byInvestigation(investigationId)`
@@ -123,36 +124,44 @@ const updateAnalysisMutation = useMutation({
- `queryKeys.sketches.types`
### Analyses
+
- `queryKeys.analyses.list`
- `queryKeys.analyses.detail(analysisId)`
- `queryKeys.analyses.byInvestigation(investigationId)`
### Flows
+
- `queryKeys.flows.list`
- `queryKeys.flows.detail(flowId)`
- `queryKeys.flows.byInvestigation(investigationId)`
### Chats
+
- `queryKeys.chats.list`
- `queryKeys.chats.detail(chatId)`
- `queryKeys.chats.byInvestigation(investigationId)`
- `queryKeys.chats.messages(chatId)`
### API Keys
+
- `queryKeys.keys.list`
- `queryKeys.keys.detail(keyId)`
### Logs/Events
+
- `queryKeys.logs.bySketch(sketchId)`
### Action Items
+
- `queryKeys.actionItems`
### Scans
+
- `queryKeys.scans.list`
- `queryKeys.scans.detail(scanId)`
### Enrichers
+
- `queryKeys.enrichers.list`
- `queryKeys.enrichers.detail(enricherId)`
@@ -227,6 +236,7 @@ queryClient.setQueryData(queryKeys.analyses.detail(analysisId), data)
## Examples
See `query-keys-examples.ts` for comprehensive usage examples including:
+
- Basic queries
- Mutations with invalidation
- Cache updates
diff --git a/flowsint-app/src/api/chat-transport.ts b/flowsint-app/src/api/chat-transport.ts
index 8152a844..a3b7b4a8 100644
--- a/flowsint-app/src/api/chat-transport.ts
+++ b/flowsint-app/src/api/chat-transport.ts
@@ -13,15 +13,16 @@ export function createChatTransport(chatId: string) {
},
prepareSendMessagesRequest: ({ messages, body }) => {
const lastUserMessage = [...messages].reverse().find((m) => m.role === 'user')
- const prompt = lastUserMessage?.parts
- ?.filter((p): p is { type: 'text'; text: string } => p.type === 'text')
- .map((p) => p.text)
- .join('') ?? ''
+ const prompt =
+ lastUserMessage?.parts
+ ?.filter((p): p is { type: 'text'; text: string } => p.type === 'text')
+ .map((p) => p.text)
+ .join('') ?? ''
const context = (body as Record<string, unknown> | undefined)?.context
return {
- body: { prompt, ...(context ? { context } : {}) },
+ body: { prompt, ...(context ? { context } : {}) }
}
- },
+ }
})
}
diff --git a/flowsint-app/src/api/investigation-service.ts b/flowsint-app/src/api/investigation-service.ts
index 3fdb1ef7..0e68f91f 100644
--- a/flowsint-app/src/api/investigation-service.ts
+++ b/flowsint-app/src/api/investigation-service.ts
@@ -29,13 +29,20 @@ export const investigationService = {
method: 'GET'
})
},
- addCollaborator: async (investigationId: string, body: { email: string; role: string }): Promise<any> => {
+ addCollaborator: async (
+ investigationId: string,
+ body: { email: string; role: string }
+ ): Promise<any> => {
return fetchWithAuth(`/api/investigations/${investigationId}/collaborators`, {
method: 'POST',
body: JSON.stringify(body)
})
},
- updateCollaboratorRole: async (investigationId: string, userId: string, body: { role: string }): Promise<any> => {
+ updateCollaboratorRole: async (
+ investigationId: string,
+ userId: string,
+ body: { role: string }
+ ): Promise<any> => {
return fetchWithAuth(`/api/investigations/${investigationId}/collaborators/${userId}`, {
method: 'PUT',
body: JSON.stringify(body)
diff --git a/flowsint-app/src/api/query-keys.ts b/flowsint-app/src/api/query-keys.ts
index 61ed36b3..510707cd 100644
--- a/flowsint-app/src/api/query-keys.ts
+++ b/flowsint-app/src/api/query-keys.ts
@@ -13,7 +13,11 @@ export const queryKeys = {
sketches: (investigationId: string) => [investigationId, 'sketches'],
analyses: (investigationId: string) => [investigationId, 'analyses'],
flows: (investigationId: string) => [investigationId, 'flows'],
- collaborators: (investigationId: string) => ['investigations', investigationId, 'collaborators'],
+ collaborators: (investigationId: string) => [
+ 'investigations',
+ investigationId,
+ 'collaborators'
+ ],
dashboard: ['investigations', 'dashboard'],
selector: (investigationId: string) => ['dashboard', 'selector', investigationId]
},
diff --git a/flowsint-app/src/api/sse.test.ts b/flowsint-app/src/api/sse.test.ts
index 485c4167..43e98098 100644
--- a/flowsint-app/src/api/sse.test.ts
+++ b/flowsint-app/src/api/sse.test.ts
@@ -8,11 +8,11 @@ const fetchEventSourceMock = vi.fn((url: string, opts: any) => {
})
vi.mock('@microsoft/fetch-event-source', () => ({
- fetchEventSource: (url: string, opts: any) => fetchEventSourceMock(url, opts),
+ fetchEventSource: (url: string, opts: any) => fetchEventSourceMock(url, opts)
}))
vi.mock('@/stores/auth-store', () => ({
- useAuthStore: { getState: () => ({ token: 'tok123' }) },
+ useAuthStore: { getState: () => ({ token: 'tok123' }) }
}))
import { connectSSE } from './sse'
@@ -20,7 +20,7 @@ import { connectSSE } from './sse'
const lastOpts = () => calls[calls.length - 1].opts
const fakeResponse = (status: number, contentType: string) =>
- ({ ok: status >= 200 && status < 300, status, headers: { get: () => contentType } } as any)
+ ({ ok: status >= 200 && status < 300, status, headers: { get: () => contentType } }) as any
beforeEach(() => {
calls.length = 0
@@ -66,9 +66,7 @@ describe('connectSSE', () => {
it('accepts a valid event-stream open', async () => {
connectSSE({ url: 'http://x', onMessage: () => {} })
- await expect(
- lastOpts().onopen(fakeResponse(200, 'text/event-stream'))
- ).resolves.toBeUndefined()
+ await expect(lastOpts().onopen(fakeResponse(200, 'text/event-stream'))).resolves.toBeUndefined()
})
it('returns increasing backoff for transient errors', () => {
diff --git a/flowsint-app/src/api/sse.ts b/flowsint-app/src/api/sse.ts
index ad555be9..e384866b 100644
--- a/flowsint-app/src/api/sse.ts
+++ b/flowsint-app/src/api/sse.ts
@@ -27,9 +27,7 @@ export function connectSSE(opts: {
let retry = 0
const token = useAuthStore.getState().token
- const headers: Record<string, string> = token
- ? { Authorization: `Bearer ${token}` }
- : {}
+ const headers: Record<string, string> = token ? { Authorization: `Bearer ${token}` } : {}
fetchEventSource(opts.url, {
signal: controller.signal,
@@ -63,7 +61,7 @@ export function connectSSE(opts: {
// transient failure: retry silently with exponential backoff (onError is not called)
retry += 1
return Math.min(1000 * 2 ** retry, MAX_BACKOFF_MS)
- },
+ }
}).catch((err) => {
if (!(err instanceof FatalSSEError)) opts.onError?.(err)
})
diff --git a/flowsint-app/src/components/analyses/README.md b/flowsint-app/src/components/analyses/README.md
index 6a4dda01..5409b310 100644
--- a/flowsint-app/src/components/analyses/README.md
+++ b/flowsint-app/src/components/analyses/README.md
@@ -5,9 +5,11 @@ This directory contains the refactored analysis components that provide reusable
## Components
### `AnalysisEditor` (Core Component)
+
The main reusable component that contains all analysis editing logic.
**Props:**
+
- `analysis: Analysis | null` - The current analysis to edit
- `investigationId: string` - The investigation ID
- `onAnalysisUpdate?: (analysis: Analysis) => void` - Callback when analysis is updated
@@ -25,6 +27,7 @@ The main reusable component that contains all analysis editing logic.
- `currentAnalysisId?: string | null` - Current analysis ID for selector
**Features:**
+
- Rich text editing with TipTap
- AI prompt integration with context
- Save/delete/create operations
@@ -36,18 +39,22 @@ The main reusable component that contains all analysis editing logic.
- Context-aware AI prompts
### `AnalysisPanel` (Panel Component)
+
A panel component that uses `AnalysisEditor` with analysis selection functionality.
**Features:**
+
- Analysis selector dropdown
- Integration with analysis panel store
- Navigation to full-page view
- All original action buttons (Save, AI Chat, New analysis, Delete, Open in Page)
### `AnalysisPage` (Full Page Component)
+
A full-page component that uses `AnalysisEditor` for dedicated analysis editing.
**Features:**
+
- Full-page layout
- Navigation controls
- All editing functionality
@@ -95,19 +102,19 @@ import { AnalysisEditor } from "@/components/analyses/analysis-editor"
### Using AnalysisPanel in a layout:
```tsx
-import AnalysisPanel from "@/components/analyses/notes-panel"
+import AnalysisPanel from '@/components/analyses/notes-panel'
// In a layout component
-<AnalysisPanel />
+;<AnalysisPanel />
```
### Using AnalysisPage in a route:
```tsx
-import { AnalysisPage } from "@/components/analyses/analysis-page"
+import { AnalysisPage } from '@/components/analyses/analysis-page'
// In a route component
-<AnalysisPage />
+;<AnalysisPage />
```
## Action Buttons
@@ -132,10 +139,11 @@ The `AnalysisEditor` includes all the original action buttons:
## Migration Notes
The existing `AnalysisPanel` has been refactored to use the new `AnalysisEditor` component. All original functionality including:
+
- Analysis selector dropdown
- All action buttons (Save, AI Chat, New analysis, Delete, Open in Page)
- Navigation controls
- AI prompt integration
- Keyboard shortcuts
-Everything works exactly as before, but the code is now more modular and reusable.
\ No newline at end of file
+Everything works exactly as before, but the code is now more modular and reusable.
diff --git a/flowsint-app/src/components/analyses/analyses-list.tsx b/flowsint-app/src/components/analyses/analyses-list.tsx
index 164baff8..bf6b5f6b 100644
--- a/flowsint-app/src/components/analyses/analyses-list.tsx
+++ b/flowsint-app/src/components/analyses/analyses-list.tsx
@@ -63,7 +63,6 @@ const AnalysisList = () => {
queryFn: () => analysisService.getByInvestigationId(investigationId || ''),
enabled: !!investigationId
})
-
const [searchQuery, setSearchQuery] = useState('')
diff --git a/flowsint-app/src/components/analyses/default_content.json b/flowsint-app/src/components/analyses/default_content.json
index 89501d1f..456f3c4b 100644
--- a/flowsint-app/src/components/analyses/default_content.json
+++ b/flowsint-app/src/components/analyses/default_content.json
@@ -1,235 +1,235 @@
{
- "type": "doc",
- "content": [
+ "type": "doc",
+ "content": [
+ {
+ "type": "heading",
+ "attrs": {
+ "level": 2
+ },
+ "content": [
{
- "type": "heading",
- "attrs": {
- "level": 2
- },
- "content": [
- {
- "type": "text",
- "text": "Title of your investigation"
- }
- ]
- },
+ "type": "text",
+ "text": "Title of your investigation"
+ }
+ ]
+ },
+ {
+ "type": "paragraph",
+ "content": [
{
- "type": "paragraph",
- "content": [
- {
- "type": "text",
- "text": "Include a clear title, your organization’s name, and the date."
- }
- ]
- },
+ "type": "text",
+ "text": "Include a clear title, your organization’s name, and the date."
+ }
+ ]
+ },
+ {
+ "type": "heading",
+ "attrs": {
+ "level": 3
+ },
+ "content": [
{
- "type": "heading",
- "attrs": {
- "level": 3
+ "type": "text",
+ "marks": [
+ {
+ "type": "textStyle",
+ "attrs": {
+ "color": ""
+ }
},
- "content": [
- {
- "type": "text",
- "marks": [
- {
- "type": "textStyle",
- "attrs": {
- "color": ""
- }
- },
- {
- "type": "bold"
- }
- ],
- "text": "Executive Summary"
- }
- ]
- },
+ {
+ "type": "bold"
+ }
+ ],
+ "text": "Executive Summary"
+ }
+ ]
+ },
+ {
+ "type": "paragraph",
+ "content": [
{
- "type": "paragraph",
- "content": [
- {
- "type": "text",
- "text": "A snapshot of key findings and recommendations."
- }
- ]
- },
+ "type": "text",
+ "text": "A snapshot of key findings and recommendations."
+ }
+ ]
+ },
+ {
+ "type": "heading",
+ "attrs": {
+ "level": 3
+ },
+ "content": [
{
- "type": "heading",
- "attrs": {
- "level": 3
+ "type": "text",
+ "marks": [
+ {
+ "type": "textStyle",
+ "attrs": {
+ "color": ""
+ }
},
- "content": [
- {
- "type": "text",
- "marks": [
- {
- "type": "textStyle",
- "attrs": {
- "color": ""
- }
- },
- {
- "type": "bold"
- }
- ],
- "text": "Introduction"
- }
- ]
- },
+ {
+ "type": "bold"
+ }
+ ],
+ "text": "Introduction"
+ }
+ ]
+ },
+ {
+ "type": "paragraph",
+ "content": [
{
- "type": "paragraph",
- "content": [
- {
- "type": "text",
- "text": "Define the scope and objectives."
- }
- ]
- },
+ "type": "text",
+ "text": "Define the scope and objectives."
+ }
+ ]
+ },
+ {
+ "type": "heading",
+ "attrs": {
+ "level": 4
+ },
+ "content": [
{
- "type": "heading",
- "attrs": {
- "level": 4
+ "type": "text",
+ "marks": [
+ {
+ "type": "textStyle",
+ "attrs": {
+ "color": ""
+ }
},
- "content": [
- {
- "type": "text",
- "marks": [
- {
- "type": "textStyle",
- "attrs": {
- "color": ""
- }
- },
- {
- "type": "bold"
- }
- ],
- "text": "Main Body"
- }
- ]
- },
+ {
+ "type": "bold"
+ }
+ ],
+ "text": "Main Body"
+ }
+ ]
+ },
+ {
+ "type": "paragraph",
+ "content": [
{
- "type": "paragraph",
- "content": [
- {
- "type": "text",
- "marks": [
- {
- "type": "textStyle",
- "attrs": {
- "color": ""
- }
- }
- ],
- "text": "Dive into the findings, broken into logical sections."
- }
- ]
- },
+ "type": "text",
+ "marks": [
+ {
+ "type": "textStyle",
+ "attrs": {
+ "color": ""
+ }
+ }
+ ],
+ "text": "Dive into the findings, broken into logical sections."
+ }
+ ]
+ },
+ {
+ "type": "heading",
+ "attrs": {
+ "level": 4
+ },
+ "content": [
{
- "type": "heading",
- "attrs": {
- "level": 4
+ "type": "text",
+ "marks": [
+ {
+ "type": "textStyle",
+ "attrs": {
+ "color": ""
+ }
},
- "content": [
- {
- "type": "text",
- "marks": [
- {
- "type": "textStyle",
- "attrs": {
- "color": ""
- }
- },
- {
- "type": "bold"
- }
- ],
- "text": "Analysis"
- }
- ]
- },
+ {
+ "type": "bold"
+ }
+ ],
+ "text": "Analysis"
+ }
+ ]
+ },
+ {
+ "type": "paragraph",
+ "content": [
{
- "type": "paragraph",
- "content": [
- {
- "type": "text",
- "text": "Highlight patterns, anomalies, and actionable insights."
- }
- ]
- },
+ "type": "text",
+ "text": "Highlight patterns, anomalies, and actionable insights."
+ }
+ ]
+ },
+ {
+ "type": "paragraph",
+ "content": [
{
- "type": "paragraph",
- "content": [
- {
- "type": "text",
- "marks": [
- {
- "type": "textStyle",
- "attrs": {
- "color": ""
- }
- },
- {
- "type": "bold"
- }
- ],
- "text": "Conclusion and Recommendations"
- }
- ]
- },
+ "type": "text",
+ "marks": [
+ {
+ "type": "textStyle",
+ "attrs": {
+ "color": ""
+ }
+ },
+ {
+ "type": "bold"
+ }
+ ],
+ "text": "Conclusion and Recommendations"
+ }
+ ]
+ },
+ {
+ "type": "paragraph",
+ "content": [
{
- "type": "paragraph",
- "content": [
- {
- "type": "text",
- "text": "Wrap up with a clear summary and next steps."
- }
- ]
- },
+ "type": "text",
+ "text": "Wrap up with a clear summary and next steps."
+ }
+ ]
+ },
+ {
+ "type": "heading",
+ "attrs": {
+ "level": 4
+ },
+ "content": [
{
- "type": "heading",
- "attrs": {
- "level": 4
+ "type": "text",
+ "marks": [
+ {
+ "type": "textStyle",
+ "attrs": {
+ "color": ""
+ }
},
- "content": [
- {
- "type": "text",
- "marks": [
- {
- "type": "textStyle",
- "attrs": {
- "color": ""
- }
- },
- {
- "type": "bold"
- }
- ],
- "text": "Appendices"
- }
- ]
+ {
+ "type": "bold"
+ }
+ ],
+ "text": "Appendices"
+ }
+ ]
+ },
+ {
+ "type": "paragraph",
+ "content": [
+ {
+ "type": "text",
+ "marks": [
+ {
+ "type": "textStyle",
+ "attrs": {
+ "color": ""
+ }
+ }
+ ],
+ "text": "Include raw data or supporting documents if "
},
{
- "type": "paragraph",
- "content": [
- {
- "type": "text",
- "marks": [
- {
- "type": "textStyle",
- "attrs": {
- "color": ""
- }
- }
- ],
- "text": "Include raw data or supporting documents if "
- },
- {
- "type": "text",
- "text": "needed."
- }
- ]
+ "type": "text",
+ "text": "needed."
}
- ]
-}
\ No newline at end of file
+ ]
+ }
+ ]
+}
diff --git a/flowsint-app/src/components/analyses/editor/components/bubble-menu/text-bubble-menu.tsx b/flowsint-app/src/components/analyses/editor/components/bubble-menu/text-bubble-menu.tsx
index 25a0375a..bcef0c6b 100644
--- a/flowsint-app/src/components/analyses/editor/components/bubble-menu/text-bubble-menu.tsx
+++ b/flowsint-app/src/components/analyses/editor/components/bubble-menu/text-bubble-menu.tsx
@@ -30,7 +30,7 @@ const BubbleButton = ({
active,
onClick,
disabled,
- children,
+ children
}: {
active?: boolean
onClick: () => void
diff --git a/flowsint-app/src/components/analyses/editor/extensions/drag-handle/drag-handle.ts b/flowsint-app/src/components/analyses/editor/extensions/drag-handle/drag-handle.ts
index 3641302f..9ea94070 100644
--- a/flowsint-app/src/components/analyses/editor/extensions/drag-handle/drag-handle.ts
+++ b/flowsint-app/src/components/analyses/editor/extensions/drag-handle/drag-handle.ts
@@ -1,242 +1,224 @@
-import { Extension } from "@tiptap/core";
-import { Plugin, PluginKey } from "@tiptap/pm/state";
+import { Extension } from '@tiptap/core'
+import { Plugin, PluginKey } from '@tiptap/pm/state'
-const dragHandleKey = new PluginKey("dragHandle");
+const dragHandleKey = new PluginKey('dragHandle')
-function findBlockAt(
- view: any,
- y: number,
-): { pos: number; dom: HTMLElement } | null {
- const editorRect = view.dom.getBoundingClientRect();
- const paddingLeft = parseFloat(getComputedStyle(view.dom).paddingLeft) || 0;
- const coords = { left: editorRect.left + paddingLeft + 1, top: y };
- const posInfo = view.posAtCoords(coords);
- if (!posInfo) return null;
+function findBlockAt(view: any, y: number): { pos: number; dom: HTMLElement } | null {
+ const editorRect = view.dom.getBoundingClientRect()
+ const paddingLeft = parseFloat(getComputedStyle(view.dom).paddingLeft) || 0
+ const coords = { left: editorRect.left + paddingLeft + 1, top: y }
+ const posInfo = view.posAtCoords(coords)
+ if (!posInfo) return null
- const $pos = view.state.doc.resolve(posInfo.pos);
+ const $pos = view.state.doc.resolve(posInfo.pos)
- const wrapperTypes = new Set([
- "bulletList", "orderedList", "taskList",
- ]);
+ const wrapperTypes = new Set(['bulletList', 'orderedList', 'taskList'])
for (let d = $pos.depth; d >= 1; d--) {
- const node = $pos.node(d);
- if (!node.isBlock) continue;
- if (d === 1 && $pos.before(1) === 0) continue;
- if (wrapperTypes.has(node.type.name)) continue;
+ const node = $pos.node(d)
+ if (!node.isBlock) continue
+ if (d === 1 && $pos.before(1) === 0) continue
+ if (wrapperTypes.has(node.type.name)) continue
if (node.isTextblock && d > 1) {
- const parent = $pos.node(d - 1);
- if (parent.type.name === "listItem" || parent.type.name === "taskItem") {
- continue;
+ const parent = $pos.node(d - 1)
+ if (parent.type.name === 'listItem' || parent.type.name === 'taskItem') {
+ continue
}
}
- const pos = $pos.before(d);
- const dom = view.nodeDOM(pos);
+ const pos = $pos.before(d)
+ const dom = view.nodeDOM(pos)
if (dom instanceof HTMLElement) {
- return { pos, dom };
+ return { pos, dom }
}
}
- return null;
+ return null
}
export const DragHandle = Extension.create({
- name: "dragHandle",
+ name: 'dragHandle',
addProseMirrorPlugins() {
- const handle = document.createElement("div");
- handle.className = "flowsint-drag-handle";
- handle.innerHTML = `<svg width="14" height="14" viewBox="0 0 14 14" fill="currentColor"><circle cx="4" cy="2" r="1.5"/><circle cx="10" cy="2" r="1.5"/><circle cx="4" cy="7" r="1.5"/><circle cx="10" cy="7" r="1.5"/><circle cx="4" cy="12" r="1.5"/><circle cx="10" cy="12" r="1.5"/></svg>`;
+ const handle = document.createElement('div')
+ handle.className = 'flowsint-drag-handle'
+ handle.innerHTML = `<svg width="14" height="14" viewBox="0 0 14 14" fill="currentColor"><circle cx="4" cy="2" r="1.5"/><circle cx="10" cy="2" r="1.5"/><circle cx="4" cy="7" r="1.5"/><circle cx="10" cy="7" r="1.5"/><circle cx="4" cy="12" r="1.5"/><circle cx="10" cy="12" r="1.5"/></svg>`
- const indicator = document.createElement("div");
- indicator.className = "flowsint-drop-indicator";
+ const indicator = document.createElement('div')
+ indicator.className = 'flowsint-drop-indicator'
- let currentBlockPos: number | null = null;
- let dragging: { pos: number; ghost: HTMLElement } | null = null;
- let hideTimeout: ReturnType<typeof setTimeout> | null = null;
+ let currentBlockPos: number | null = null
+ let dragging: { pos: number; ghost: HTMLElement } | null = null
+ let hideTimeout: ReturnType<typeof setTimeout> | null = null
return [
new Plugin({
key: dragHandleKey,
view(view) {
- const wrapper = view.dom.parentElement!;
- wrapper.style.position = "relative";
- wrapper.appendChild(handle);
- wrapper.appendChild(indicator);
+ const wrapper = view.dom.parentElement!
+ wrapper.style.position = 'relative'
+ wrapper.appendChild(handle)
+ wrapper.appendChild(indicator)
const positionHandle = (blockDom: HTMLElement, pos: number) => {
- if (hideTimeout) clearTimeout(hideTimeout);
- currentBlockPos = pos;
+ if (hideTimeout) clearTimeout(hideTimeout)
+ currentBlockPos = pos
- const wr = wrapper.getBoundingClientRect();
- const br = blockDom.getBoundingClientRect();
+ const wr = wrapper.getBoundingClientRect()
+ const br = blockDom.getBoundingClientRect()
- handle.style.top = `${br.top - wr.top}px`;
- handle.style.left = `${br.left - wr.left - 24}px`;
- handle.style.height = `${br.height}px`;
- handle.style.display = "flex";
- };
+ handle.style.top = `${br.top - wr.top}px`
+ handle.style.left = `${br.left - wr.left - 24}px`
+ handle.style.height = `${br.height}px`
+ handle.style.display = 'flex'
+ }
const hideAll = () => {
- handle.style.display = "none";
- indicator.style.display = "none";
- currentBlockPos = null;
- };
+ handle.style.display = 'none'
+ indicator.style.display = 'none'
+ currentBlockPos = null
+ }
const scheduleHide = () => {
- if (hideTimeout) clearTimeout(hideTimeout);
- hideTimeout = setTimeout(hideAll, 150);
- };
+ if (hideTimeout) clearTimeout(hideTimeout)
+ hideTimeout = setTimeout(hideAll, 150)
+ }
const cancelHide = () => {
if (hideTimeout) {
- clearTimeout(hideTimeout);
- hideTimeout = null;
+ clearTimeout(hideTimeout)
+ hideTimeout = null
}
- };
+ }
const onEditorMouseMove = (e: MouseEvent) => {
- if (dragging || e.buttons > 0) return;
- const block = findBlockAt(view, e.clientY);
+ if (dragging || e.buttons > 0) return
+ const block = findBlockAt(view, e.clientY)
if (block) {
if (block.pos !== currentBlockPos) {
- positionHandle(block.dom, block.pos);
+ positionHandle(block.dom, block.pos)
} else {
- cancelHide();
+ cancelHide()
}
} else {
- scheduleHide();
+ scheduleHide()
}
- };
+ }
const onEditorLeave = () => {
- if (!dragging) scheduleHide();
- };
- const onHandleEnter = () => cancelHide();
+ if (!dragging) scheduleHide()
+ }
+ const onHandleEnter = () => cancelHide()
const onHandleLeave = () => {
- if (!dragging) scheduleHide();
- };
+ if (!dragging) scheduleHide()
+ }
const onHandleMouseDown = (e: MouseEvent) => {
- e.preventDefault();
- if (currentBlockPos === null) return;
+ e.preventDefault()
+ if (currentBlockPos === null) return
- const pos = currentBlockPos;
- const blockDom = view.nodeDOM(pos) as HTMLElement;
- if (!blockDom) return;
+ const pos = currentBlockPos
+ const blockDom = view.nodeDOM(pos) as HTMLElement
+ if (!blockDom) return
- const ghost = blockDom.cloneNode(true) as HTMLElement;
- ghost.className = "flowsint-drag-ghost";
- ghost.style.width = `${blockDom.offsetWidth}px`;
- ghost.style.left = `${e.clientX}px`;
- ghost.style.top = `${e.clientY}px`;
- document.body.appendChild(ghost);
+ const ghost = blockDom.cloneNode(true) as HTMLElement
+ ghost.className = 'flowsint-drag-ghost'
+ ghost.style.width = `${blockDom.offsetWidth}px`
+ ghost.style.left = `${e.clientX}px`
+ ghost.style.top = `${e.clientY}px`
+ document.body.appendChild(ghost)
- blockDom.classList.add("flowsint-dragging-source");
- dragging = { pos, ghost };
- hideAll();
+ blockDom.classList.add('flowsint-dragging-source')
+ dragging = { pos, ghost }
+ hideAll()
const onMouseMove = (ev: MouseEvent) => {
- if (!dragging) return;
- dragging.ghost.style.left = `${ev.clientX}px`;
- dragging.ghost.style.top = `${ev.clientY}px`;
+ if (!dragging) return
+ dragging.ghost.style.left = `${ev.clientX}px`
+ dragging.ghost.style.top = `${ev.clientY}px`
- const block = findBlockAt(view, ev.clientY);
+ const block = findBlockAt(view, ev.clientY)
if (block) {
- const wr = wrapper.getBoundingClientRect();
- const br = block.dom.getBoundingClientRect();
- const above = ev.clientY < br.top + br.height / 2;
- indicator.style.top = `${(above ? br.top : br.bottom) - wr.top - 1}px`;
- indicator.style.left = `${br.left - wr.left}px`;
- indicator.style.width = `${br.width}px`;
- indicator.style.display = "block";
+ const wr = wrapper.getBoundingClientRect()
+ const br = block.dom.getBoundingClientRect()
+ const above = ev.clientY < br.top + br.height / 2
+ indicator.style.top = `${(above ? br.top : br.bottom) - wr.top - 1}px`
+ indicator.style.left = `${br.left - wr.left}px`
+ indicator.style.width = `${br.width}px`
+ indicator.style.display = 'block'
} else {
- indicator.style.display = "none";
+ indicator.style.display = 'none'
}
- };
+ }
const onMouseUp = (ev: MouseEvent) => {
- document.removeEventListener("mousemove", onMouseMove);
- document.removeEventListener("mouseup", onMouseUp);
+ document.removeEventListener('mousemove', onMouseMove)
+ document.removeEventListener('mouseup', onMouseUp)
- if (!dragging) return;
+ if (!dragging) return
- dragging.ghost.remove();
- blockDom.classList.remove("flowsint-dragging-source");
- indicator.style.display = "none";
+ dragging.ghost.remove()
+ blockDom.classList.remove('flowsint-dragging-source')
+ indicator.style.display = 'none'
- const originPos = dragging.pos;
- dragging = null;
+ const originPos = dragging.pos
+ dragging = null
- const originNode = view.state.doc.nodeAt(originPos);
- if (!originNode) return;
+ const originNode = view.state.doc.nodeAt(originPos)
+ if (!originNode) return
- const target = findBlockAt(view, ev.clientY);
- if (!target) return;
+ const target = findBlockAt(view, ev.clientY)
+ if (!target) return
- if (
- originPos < target.pos &&
- originPos + originNode.nodeSize > target.pos
- )
- return;
+ if (originPos < target.pos && originPos + originNode.nodeSize > target.pos) return
- const targetNode = view.state.doc.nodeAt(target.pos);
- if (!targetNode) return;
+ const targetNode = view.state.doc.nodeAt(target.pos)
+ if (!targetNode) return
- const targetRect = target.dom.getBoundingClientRect();
- const above = ev.clientY < targetRect.top + targetRect.height / 2;
- const insertPos = above
- ? target.pos
- : target.pos + targetNode.nodeSize;
+ const targetRect = target.dom.getBoundingClientRect()
+ const above = ev.clientY < targetRect.top + targetRect.height / 2
+ const insertPos = above ? target.pos : target.pos + targetNode.nodeSize
- if (
- insertPos === originPos ||
- insertPos === originPos + originNode.nodeSize
- )
- return;
+ if (insertPos === originPos || insertPos === originPos + originNode.nodeSize) return
- const tr = view.state.tr;
+ const tr = view.state.tr
if (originPos < insertPos) {
- const adjusted = insertPos - originNode.nodeSize;
- tr.delete(originPos, originPos + originNode.nodeSize);
- tr.insert(adjusted, originNode);
+ const adjusted = insertPos - originNode.nodeSize
+ tr.delete(originPos, originPos + originNode.nodeSize)
+ tr.insert(adjusted, originNode)
} else {
- tr.insert(insertPos, originNode);
- tr.delete(
- originPos + originNode.nodeSize,
- originPos + originNode.nodeSize * 2,
- );
+ tr.insert(insertPos, originNode)
+ tr.delete(originPos + originNode.nodeSize, originPos + originNode.nodeSize * 2)
}
- view.dispatch(tr);
- };
+ view.dispatch(tr)
+ }
- document.addEventListener("mousemove", onMouseMove);
- document.addEventListener("mouseup", onMouseUp);
- };
+ document.addEventListener('mousemove', onMouseMove)
+ document.addEventListener('mouseup', onMouseUp)
+ }
- view.dom.addEventListener("mousemove", onEditorMouseMove);
- view.dom.addEventListener("mouseleave", onEditorLeave);
- handle.addEventListener("mouseenter", onHandleEnter);
- handle.addEventListener("mouseleave", onHandleLeave);
- handle.addEventListener("mousedown", onHandleMouseDown);
+ view.dom.addEventListener('mousemove', onEditorMouseMove)
+ view.dom.addEventListener('mouseleave', onEditorLeave)
+ handle.addEventListener('mouseenter', onHandleEnter)
+ handle.addEventListener('mouseleave', onHandleLeave)
+ handle.addEventListener('mousedown', onHandleMouseDown)
return {
destroy() {
- if (hideTimeout) clearTimeout(hideTimeout);
- view.dom.removeEventListener("mousemove", onEditorMouseMove);
- view.dom.removeEventListener("mouseleave", onEditorLeave);
- handle.removeEventListener("mouseenter", onHandleEnter);
- handle.removeEventListener("mouseleave", onHandleLeave);
- handle.removeEventListener("mousedown", onHandleMouseDown);
- handle.remove();
- indicator.remove();
+ if (hideTimeout) clearTimeout(hideTimeout)
+ view.dom.removeEventListener('mousemove', onEditorMouseMove)
+ view.dom.removeEventListener('mouseleave', onEditorLeave)
+ handle.removeEventListener('mouseenter', onHandleEnter)
+ handle.removeEventListener('mouseleave', onHandleLeave)
+ handle.removeEventListener('mousedown', onHandleMouseDown)
+ handle.remove()
+ indicator.remove()
if (dragging) {
- dragging.ghost.remove();
- dragging = null;
+ dragging.ghost.remove()
+ dragging = null
}
- },
- };
- },
- }),
- ];
- },
-});
+ }
+ }
+ }
+ })
+ ]
+ }
+})
diff --git a/flowsint-app/src/components/analyses/editor/styles/index.css b/flowsint-app/src/components/analyses/editor/styles/index.css
index a9a4ec79..88494410 100644
--- a/flowsint-app/src/components/analyses/editor/styles/index.css
+++ b/flowsint-app/src/components/analyses/editor/styles/index.css
@@ -2,11 +2,11 @@
@tailwind components;
@tailwind utilities;
-@import "./partials/code.css";
-@import "./partials/placeholder.css";
-@import "./partials/lists.css";
-@import "./partials/typography.css";
-@import "./partials/zoom.css";
+@import './partials/code.css';
+@import './partials/placeholder.css';
+@import './partials/lists.css';
+@import './partials/typography.css';
+@import './partials/zoom.css';
:root {
--mt-overlay: rgba(251, 251, 251, 0.75);
diff --git a/flowsint-app/src/components/analyses/editor/styles/partials/zoom.css b/flowsint-app/src/components/analyses/editor/styles/partials/zoom.css
index 31d33024..e5b1fc1d 100644
--- a/flowsint-app/src/components/analyses/editor/styles/partials/zoom.css
+++ b/flowsint-app/src/components/analyses/editor/styles/partials/zoom.css
@@ -49,10 +49,10 @@
z-index: 1;
}
-[data-rmiz-content="found"] img,
-[data-rmiz-content="found"] svg,
-[data-rmiz-content="found"] [role="img"],
-[data-rmiz-content="found"] [data-zoom] {
+[data-rmiz-content='found'] img,
+[data-rmiz-content='found'] svg,
+[data-rmiz-content='found'] [role='img'],
+[data-rmiz-content='found'] [data-zoom] {
cursor: inherit;
}
@@ -81,11 +81,11 @@
transition: background-color 0.3s;
}
-[data-rmiz-modal-overlay="hidden"] {
+[data-rmiz-modal-overlay='hidden'] {
background-color: rgba(255, 255, 255, 0);
}
-[data-rmiz-modal-overlay="visible"] {
+[data-rmiz-modal-overlay='visible'] {
background-color: rgba(255, 255, 255, 1);
}
@@ -104,9 +104,8 @@
}
@media (prefers-reduced-motion: reduce) {
-
[data-rmiz-modal-overlay],
[data-rmiz-modal-img] {
transition-duration: 0.01ms !important;
}
-}
\ No newline at end of file
+}
diff --git a/flowsint-app/src/components/copy.tsx b/flowsint-app/src/components/copy.tsx
index 9088e5fa..a8941fc2 100644
--- a/flowsint-app/src/components/copy.tsx
+++ b/flowsint-app/src/components/copy.tsx
@@ -9,11 +9,17 @@ interface CopyButtonProps {
content: string
delay?: number
className?: string
- size?: "icon" | "default" | "sm" | "lg" | null | undefined
+ size?: 'icon' | 'default' | 'sm' | 'lg' | null | undefined
label?: string
}
-export function CopyButton({ content, className, label, delay = 2000, size = "icon" }: CopyButtonProps) {
+export function CopyButton({
+ content,
+ className,
+ label,
+ delay = 2000,
+ size = 'icon'
+}: CopyButtonProps) {
const [isCopied, setIsCopied] = useState(false)
const handleCopy = useCallback(
@@ -40,7 +46,7 @@ export function CopyButton({ content, className, label, delay = 2000, size = "ic
<TooltipTrigger asChild>
<Button
className={cn('h-7', className)}
- size={label ? "default" : size}
+ size={label ? 'default' : size}
variant="ghost"
onClick={handleCopy}
aria-label="Copy content"
@@ -49,7 +55,8 @@ export function CopyButton({ content, className, label, delay = 2000, size = "ic
<CheckIcon className="!h-3.5 !w-3.5 text-primary" />
) : (
<CopyIcon className="!h-3.5 !w-3.5 opacity-50" />
- )}{label && <span className='text-xs'>{label}</span>}
+ )}
+ {label && <span className="text-xs">{label}</span>}
</Button>
</TooltipTrigger>
<TooltipContent>Copied !</TooltipContent>
diff --git a/flowsint-app/src/components/dashboard/empty-states.tsx b/flowsint-app/src/components/dashboard/empty-states.tsx
index 3e37c9d2..c8f4838a 100644
--- a/flowsint-app/src/components/dashboard/empty-states.tsx
+++ b/flowsint-app/src/components/dashboard/empty-states.tsx
@@ -1,201 +1,209 @@
-import { Button } from "@/components/ui/button"
-import { Plus, Upload } from "lucide-react"
-import NewSketch from "../sketches/new-sketch"
-import NewAnalysis from "../analyses/new-analysis"
+import { Button } from '@/components/ui/button'
+import { Plus, Upload } from 'lucide-react'
+import NewSketch from '../sketches/new-sketch'
+import NewAnalysis from '../analyses/new-analysis'
interface EmptyStateProps {
- onAction?: () => void
- canCreate?: boolean
+ onAction?: () => void
+ canCreate?: boolean
}
export function EmptyInvestigations({ onAction }: EmptyStateProps) {
- return (
- <div className="flex flex-col items-center justify-center py-16 px-4">
- {/* Minimal folder illustration */}
- <div className="w-16 h-16 mb-6 text-muted-foreground/30">
- <svg viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
- <path
- d="M8 16C8 13.7909 9.79086 12 12 12H24L28 16H52C54.2091 16 56 17.7909 56 20V48C56 50.2091 54.2091 52 52 52H12C9.79086 52 8 50.2091 8 48V16Z"
- stroke="currentColor"
- strokeWidth="2"
- strokeLinecap="round"
- strokeLinejoin="round"
- />
- <path
- d="M28 32L32 36L36 32"
- stroke="currentColor"
- strokeWidth="2"
- strokeLinecap="round"
- strokeLinejoin="round"
- />
- <path d="M32 24V36" stroke="currentColor" strokeWidth="2" strokeLinecap="round" />
- </svg>
- </div>
- <h3 className="text-sm font-medium text-foreground mb-1">No investigations yet</h3>
- <p className="text-sm text-muted-foreground text-center max-w-[240px] mb-5">
- Create your first investigation to start tracking threats and entities
- </p>
- <Button onClick={onAction} size="sm" className="h-8 text-xs gap-1.5">
- <Plus className="w-3.5 h-3.5" />
- New Investigation
- </Button>
- </div>
- )
+ return (
+ <div className="flex flex-col items-center justify-center py-16 px-4">
+ {/* Minimal folder illustration */}
+ <div className="w-16 h-16 mb-6 text-muted-foreground/30">
+ <svg viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <path
+ d="M8 16C8 13.7909 9.79086 12 12 12H24L28 16H52C54.2091 16 56 17.7909 56 20V48C56 50.2091 54.2091 52 52 52H12C9.79086 52 8 50.2091 8 48V16Z"
+ stroke="currentColor"
+ strokeWidth="2"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ />
+ <path
+ d="M28 32L32 36L36 32"
+ stroke="currentColor"
+ strokeWidth="2"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ />
+ <path d="M32 24V36" stroke="currentColor" strokeWidth="2" strokeLinecap="round" />
+ </svg>
+ </div>
+ <h3 className="text-sm font-medium text-foreground mb-1">No investigations yet</h3>
+ <p className="text-sm text-muted-foreground text-center max-w-[240px] mb-5">
+ Create your first investigation to start tracking threats and entities
+ </p>
+ <Button onClick={onAction} size="sm" className="h-8 text-xs gap-1.5">
+ <Plus className="w-3.5 h-3.5" />
+ New Investigation
+ </Button>
+ </div>
+ )
}
export function EmptySketches({ onAction }: EmptyStateProps) {
- return (
- <div className="flex flex-col items-center justify-center py-12 px-4 border border-dashed border-border rounded-lg">
- {/* Minimal graph/network illustration */}
- <div className="w-14 h-14 mb-5 text-muted-foreground/30">
- <svg viewBox="0 0 56 56" fill="none" xmlns="http://www.w3.org/2000/svg">
- <circle cx="28" cy="14" r="6" stroke="currentColor" strokeWidth="2" />
- <circle cx="14" cy="42" r="6" stroke="currentColor" strokeWidth="2" />
- <circle cx="42" cy="42" r="6" stroke="currentColor" strokeWidth="2" />
- <path d="M24 19L17 36" stroke="currentColor" strokeWidth="2" strokeLinecap="round" />
- <path d="M32 19L39 36" stroke="currentColor" strokeWidth="2" strokeLinecap="round" />
- <path d="M20 42H36" stroke="currentColor" strokeWidth="2" strokeLinecap="round" />
- </svg>
- </div>
- <h3 className="text-sm font-medium text-foreground mb-1">No sketches</h3>
- <p className="text-xs text-muted-foreground text-center max-w-[200px] mb-4">
- Visualize relationships between entities, infrastructure, and actors
- </p>
- <NewSketch>
- <Button onClick={onAction} variant="ghost" size="sm" className="h-7 text-xs gap-1.5">
- <Plus className="w-3.5 h-3.5" />
- Create sketch
- </Button>
- </NewSketch>
- </div>
- )
+ return (
+ <div className="flex flex-col items-center justify-center py-12 px-4 border border-dashed border-border rounded-lg">
+ {/* Minimal graph/network illustration */}
+ <div className="w-14 h-14 mb-5 text-muted-foreground/30">
+ <svg viewBox="0 0 56 56" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <circle cx="28" cy="14" r="6" stroke="currentColor" strokeWidth="2" />
+ <circle cx="14" cy="42" r="6" stroke="currentColor" strokeWidth="2" />
+ <circle cx="42" cy="42" r="6" stroke="currentColor" strokeWidth="2" />
+ <path d="M24 19L17 36" stroke="currentColor" strokeWidth="2" strokeLinecap="round" />
+ <path d="M32 19L39 36" stroke="currentColor" strokeWidth="2" strokeLinecap="round" />
+ <path d="M20 42H36" stroke="currentColor" strokeWidth="2" strokeLinecap="round" />
+ </svg>
+ </div>
+ <h3 className="text-sm font-medium text-foreground mb-1">No sketches</h3>
+ <p className="text-xs text-muted-foreground text-center max-w-[200px] mb-4">
+ Visualize relationships between entities, infrastructure, and actors
+ </p>
+ <NewSketch>
+ <Button onClick={onAction} variant="ghost" size="sm" className="h-7 text-xs gap-1.5">
+ <Plus className="w-3.5 h-3.5" />
+ Create sketch
+ </Button>
+ </NewSketch>
+ </div>
+ )
}
export function EmptyAnalyses({ onAction, canCreate = true }: EmptyStateProps) {
- return (
- <div className="flex flex-col items-center justify-center py-10 px-4">
- {/* Minimal document illustration */}
- <div className="w-12 h-12 mb-4 text-muted-foreground/30">
- <svg viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
- <path
- d="M12 6H30L38 14V42C38 43.1046 37.1046 44 36 44H12C10.8954 44 10 43.1046 10 42V8C10 6.89543 10.8954 6 12 6Z"
- stroke="currentColor"
- strokeWidth="2"
- strokeLinecap="round"
- strokeLinejoin="round"
- />
- <path d="M30 6V14H38" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" />
- <path d="M16 24H32" stroke="currentColor" strokeWidth="2" strokeLinecap="round" />
- <path d="M16 30H28" stroke="currentColor" strokeWidth="2" strokeLinecap="round" />
- <path d="M16 36H24" stroke="currentColor" strokeWidth="2" strokeLinecap="round" />
- </svg>
- </div>
- <h3 className="text-sm font-medium text-foreground mb-1">No analyses</h3>
- <p className="text-xs text-muted-foreground text-center max-w-[200px] mb-4">
- Document findings, patterns, and conclusions from your investigation
- </p>
- {canCreate && (
- <NewAnalysis>
- <Button onClick={onAction} variant="ghost" size="sm" className="h-7 text-xs gap-1.5">
- <Plus className="w-3.5 h-3.5" />
- Write analysis
- </Button>
- </NewAnalysis>
- )}
- </div>
- )
+ return (
+ <div className="flex flex-col items-center justify-center py-10 px-4">
+ {/* Minimal document illustration */}
+ <div className="w-12 h-12 mb-4 text-muted-foreground/30">
+ <svg viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <path
+ d="M12 6H30L38 14V42C38 43.1046 37.1046 44 36 44H12C10.8954 44 10 43.1046 10 42V8C10 6.89543 10.8954 6 12 6Z"
+ stroke="currentColor"
+ strokeWidth="2"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ />
+ <path
+ d="M30 6V14H38"
+ stroke="currentColor"
+ strokeWidth="2"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ />
+ <path d="M16 24H32" stroke="currentColor" strokeWidth="2" strokeLinecap="round" />
+ <path d="M16 30H28" stroke="currentColor" strokeWidth="2" strokeLinecap="round" />
+ <path d="M16 36H24" stroke="currentColor" strokeWidth="2" strokeLinecap="round" />
+ </svg>
+ </div>
+ <h3 className="text-sm font-medium text-foreground mb-1">No analyses</h3>
+ <p className="text-xs text-muted-foreground text-center max-w-[200px] mb-4">
+ Document findings, patterns, and conclusions from your investigation
+ </p>
+ {canCreate && (
+ <NewAnalysis>
+ <Button onClick={onAction} variant="ghost" size="sm" className="h-7 text-xs gap-1.5">
+ <Plus className="w-3.5 h-3.5" />
+ Write analysis
+ </Button>
+ </NewAnalysis>
+ )}
+ </div>
+ )
}
export function EmptyEvidence({ onAction }: EmptyStateProps) {
- return (
- <div className="flex flex-col items-center justify-center py-10 px-4 border border-dashed border-border rounded-lg">
- {/* Minimal upload/file illustration */}
- <div className="w-12 h-12 mb-4 text-muted-foreground/30">
- <svg viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
- <rect x="8" y="8" width="32" height="32" rx="4" stroke="currentColor" strokeWidth="2" />
- <path d="M24 18V30" stroke="currentColor" strokeWidth="2" strokeLinecap="round" />
- <path
- d="M18 24L24 18L30 24"
- stroke="currentColor"
- strokeWidth="2"
- strokeLinecap="round"
- strokeLinejoin="round"
- />
- </svg>
- </div>
- <h3 className="text-sm font-medium text-foreground mb-1">No evidence</h3>
- <p className="text-xs text-muted-foreground text-center max-w-[180px] mb-4">
- Upload files, screenshots, or artifacts related to this case
- </p>
- <Button onClick={onAction} variant="ghost" size="sm" className="h-7 text-xs gap-1.5">
- <Upload className="w-3.5 h-3.5" />
- Upload files
- </Button>
- </div>
- )
+ return (
+ <div className="flex flex-col items-center justify-center py-10 px-4 border border-dashed border-border rounded-lg">
+ {/* Minimal upload/file illustration */}
+ <div className="w-12 h-12 mb-4 text-muted-foreground/30">
+ <svg viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <rect x="8" y="8" width="32" height="32" rx="4" stroke="currentColor" strokeWidth="2" />
+ <path d="M24 18V30" stroke="currentColor" strokeWidth="2" strokeLinecap="round" />
+ <path
+ d="M18 24L24 18L30 24"
+ stroke="currentColor"
+ strokeWidth="2"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ />
+ </svg>
+ </div>
+ <h3 className="text-sm font-medium text-foreground mb-1">No evidence</h3>
+ <p className="text-xs text-muted-foreground text-center max-w-[180px] mb-4">
+ Upload files, screenshots, or artifacts related to this case
+ </p>
+ <Button onClick={onAction} variant="ghost" size="sm" className="h-7 text-xs gap-1.5">
+ <Upload className="w-3.5 h-3.5" />
+ Upload files
+ </Button>
+ </div>
+ )
}
export function EmptyTasks({ onAction }: EmptyStateProps) {
- return (
- <div className="flex flex-col items-center justify-center py-8 px-4">
- {/* Minimal checklist illustration */}
- <div className="w-10 h-10 mb-3 text-muted-foreground/30">
- <svg viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
- <rect x="6" y="8" width="6" height="6" rx="1" stroke="currentColor" strokeWidth="2" />
- <path d="M16 11H34" stroke="currentColor" strokeWidth="2" strokeLinecap="round" />
- <rect x="6" y="18" width="6" height="6" rx="1" stroke="currentColor" strokeWidth="2" />
- <path d="M16 21H28" stroke="currentColor" strokeWidth="2" strokeLinecap="round" />
- <rect x="6" y="28" width="6" height="6" rx="1" stroke="currentColor" strokeWidth="2" />
- <path d="M16 31H24" stroke="currentColor" strokeWidth="2" strokeLinecap="round" />
- </svg>
- </div>
- <h3 className="text-xs font-medium text-foreground mb-0.5">No tasks</h3>
- <p className="text-xs text-muted-foreground text-center mb-3">Track work for this case</p>
- <Button onClick={onAction} variant="ghost" size="sm" className="h-6 text-xs px-2 gap-1">
- <Plus className="w-3 h-3" />
- Add task
- </Button>
- </div>
- )
+ return (
+ <div className="flex flex-col items-center justify-center py-8 px-4">
+ {/* Minimal checklist illustration */}
+ <div className="w-10 h-10 mb-3 text-muted-foreground/30">
+ <svg viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <rect x="6" y="8" width="6" height="6" rx="1" stroke="currentColor" strokeWidth="2" />
+ <path d="M16 11H34" stroke="currentColor" strokeWidth="2" strokeLinecap="round" />
+ <rect x="6" y="18" width="6" height="6" rx="1" stroke="currentColor" strokeWidth="2" />
+ <path d="M16 21H28" stroke="currentColor" strokeWidth="2" strokeLinecap="round" />
+ <rect x="6" y="28" width="6" height="6" rx="1" stroke="currentColor" strokeWidth="2" />
+ <path d="M16 31H24" stroke="currentColor" strokeWidth="2" strokeLinecap="round" />
+ </svg>
+ </div>
+ <h3 className="text-xs font-medium text-foreground mb-0.5">No tasks</h3>
+ <p className="text-xs text-muted-foreground text-center mb-3">Track work for this case</p>
+ <Button onClick={onAction} variant="ghost" size="sm" className="h-6 text-xs px-2 gap-1">
+ <Plus className="w-3 h-3" />
+ Add task
+ </Button>
+ </div>
+ )
}
export function EmptyActivity() {
- return (
- <div className="flex flex-col items-center justify-center py-8 px-4">
- {/* Minimal timeline/clock illustration */}
- <div className="w-10 h-10 mb-3 text-muted-foreground/30">
- <svg viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
- <circle cx="20" cy="20" r="14" stroke="currentColor" strokeWidth="2" />
- <path
- d="M20 12V20L26 24"
- stroke="currentColor"
- strokeWidth="2"
- strokeLinecap="round"
- strokeLinejoin="round"
- />
- </svg>
- </div>
- <h3 className="text-xs font-medium text-foreground mb-0.5">No activity yet</h3>
- <p className="text-xs text-muted-foreground text-center max-w-[160px]">Actions on this case will appear here</p>
- </div>
- )
+ return (
+ <div className="flex flex-col items-center justify-center py-8 px-4">
+ {/* Minimal timeline/clock illustration */}
+ <div className="w-10 h-10 mb-3 text-muted-foreground/30">
+ <svg viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <circle cx="20" cy="20" r="14" stroke="currentColor" strokeWidth="2" />
+ <path
+ d="M20 12V20L26 24"
+ stroke="currentColor"
+ strokeWidth="2"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ />
+ </svg>
+ </div>
+ <h3 className="text-xs font-medium text-foreground mb-0.5">No activity yet</h3>
+ <p className="text-xs text-muted-foreground text-center max-w-[160px]">
+ Actions on this case will appear here
+ </p>
+ </div>
+ )
}
export function EmptySearchResults() {
- return (
- <div className="flex flex-col items-center justify-center py-16 px-4">
- {/* Minimal search illustration */}
- <div className="w-14 h-14 mb-5 text-muted-foreground/30">
- <svg viewBox="0 0 56 56" fill="none" xmlns="http://www.w3.org/2000/svg">
- <circle cx="24" cy="24" r="14" stroke="currentColor" strokeWidth="2" />
- <path d="M34 34L46 46" stroke="currentColor" strokeWidth="2" strokeLinecap="round" />
- <path d="M18 24H30" stroke="currentColor" strokeWidth="2" strokeLinecap="round" />
- </svg>
- </div>
- <h3 className="text-sm font-medium text-foreground mb-1">No results found</h3>
- <p className="text-sm text-muted-foreground text-center max-w-[220px]">
- Try adjusting your search or filters to find what you're looking for
- </p>
- </div>
- )
+ return (
+ <div className="flex flex-col items-center justify-center py-16 px-4">
+ {/* Minimal search illustration */}
+ <div className="w-14 h-14 mb-5 text-muted-foreground/30">
+ <svg viewBox="0 0 56 56" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <circle cx="24" cy="24" r="14" stroke="currentColor" strokeWidth="2" />
+ <path d="M34 34L46 46" stroke="currentColor" strokeWidth="2" strokeLinecap="round" />
+ <path d="M18 24H30" stroke="currentColor" strokeWidth="2" strokeLinecap="round" />
+ </svg>
+ </div>
+ <h3 className="text-sm font-medium text-foreground mb-1">No results found</h3>
+ <p className="text-sm text-muted-foreground text-center max-w-[220px]">
+ Try adjusting your search or filters to find what you're looking for
+ </p>
+ </div>
+ )
}
diff --git a/flowsint-app/src/components/dashboard/investigation/activity-timeline.tsx b/flowsint-app/src/components/dashboard/investigation/activity-timeline.tsx
index f5d0183b..b46e9db5 100644
--- a/flowsint-app/src/components/dashboard/investigation/activity-timeline.tsx
+++ b/flowsint-app/src/components/dashboard/investigation/activity-timeline.tsx
@@ -1,46 +1,46 @@
-import { Network, FileText, Upload, AlertCircle, CheckCircle } from "lucide-react"
+import { Network, FileText, Upload, AlertCircle, CheckCircle } from 'lucide-react'
const activities = [
{
id: 1,
- action: "created sketch",
- subject: "Infrastructure mapping v3",
- user: "John",
- time: "2h ago",
- icon: Network,
+ action: 'created sketch',
+ subject: 'Infrastructure mapping v3',
+ user: 'John',
+ time: '2h ago',
+ icon: Network
},
{
id: 2,
- action: "updated analysis",
- subject: "C2 Communication Patterns",
- user: "Sarah",
- time: "4h ago",
- icon: FileText,
+ action: 'updated analysis',
+ subject: 'C2 Communication Patterns',
+ user: 'Sarah',
+ time: '4h ago',
+ icon: FileText
},
{
id: 3,
- action: "uploaded",
- subject: "network_capture_nov28.pcap",
- user: "Mike",
- time: "6h ago",
- icon: Upload,
+ action: 'uploaded',
+ subject: 'network_capture_nov28.pcap',
+ user: 'Mike',
+ time: '6h ago',
+ icon: Upload
},
{
id: 4,
- action: "changed priority to",
- subject: "High",
- user: "John",
- time: "1d ago",
- icon: AlertCircle,
+ action: 'changed priority to',
+ subject: 'High',
+ user: 'John',
+ time: '1d ago',
+ icon: AlertCircle
},
{
id: 5,
- action: "completed",
- subject: "Initial triage review",
- user: "Sarah",
- time: "2d ago",
- icon: CheckCircle,
- },
+ action: 'completed',
+ subject: 'Initial triage review',
+ user: 'Sarah',
+ time: '2d ago',
+ icon: CheckCircle
+ }
]
export function ActivityTimeline() {
@@ -53,7 +53,7 @@ export function ActivityTimeline() {
<activity.icon className="w-4 h-4 text-muted-foreground mt-0.5 shrink-0" />
<div className="flex-1 min-w-0">
<span className="text-muted-foreground">
- <span className="text-foreground">{activity.user}</span> {activity.action}{" "}
+ <span className="text-foreground">{activity.user}</span> {activity.action}{' '}
<span className="text-foreground">{activity.subject}</span>
</span>
<span className="text-muted-foreground/60 ml-2">{activity.time}</span>
diff --git a/flowsint-app/src/components/dashboard/investigation/analyses-section.tsx b/flowsint-app/src/components/dashboard/investigation/analyses-section.tsx
index 7522f210..76fcab5c 100644
--- a/flowsint-app/src/components/dashboard/investigation/analyses-section.tsx
+++ b/flowsint-app/src/components/dashboard/investigation/analyses-section.tsx
@@ -1,10 +1,10 @@
-import { Button } from "@/components/ui/button"
-import { Analysis } from "@/types"
-import { formatDistanceToNow } from "date-fns"
-import { Plus, FileText, ChevronRight } from "lucide-react"
-import { EmptyAnalyses } from "../empty-states"
-import NewAnalysis from "@/components/analyses/new-analysis"
-import { Link } from "@tanstack/react-router"
+import { Button } from '@/components/ui/button'
+import { Analysis } from '@/types'
+import { formatDistanceToNow } from 'date-fns'
+import { Plus, FileText, ChevronRight } from 'lucide-react'
+import { EmptyAnalyses } from '../empty-states'
+import NewAnalysis from '@/components/analyses/new-analysis'
+import { Link } from '@tanstack/react-router'
interface AnalysesSectionProps {
analyses: Analysis[]
@@ -18,7 +18,11 @@ export function AnalysesSection({ analyses, canCreate = true }: AnalysesSectionP
<h2 className="text-sm font-medium text-foreground">Analyses</h2>
{canCreate && (
<NewAnalysis>
- <Button variant="ghost" size="sm" className="h-7 text-xs text-muted-foreground hover:text-foreground gap-1">
+ <Button
+ variant="ghost"
+ size="sm"
+ className="h-7 text-xs text-muted-foreground hover:text-foreground gap-1"
+ >
<Plus className="w-3.5 h-3.5" />
New
</Button>
@@ -26,17 +30,18 @@ export function AnalysesSection({ analyses, canCreate = true }: AnalysesSectionP
)}
</div>
- {analyses.length === 0 ?
+ {analyses.length === 0 ? (
<div className="border border-dashed rounded-md">
<EmptyAnalyses canCreate={canCreate} />
- </div> :
+ </div>
+ ) : (
<div className="space-y-1">
{analyses.map((analysis) => (
<Link
to="/dashboard/investigations/$investigationId/$type/$id"
params={{
investigationId: analysis.investigation_id as string,
- type: "analysis",
+ type: 'analysis',
id: analysis.id
}}
key={analysis.id}
@@ -51,15 +56,18 @@ export function AnalysesSection({ analyses, canCreate = true }: AnalysesSectionP
<div className="flex items-center gap-2 mt-1 text-xs text-muted-foreground/70">
<span>{analysis.owner_id}</span>
<span>·</span>
- <span>{formatDistanceToNow(new Date(analysis.last_updated_at), {
- addSuffix: true
- })}</span>
+ <span>
+ {formatDistanceToNow(new Date(analysis.last_updated_at), {
+ addSuffix: true
+ })}
+ </span>
</div>
</div>
<ChevronRight className="w-4 h-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity shrink-0 mt-0.5" />
</Link>
))}
- </div>}
+ </div>
+ )}
</section>
)
}
diff --git a/flowsint-app/src/components/dashboard/investigation/case-header.tsx b/flowsint-app/src/components/dashboard/investigation/case-header.tsx
index 7ae078c1..95afa8d2 100644
--- a/flowsint-app/src/components/dashboard/investigation/case-header.tsx
+++ b/flowsint-app/src/components/dashboard/investigation/case-header.tsx
@@ -7,7 +7,17 @@ import {
DropdownMenuItem,
DropdownMenuTrigger
} from '@/components/ui/dropdown-menu'
-import { MoreHorizontal, Star, Share, Trash2, Clock, Crown, Shield, Pencil, Eye } from 'lucide-react'
+import {
+ MoreHorizontal,
+ Star,
+ Share,
+ Trash2,
+ Clock,
+ Crown,
+ Shield,
+ Pencil,
+ Eye
+} from 'lucide-react'
import { Investigation, Collaborator } from '@/types'
import { formatDistanceToNow } from 'date-fns'
import { useState } from 'react'
@@ -23,11 +33,30 @@ import { usePermissions } from '@/hooks/use-can'
import type { InvestigationRole } from '@/types'
import { ShareDialog } from './share-dialog'
-const ROLE_CONFIG: Record<InvestigationRole, { label: string; icon: typeof Eye; className: string }> = {
- owner: { label: 'Owner', icon: Crown, className: 'bg-amber-500/15 text-amber-700 border-amber-500/30 dark:text-amber-400' },
- admin: { label: 'Admin', icon: Shield, className: 'bg-purple-500/15 text-purple-700 border-purple-500/30 dark:text-purple-400' },
- editor: { label: 'Editor', icon: Pencil, className: 'bg-blue-500/15 text-blue-700 border-blue-500/30 dark:text-blue-400' },
- viewer: { label: 'Viewer', icon: Eye, className: 'bg-zinc-500/15 text-zinc-700 border-zinc-500/30 dark:text-zinc-400' },
+const ROLE_CONFIG: Record<
+ InvestigationRole,
+ { label: string; icon: typeof Eye; className: string }
+> = {
+ owner: {
+ label: 'Owner',
+ icon: Crown,
+ className: 'bg-amber-500/15 text-amber-700 border-amber-500/30 dark:text-amber-400'
+ },
+ admin: {
+ label: 'Admin',
+ icon: Shield,
+ className: 'bg-purple-500/15 text-purple-700 border-purple-500/30 dark:text-purple-400'
+ },
+ editor: {
+ label: 'Editor',
+ icon: Pencil,
+ className: 'bg-blue-500/15 text-blue-700 border-blue-500/30 dark:text-blue-400'
+ },
+ viewer: {
+ label: 'Viewer',
+ icon: Eye,
+ className: 'bg-zinc-500/15 text-zinc-700 border-zinc-500/30 dark:text-zinc-400'
+ }
}
type CaseOverviewPageProps = {
@@ -106,16 +135,17 @@ export function CaseHeader({ investigation }: CaseOverviewPageProps) {
</div>
{/* Role badge */}
- {role && (() => {
- const config = ROLE_CONFIG[role]
- const Icon = config.icon
- return (
- <Badge className={cn('gap-1 text-xs font-medium shadow-none', config.className)}>
- <Icon className="w-3 h-3" />
- {config.label}
- </Badge>
- )
- })()}
+ {role &&
+ (() => {
+ const config = ROLE_CONFIG[role]
+ const Icon = config.icon
+ return (
+ <Badge className={cn('gap-1 text-xs font-medium shadow-none', config.className)}>
+ <Icon className="w-3 h-3" />
+ {config.label}
+ </Badge>
+ )
+ })()}
{/* Inline properties */}
<div className="flex items-center gap-4 text-sm">
diff --git a/flowsint-app/src/components/dashboard/investigation/case-overview-page.tsx b/flowsint-app/src/components/dashboard/investigation/case-overview-page.tsx
index 6970649b..5994d57c 100644
--- a/flowsint-app/src/components/dashboard/investigation/case-overview-page.tsx
+++ b/flowsint-app/src/components/dashboard/investigation/case-overview-page.tsx
@@ -1,9 +1,8 @@
-
-import { CaseHeader } from "./case-header"
-import { SketchesSection } from "./sketches-section"
-import { AnalysesSection } from "./analyses-section"
-import { Investigation } from "@/types"
-import { usePermissions } from "@/hooks/use-can"
+import { CaseHeader } from './case-header'
+import { SketchesSection } from './sketches-section'
+import { AnalysesSection } from './analyses-section'
+import { Investigation } from '@/types'
+import { usePermissions } from '@/hooks/use-can'
type CaseOverviewPageProps = {
investigation: Investigation
diff --git a/flowsint-app/src/components/dashboard/investigation/evidence-section.tsx b/flowsint-app/src/components/dashboard/investigation/evidence-section.tsx
index 1e0d9e2b..c5f1ae23 100644
--- a/flowsint-app/src/components/dashboard/investigation/evidence-section.tsx
+++ b/flowsint-app/src/components/dashboard/investigation/evidence-section.tsx
@@ -1,13 +1,12 @@
-
-import { Button } from "@/components/ui/button"
-import { Plus, FileCode, FileImage, FileText, File } from "lucide-react"
+import { Button } from '@/components/ui/button'
+import { Plus, FileCode, FileImage, FileText, File } from 'lucide-react'
const evidence = [
- { id: 1, name: "network_capture_nov28.pcap", size: "245 MB", icon: FileCode },
- { id: 2, name: "malware_sample_hash.zip", size: "12.4 MB", icon: File },
- { id: 3, name: "screenshot_c2_panel.png", size: "2.1 MB", icon: FileImage },
- { id: 4, name: "threat_intel_report.pdf", size: "4.8 MB", icon: FileText },
- { id: 5, name: "memory_dump_srv01.raw", size: "8.2 GB", icon: FileCode },
+ { id: 1, name: 'network_capture_nov28.pcap', size: '245 MB', icon: FileCode },
+ { id: 2, name: 'malware_sample_hash.zip', size: '12.4 MB', icon: File },
+ { id: 3, name: 'screenshot_c2_panel.png', size: '2.1 MB', icon: FileImage },
+ { id: 4, name: 'threat_intel_report.pdf', size: '4.8 MB', icon: FileText },
+ { id: 5, name: 'memory_dump_srv01.raw', size: '8.2 GB', icon: FileCode }
]
export function EvidenceSection() {
@@ -15,7 +14,11 @@ export function EvidenceSection() {
<section>
<div className="flex items-center justify-between mb-4">
<h2 className="text-sm font-medium text-foreground">Evidence & Files</h2>
- <Button variant="ghost" size="sm" className="h-7 text-xs text-muted-foreground hover:text-foreground gap-1">
+ <Button
+ variant="ghost"
+ size="sm"
+ className="h-7 text-xs text-muted-foreground hover:text-foreground gap-1"
+ >
<Plus className="w-3.5 h-3.5" />
Upload
</Button>
diff --git a/flowsint-app/src/components/dashboard/investigation/investigation-skeleton.tsx b/flowsint-app/src/components/dashboard/investigation/investigation-skeleton.tsx
index f4508190..7d2fb0cb 100644
--- a/flowsint-app/src/components/dashboard/investigation/investigation-skeleton.tsx
+++ b/flowsint-app/src/components/dashboard/investigation/investigation-skeleton.tsx
@@ -2,95 +2,95 @@ import { Skeleton } from '@/components/ui/skeleton'
import { Card, CardContent, CardHeader } from '@/components/ui/card'
export function InvestigationSkeleton() {
- return (
- <div className="h-full w-full px-4 py-12 bg-background overflow-auto">
- <div
- className="max-w-6xl mx-auto flex flex-col gap-12 items-center justify-start"
- style={{ containerType: 'inline-size' }}
- >
- {/* Recent Investigations Skeleton */}
- <div className="w-full space-y-4">
- <div className="flex items-center justify-between">
- <Skeleton className="h-7 w-48" />
- <Skeleton className="h-9 w-28" />
- </div>
- <div className="grid grid-cols-1 cq-sm:grid-cols-2 cq-md:grid-cols-3 cq-lg:grid-cols-4 cq-xl:grid-cols-5 gap-4">
- {[...Array(2)].map((_, i) => (
- <Card key={i} className="p-4">
- <div className="space-y-3">
- <div className="flex items-center justify-between">
- <Skeleton className="h-5 w-32" />
- <Skeleton className="h-4 w-20" />
- </div>
- <Skeleton className="h-4 w-full" />
- <Skeleton className="h-4 w-3/4" />
- <div className="flex items-center gap-2">
- <Skeleton className="h-4 w-4" />
- <Skeleton className="h-4 w-24" />
- </div>
- </div>
- </Card>
- ))}
- </div>
+ return (
+ <div className="h-full w-full px-4 py-12 bg-background overflow-auto">
+ <div
+ className="max-w-6xl mx-auto flex flex-col gap-12 items-center justify-start"
+ style={{ containerType: 'inline-size' }}
+ >
+ {/* Recent Investigations Skeleton */}
+ <div className="w-full space-y-4">
+ <div className="flex items-center justify-between">
+ <Skeleton className="h-7 w-48" />
+ <Skeleton className="h-9 w-28" />
+ </div>
+ <div className="grid grid-cols-1 cq-sm:grid-cols-2 cq-md:grid-cols-3 cq-lg:grid-cols-4 cq-xl:grid-cols-5 gap-4">
+ {[...Array(2)].map((_, i) => (
+ <Card key={i} className="p-4">
+ <div className="space-y-3">
+ <div className="flex items-center justify-between">
+ <Skeleton className="h-5 w-32" />
+ <Skeleton className="h-4 w-20" />
+ </div>
+ <Skeleton className="h-4 w-full" />
+ <Skeleton className="h-4 w-3/4" />
+ <div className="flex items-center gap-2">
+ <Skeleton className="h-4 w-4" />
+ <Skeleton className="h-4 w-24" />
+ </div>
</div>
+ </Card>
+ ))}
+ </div>
+ </div>
- {/* Get Started Section Skeleton */}
- <div className="w-full space-y-4">
- <Skeleton className="h-7 w-48" />
- <div className="grid grid-cols-1 cq-sm:grid-cols-2 cq-md:grid-cols-3 cq-lg:grid-cols-4 cq-xl:grid-cols-5 gap-4">
- {[...Array(3)].map((_, i) => (
- <Card key={i}>
- <CardHeader className="flex flex-row items-center gap-3 pb-2">
- <Skeleton className="h-9 w-9 rounded-lg" />
- <Skeleton className="h-6 w-32" />
- </CardHeader>
- <CardContent>
- <Skeleton className="h-4 w-full mb-2" />
- <Skeleton className="h-4 w-3/4" />
- </CardContent>
- </Card>
- ))}
- </div>
- </div>
+ {/* Get Started Section Skeleton */}
+ <div className="w-full space-y-4">
+ <Skeleton className="h-7 w-48" />
+ <div className="grid grid-cols-1 cq-sm:grid-cols-2 cq-md:grid-cols-3 cq-lg:grid-cols-4 cq-xl:grid-cols-5 gap-4">
+ {[...Array(3)].map((_, i) => (
+ <Card key={i}>
+ <CardHeader className="flex flex-row items-center gap-3 pb-2">
+ <Skeleton className="h-9 w-9 rounded-lg" />
+ <Skeleton className="h-6 w-32" />
+ </CardHeader>
+ <CardContent>
+ <Skeleton className="h-4 w-full mb-2" />
+ <Skeleton className="h-4 w-3/4" />
+ </CardContent>
+ </Card>
+ ))}
+ </div>
+ </div>
- {/* Discover Section Skeleton */}
- <div className="w-full space-y-4">
- <Skeleton className="h-7 w-48" />
- <div className="grid grid-cols-1 cq-sm:grid-cols-2 cq-md:grid-cols-3 cq-lg:grid-cols-4 cq-xl:grid-cols-5 gap-4">
- {[...Array(2)].map((_, i) => (
- <Card key={i}>
- <CardHeader className="flex flex-row items-center gap-3 pb-2">
- <Skeleton className="h-9 w-9 rounded-lg" />
- <Skeleton className="h-6 w-40" />
- </CardHeader>
- <CardContent>
- <Skeleton className="h-4 w-full mb-2" />
- <Skeleton className="h-4 w-3/4" />
- </CardContent>
- </Card>
- ))}
- </div>
- </div>
+ {/* Discover Section Skeleton */}
+ <div className="w-full space-y-4">
+ <Skeleton className="h-7 w-48" />
+ <div className="grid grid-cols-1 cq-sm:grid-cols-2 cq-md:grid-cols-3 cq-lg:grid-cols-4 cq-xl:grid-cols-5 gap-4">
+ {[...Array(2)].map((_, i) => (
+ <Card key={i}>
+ <CardHeader className="flex flex-row items-center gap-3 pb-2">
+ <Skeleton className="h-9 w-9 rounded-lg" />
+ <Skeleton className="h-6 w-40" />
+ </CardHeader>
+ <CardContent>
+ <Skeleton className="h-4 w-full mb-2" />
+ <Skeleton className="h-4 w-3/4" />
+ </CardContent>
+ </Card>
+ ))}
+ </div>
+ </div>
- {/* Useful Resources Skeleton */}
- <div className="w-full space-y-4">
- <Skeleton className="h-7 w-48" />
- <div className="grid grid-cols-1 cq-sm:grid-cols-2 cq-md:grid-cols-3 cq-lg:grid-cols-4 cq-xl:grid-cols-5 gap-4">
- {[...Array(2)].map((_, i) => (
- <Card key={i}>
- <CardHeader className="flex flex-row items-center gap-3 pb-2">
- <Skeleton className="h-9 w-9 rounded-lg" />
- <Skeleton className="h-6 w-40" />
- </CardHeader>
- <CardContent>
- <Skeleton className="h-4 w-full mb-2" />
- <Skeleton className="h-4 w-3/4" />
- </CardContent>
- </Card>
- ))}
- </div>
- </div>
- </div>
+ {/* Useful Resources Skeleton */}
+ <div className="w-full space-y-4">
+ <Skeleton className="h-7 w-48" />
+ <div className="grid grid-cols-1 cq-sm:grid-cols-2 cq-md:grid-cols-3 cq-lg:grid-cols-4 cq-xl:grid-cols-5 gap-4">
+ {[...Array(2)].map((_, i) => (
+ <Card key={i}>
+ <CardHeader className="flex flex-row items-center gap-3 pb-2">
+ <Skeleton className="h-9 w-9 rounded-lg" />
+ <Skeleton className="h-6 w-40" />
+ </CardHeader>
+ <CardContent>
+ <Skeleton className="h-4 w-full mb-2" />
+ <Skeleton className="h-4 w-3/4" />
+ </CardContent>
+ </Card>
+ ))}
+ </div>
</div>
- )
+ </div>
+ </div>
+ )
}
diff --git a/flowsint-app/src/components/dashboard/investigation/investigations-list.tsx b/flowsint-app/src/components/dashboard/investigation/investigations-list.tsx
index f068cbe5..1061214a 100644
--- a/flowsint-app/src/components/dashboard/investigation/investigations-list.tsx
+++ b/flowsint-app/src/components/dashboard/investigation/investigations-list.tsx
@@ -127,35 +127,35 @@ export function InvestigationsList({
</div>
) : (
<div style={{ containerType: 'inline-size' }}>
- <div className="grid grid-cols-1 cq-sm:grid-cols-2 cq-md:grid-cols-3 gap-3">
- {filteredInvestigations.length === 0 && <div>No investigation found.</div>}
- {filteredInvestigations.map((inv) => (
- <Link
- to="/dashboard/investigations/$investigationId"
- params={{ investigationId: inv.id }}
- className="block p-4 border border-border rounded-lg hover:border-muted-foreground/30 transition-colors group"
- >
- <div className="flex items-start justify-between mb-3">
- <div className="flex items-center gap-2">
- <FolderOpen className="w-4 h-4 text-muted-foreground" />
- <StatusBadge status={inv.status} />
- </div>
- {/*<button className="p-1 rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity">
+ <div className="grid grid-cols-1 cq-sm:grid-cols-2 cq-md:grid-cols-3 gap-3">
+ {filteredInvestigations.length === 0 && <div>No investigation found.</div>}
+ {filteredInvestigations.map((inv) => (
+ <Link
+ to="/dashboard/investigations/$investigationId"
+ params={{ investigationId: inv.id }}
+ className="block p-4 border border-border rounded-lg hover:border-muted-foreground/30 transition-colors group"
+ >
+ <div className="flex items-start justify-between mb-3">
+ <div className="flex items-center gap-2">
+ <FolderOpen className="w-4 h-4 text-muted-foreground" />
+ <StatusBadge status={inv.status} />
+ </div>
+ {/*<button className="p-1 rounded hover:bg-muted opacity-0 group-hover:opacity-100 transition-opacity">
<MoreHorizontal className="w-4 h-4 text-muted-foreground" />
</button>*/}
- </div>
- <h3 className="text-sm font-medium text-foreground mb-1 truncate">{inv.name}</h3>
- <p className="text-xs text-muted-foreground mb-4 line-clamp-2">{inv.description}</p>
- <div className="flex items-center justify-between">
- <div className="flex items-center gap-3 text-xs text-muted-foreground">
- <span className="flex items-center gap-1">
- <Network className="w-3 h-3" /> {inv.sketches.length}
- </span>
- <span className="flex items-center gap-1">
- <FileText className="w-3 h-3" /> {inv.analyses.length}
- </span>
</div>
- {/* <div className="flex -space-x-1">
+ <h3 className="text-sm font-medium text-foreground mb-1 truncate">{inv.name}</h3>
+ <p className="text-xs text-muted-foreground mb-4 line-clamp-2">{inv.description}</p>
+ <div className="flex items-center justify-between">
+ <div className="flex items-center gap-3 text-xs text-muted-foreground">
+ <span className="flex items-center gap-1">
+ <Network className="w-3 h-3" /> {inv.sketches.length}
+ </span>
+ <span className="flex items-center gap-1">
+ <FileText className="w-3 h-3" /> {inv.analyses.length}
+ </span>
+ </div>
+ {/* <div className="flex -space-x-1">
{inv.investigators.map((initials, i) => (
<div
key={i}
@@ -165,10 +165,10 @@ export function InvestigationsList({
</div>
))}
</div> */}
- </div>
- </Link>
- ))}
- </div>
+ </div>
+ </Link>
+ ))}
+ </div>
</div>
)}
</div>
diff --git a/flowsint-app/src/components/dashboard/investigation/metrics-grid.tsx b/flowsint-app/src/components/dashboard/investigation/metrics-grid.tsx
index fbe2580b..57fa95d0 100644
--- a/flowsint-app/src/components/dashboard/investigation/metrics-grid.tsx
+++ b/flowsint-app/src/components/dashboard/investigation/metrics-grid.tsx
@@ -1,6 +1,6 @@
-import { Network, FileText, Users, Shield } from "lucide-react"
-import { Investigation } from "@/types"
-import { useMemo } from "react"
+import { Network, FileText, Users, Shield } from 'lucide-react'
+import { Investigation } from '@/types'
+import { useMemo } from 'react'
type CaseOverviewPageProps = {
investigation: Investigation
@@ -8,20 +8,22 @@ type CaseOverviewPageProps = {
export function MetricsGrid({ investigation }: CaseOverviewPageProps) {
const sketchCount = investigation.sketches?.length || 0
const analysisCount = investigation.analyses?.length || 0
- const metrics = useMemo(() => [
- { label: "Sketches", value: sketchCount, icon: Network },
- { label: "Analyses", value: analysisCount, icon: FileText },
- { label: "Entities", value: "_", icon: Users },
- { label: "Relations", value: "_", icon: Shield },
- // { label: "Files", value: "34", icon: Paperclip },
- // { label: "Tasks", value: "6/15", icon: CheckCircle },
- ], [sketchCount, analysisCount])
+ const metrics = useMemo(
+ () => [
+ { label: 'Sketches', value: sketchCount, icon: Network },
+ { label: 'Analyses', value: analysisCount, icon: FileText },
+ { label: 'Entities', value: '_', icon: Users },
+ { label: 'Relations', value: '_', icon: Shield }
+ // { label: "Files", value: "34", icon: Paperclip },
+ // { label: "Tasks", value: "6/15", icon: CheckCircle },
+ ],
+ [sketchCount, analysisCount]
+ )
return (
<div className="my-6" style={{ containerType: 'inline-size' }}>
- <div className="grid border grid-cols-2 cq-sm:grid-cols-4 gap-px bg-border rounded-lg overflow-hidden">
- {
- metrics.map((metric) => (
+ <div className="grid border grid-cols-2 cq-sm:grid-cols-4 gap-px bg-border rounded-lg overflow-hidden">
+ {metrics.map((metric) => (
<div
key={metric.label}
className="bg-background px-4 py-4 flex flex-col items-center text-center transition-colors cursor-default"
@@ -30,9 +32,8 @@ export function MetricsGrid({ investigation }: CaseOverviewPageProps) {
<span className="text-xl font-semibold text-foreground">{metric.value}</span>
<span className="text-xs text-muted-foreground mt-0.5">{metric.label}</span>
</div>
- ))
- }
- </div>
+ ))}
+ </div>
</div>
)
}
diff --git a/flowsint-app/src/components/dashboard/investigation/share-dialog.tsx b/flowsint-app/src/components/dashboard/investigation/share-dialog.tsx
index f68a586a..a7cbd15a 100644
--- a/flowsint-app/src/components/dashboard/investigation/share-dialog.tsx
+++ b/flowsint-app/src/components/dashboard/investigation/share-dialog.tsx
@@ -345,7 +345,10 @@ export function ShareDialog({ investigationId, children }: ShareDialogProps) {
<DropdownMenu>
<DropdownMenuTrigger asChild>
<button>
- <RoleBadge role={collabRole} className="cursor-pointer hover:opacity-80 transition-opacity" />
+ <RoleBadge
+ role={collabRole}
+ className="cursor-pointer hover:opacity-80 transition-opacity"
+ />
</button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end" className="min-w-[140px]">
@@ -355,7 +358,9 @@ export function ShareDialog({ investigationId, children }: ShareDialogProps) {
return (
<DropdownMenuItem
key={opt.value}
- onClick={() => updateMutation.mutate({ userId: collab.user_id, role: opt.value })}
+ onClick={() =>
+ updateMutation.mutate({ userId: collab.user_id, role: opt.value })
+ }
className="flex items-center gap-2"
>
<Icon className="w-3.5 h-3.5 opacity-60" />
diff --git a/flowsint-app/src/components/dashboard/investigation/sketches-section.tsx b/flowsint-app/src/components/dashboard/investigation/sketches-section.tsx
index a1cbfa7b..15a29516 100644
--- a/flowsint-app/src/components/dashboard/investigation/sketches-section.tsx
+++ b/flowsint-app/src/components/dashboard/investigation/sketches-section.tsx
@@ -1,18 +1,16 @@
-
-import { Button } from "@/components/ui/button"
-import { Plus, ArrowUpRight } from "lucide-react"
-import { EmptySketches } from "../empty-states"
-import { Sketch } from "@/types"
-import { formatDistanceToNow } from "date-fns"
-import { Link } from "@tanstack/react-router"
-import NewSketch from "@/components/sketches/new-sketch"
+import { Button } from '@/components/ui/button'
+import { Plus, ArrowUpRight } from 'lucide-react'
+import { EmptySketches } from '../empty-states'
+import { Sketch } from '@/types'
+import { formatDistanceToNow } from 'date-fns'
+import { Link } from '@tanstack/react-router'
+import NewSketch from '@/components/sketches/new-sketch'
interface SketchesSectionProps {
sketches: Sketch[]
canCreate?: boolean
}
-
export function SketchesSection({ sketches, canCreate = true }: SketchesSectionProps) {
const isEmpty = sketches.length === 0
return (
@@ -21,7 +19,11 @@ export function SketchesSection({ sketches, canCreate = true }: SketchesSectionP
<h2 className="text-sm font-medium text-foreground">Sketches</h2>
{!isEmpty && canCreate && (
<NewSketch>
- <Button variant="ghost" size="sm" className="h-7 text-xs text-muted-foreground hover:text-foreground gap-1">
+ <Button
+ variant="ghost"
+ size="sm"
+ className="h-7 text-xs text-muted-foreground hover:text-foreground gap-1"
+ >
<Plus className="w-3.5 h-3.5" />
New
</Button>
@@ -30,55 +32,106 @@ export function SketchesSection({ sketches, canCreate = true }: SketchesSectionP
</div>
{isEmpty ? (
- canCreate ? <EmptySketches /> : <div className="text-sm text-muted-foreground py-4">No sketches yet.</div>
+ canCreate ? (
+ <EmptySketches />
+ ) : (
+ <div className="text-sm text-muted-foreground py-4">No sketches yet.</div>
+ )
) : (
<div style={{ containerType: 'inline-size' }}>
- <div className="grid grid-cols-1 cq-sm:grid-cols-2 cq-md:grid-cols-3 cq-lg:grid-cols-4 gap-3">
- {sketches.map((sketch) => (
- <Link
- to="/dashboard/investigations/$investigationId/$type/$id"
- params={{
- investigationId: sketch.investigation_id as string,
- type: "graph",
- id: sketch.id
- }}
- key={sketch.id}
- className="group block p-4 rounded-lg border border-border hover:border-primary/30 transition-colors cursor-pointer"
- >
- <div className="h-24 rounded bg-secondary/50 mb-3 flex items-center justify-center relative overflow-hidden">
- <svg className="w-full h-full opacity-40" viewBox="0 0 120 60">
- <line x1="20" y1="30" x2="60" y2="20" stroke="currentColor" strokeWidth="1" className="text-border" />
- <line
- x1="60"
- y1="20"
- x2="100"
- y2="35"
- stroke="currentColor"
- strokeWidth="1"
- className="text-border"
- />
- <line x1="20" y1="30" x2="50" y2="45" stroke="currentColor" strokeWidth="1" className="text-border" />
- <circle cx="20" cy="30" r="4" fill="currentColor" className="text-muted-foreground" />
- <circle cx="60" cy="20" r="5" fill="currentColor" className="text-muted-foreground" />
- <circle cx="100" cy="35" r="4" fill="currentColor" className="text-muted-foreground" />
- <circle cx="50" cy="45" r="3" fill="currentColor" className="text-muted-foreground" />
- </svg>
- <ArrowUpRight className="absolute top-2 right-2 w-4 h-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity" />
- </div>
+ <div className="grid grid-cols-1 cq-sm:grid-cols-2 cq-md:grid-cols-3 cq-lg:grid-cols-4 gap-3">
+ {sketches.map((sketch) => (
+ <Link
+ to="/dashboard/investigations/$investigationId/$type/$id"
+ params={{
+ investigationId: sketch.investigation_id as string,
+ type: 'graph',
+ id: sketch.id
+ }}
+ key={sketch.id}
+ className="group block p-4 rounded-lg border border-border hover:border-primary/30 transition-colors cursor-pointer"
+ >
+ <div className="h-24 rounded bg-secondary/50 mb-3 flex items-center justify-center relative overflow-hidden">
+ <svg className="w-full h-full opacity-40" viewBox="0 0 120 60">
+ <line
+ x1="20"
+ y1="30"
+ x2="60"
+ y2="20"
+ stroke="currentColor"
+ strokeWidth="1"
+ className="text-border"
+ />
+ <line
+ x1="60"
+ y1="20"
+ x2="100"
+ y2="35"
+ stroke="currentColor"
+ strokeWidth="1"
+ className="text-border"
+ />
+ <line
+ x1="20"
+ y1="30"
+ x2="50"
+ y2="45"
+ stroke="currentColor"
+ strokeWidth="1"
+ className="text-border"
+ />
+ <circle
+ cx="20"
+ cy="30"
+ r="4"
+ fill="currentColor"
+ className="text-muted-foreground"
+ />
+ <circle
+ cx="60"
+ cy="20"
+ r="5"
+ fill="currentColor"
+ className="text-muted-foreground"
+ />
+ <circle
+ cx="100"
+ cy="35"
+ r="4"
+ fill="currentColor"
+ className="text-muted-foreground"
+ />
+ <circle
+ cx="50"
+ cy="45"
+ r="3"
+ fill="currentColor"
+ className="text-muted-foreground"
+ />
+ </svg>
+ <ArrowUpRight className="absolute top-2 right-2 w-4 h-4 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity" />
+ </div>
- <h4 className="font-medium text-foreground text-sm mb-1">{sketch.title}</h4>
- <p className="text-xs text-muted-foreground line-clamp-2 mb-2">{sketch.description ? sketch.description : <span className="italic">No description provided.</span>}</p>
- <div className="flex items-center justify-between text-xs text-muted-foreground">
- <span>{formatDistanceToNow(new Date(sketch.last_updated_at), {
- addSuffix: true
- })}</span>
- </div>
- </Link>
- ))}
- </div>
+ <h4 className="font-medium text-foreground text-sm mb-1">{sketch.title}</h4>
+ <p className="text-xs text-muted-foreground line-clamp-2 mb-2">
+ {sketch.description ? (
+ sketch.description
+ ) : (
+ <span className="italic">No description provided.</span>
+ )}
+ </p>
+ <div className="flex items-center justify-between text-xs text-muted-foreground">
+ <span>
+ {formatDistanceToNow(new Date(sketch.last_updated_at), {
+ addSuffix: true
+ })}
+ </span>
+ </div>
+ </Link>
+ ))}
+ </div>
</div>
- )
- }
- </section >
+ )}
+ </section>
)
}
diff --git a/flowsint-app/src/components/dashboard/investigation/tasks-section.tsx b/flowsint-app/src/components/dashboard/investigation/tasks-section.tsx
index b6ff129a..90cfab79 100644
--- a/flowsint-app/src/components/dashboard/investigation/tasks-section.tsx
+++ b/flowsint-app/src/components/dashboard/investigation/tasks-section.tsx
@@ -1,25 +1,41 @@
-
-import { Button } from "@/components/ui/button"
-import { Checkbox } from "@/components/ui/checkbox"
-import { Plus } from "lucide-react"
-import { cn } from "@/lib/utils"
-import { useState } from "react"
-
+import { Button } from '@/components/ui/button'
+import { Checkbox } from '@/components/ui/checkbox'
+import { Plus } from 'lucide-react'
+import { cn } from '@/lib/utils'
+import { useState } from 'react'
type Task = {
- id: number,
- title: string,
- assignee: string,
- dueDate: string, completed: boolean
-
+ id: number
+ title: string
+ assignee: string
+ dueDate: string
+ completed: boolean
}
const tasksData = [
- { id: 1, title: "Complete malware reverse engineering", assignee: "SK", dueDate: "Dec 1", completed: false },
- { id: 2, title: "Document C2 infrastructure", assignee: "JD", dueDate: "Dec 2", completed: false },
- { id: 3, title: "Correlate IOCs with threat intel", assignee: "MR", dueDate: "Dec 3", completed: false },
- { id: 4, title: "Initial triage review", assignee: "SK", dueDate: "Nov 26", completed: true },
- { id: 5, title: "Collect network artifacts", assignee: "MR", dueDate: "Nov 25", completed: true },
+ {
+ id: 1,
+ title: 'Complete malware reverse engineering',
+ assignee: 'SK',
+ dueDate: 'Dec 1',
+ completed: false
+ },
+ {
+ id: 2,
+ title: 'Document C2 infrastructure',
+ assignee: 'JD',
+ dueDate: 'Dec 2',
+ completed: false
+ },
+ {
+ id: 3,
+ title: 'Correlate IOCs with threat intel',
+ assignee: 'MR',
+ dueDate: 'Dec 3',
+ completed: false
+ },
+ { id: 4, title: 'Initial triage review', assignee: 'SK', dueDate: 'Nov 26', completed: true },
+ { id: 5, title: 'Collect network artifacts', assignee: 'MR', dueDate: 'Nov 25', completed: true }
]
export function TasksSection() {
@@ -31,7 +47,11 @@ export function TasksSection() {
<h3 className="text-sm font-medium text-foreground">Tasks</h3>
<span className="text-xs text-muted-foreground">2/5</span>
</div>
- <Button variant="ghost" size="sm" className="h-7 text-xs text-muted-foreground hover:text-foreground gap-1">
+ <Button
+ variant="ghost"
+ size="sm"
+ className="h-7 text-xs text-muted-foreground hover:text-foreground gap-1"
+ >
<Plus className="w-3.5 h-3.5" />
Add
</Button>
@@ -39,22 +59,23 @@ export function TasksSection() {
<div className="space-y-1">
{tasks.map((task) => (
- <div key={task.id} className={cn("flex items-center gap-3 py-1.5", task.completed && "opacity-50")}>
+ <div
+ key={task.id}
+ className={cn('flex items-center gap-3 py-1.5', task.completed && 'opacity-50')}
+ >
<Checkbox
checked={task.completed}
- onCheckedChange={(checked: boolean | "indeterminate") =>
+ onCheckedChange={(checked: boolean | 'indeterminate') =>
setTasks((prev) =>
- prev.map((t) =>
- t.id === task.id ? { ...t, completed: Boolean(checked) } : t
- )
+ prev.map((t) => (t.id === task.id ? { ...t, completed: Boolean(checked) } : t))
)
}
className="w-4 h-4 rounded border-muted-foreground/40 data-[state=checked]:bg-muted data-[state=checked]:border-muted"
/>
<span
className={cn(
- "flex-1 text-sm",
- task.completed ? "text-muted-foreground line-through" : "text-foreground",
+ 'flex-1 text-sm',
+ task.completed ? 'text-muted-foreground line-through' : 'text-foreground'
)}
>
{task.title}
@@ -68,4 +89,3 @@ export function TasksSection() {
</section>
)
}
-
diff --git a/flowsint-app/src/components/dashboard/overview/dashboard-stats.tsx b/flowsint-app/src/components/dashboard/overview/dashboard-stats.tsx
index b72b5343..84ef3bed 100644
--- a/flowsint-app/src/components/dashboard/overview/dashboard-stats.tsx
+++ b/flowsint-app/src/components/dashboard/overview/dashboard-stats.tsx
@@ -1,37 +1,39 @@
-import { FolderOpen, FileText, Network, Clock } from "lucide-react"
-import { useMemo } from "react"
+import { FolderOpen, FileText, Network, Clock } from 'lucide-react'
+import { useMemo } from 'react'
type DashboardStatsProps = {
- casesCount: number,
- activeCasesCount: number,
+ casesCount: number
+ activeCasesCount: number
}
export function DashboardStats({ casesCount, activeCasesCount }: DashboardStatsProps) {
-
- const stats = useMemo(() => [
- { label: "Total Cases", value: casesCount, icon: FolderOpen },
- { label: "Active", value: activeCasesCount, icon: Clock },
- { label: "Analyses", value: "67", icon: FileText },
- { label: "Entities", value: "1,247", icon: Network },
- ], [casesCount, activeCasesCount])
+ const stats = useMemo(
+ () => [
+ { label: 'Total Cases', value: casesCount, icon: FolderOpen },
+ { label: 'Active', value: activeCasesCount, icon: Clock },
+ { label: 'Analyses', value: '67', icon: FileText },
+ { label: 'Entities', value: '1,247', icon: Network }
+ ],
+ [casesCount, activeCasesCount]
+ )
return (
<div className="mt-8" style={{ containerType: 'inline-size' }}>
- <div className="grid grid-cols-1 cq-sm:grid-cols-2 cq-lg:grid-cols-4 gap-4">
- {stats.map((stat) => (
- <div key={stat.label} className="px-4 py-3 border border-border rounded-lg bg-card/30">
- <div className="flex items-center gap-3">
- <div className="p-2 rounded-md bg-muted/50">
- <stat.icon className="w-4 h-4 text-muted-foreground" />
- </div>
- <div>
- <p className="text-xl font-semibold text-foreground">{stat.value}</p>
- <p className="text-xs text-muted-foreground">{stat.label}</p>
+ <div className="grid grid-cols-1 cq-sm:grid-cols-2 cq-lg:grid-cols-4 gap-4">
+ {stats.map((stat) => (
+ <div key={stat.label} className="px-4 py-3 border border-border rounded-lg bg-card/30">
+ <div className="flex items-center gap-3">
+ <div className="p-2 rounded-md bg-muted/50">
+ <stat.icon className="w-4 h-4 text-muted-foreground" />
+ </div>
+ <div>
+ <p className="text-xl font-semibold text-foreground">{stat.value}</p>
+ <p className="text-xs text-muted-foreground">{stat.label}</p>
+ </div>
</div>
</div>
- </div>
- ))}
- </div>
+ ))}
+ </div>
</div>
)
}
diff --git a/flowsint-app/src/components/dashboard/overview/recent-activity.tsx b/flowsint-app/src/components/dashboard/overview/recent-activity.tsx
index 7557f09e..db2ff251 100644
--- a/flowsint-app/src/components/dashboard/overview/recent-activity.tsx
+++ b/flowsint-app/src/components/dashboard/overview/recent-activity.tsx
@@ -1,36 +1,36 @@
-import { FileText, Network, Upload, UserPlus, CheckCircle } from "lucide-react"
+import { FileText, Network, Upload, UserPlus, CheckCircle } from 'lucide-react'
const activities = [
{
icon: FileText,
- text: "New analysis added to APT-29 Campaign",
- time: "2 hours ago",
+ text: 'New analysis added to APT-29 Campaign',
+ time: '2 hours ago'
},
{
icon: Network,
- text: "Sketch updated in Ransomware Incident",
- time: "5 hours ago",
+ text: 'Sketch updated in Ransomware Incident',
+ time: '5 hours ago'
},
{
icon: Upload,
- text: "Evidence uploaded to Data Breach case",
- time: "Yesterday",
+ text: 'Evidence uploaded to Data Breach case',
+ time: 'Yesterday'
},
{
icon: UserPlus,
- text: "Sarah Kim joined Phishing Investigation",
- time: "2 days ago",
+ text: 'Sarah Kim joined Phishing Investigation',
+ time: '2 days ago'
},
{
icon: CheckCircle,
- text: "Phishing Investigation Q4 closed",
- time: "3 days ago",
+ text: 'Phishing Investigation Q4 closed',
+ time: '3 days ago'
},
{
icon: FileText,
- text: "Draft analysis saved in Insider Threat",
- time: "4 days ago",
- },
+ text: 'Draft analysis saved in Insider Threat',
+ time: '4 days ago'
+ }
]
export function RecentActivity() {
diff --git a/flowsint-app/src/components/flows/save-modal.tsx b/flowsint-app/src/components/flows/save-modal.tsx
index 72877711..42211964 100644
--- a/flowsint-app/src/components/flows/save-modal.tsx
+++ b/flowsint-app/src/components/flows/save-modal.tsx
@@ -22,7 +22,14 @@ interface SaveModalProps {
initialDescription?: string
}
-export function SaveModal({ open, onOpenChange, onSave, isLoading, initialName, initialDescription }: SaveModalProps) {
+export function SaveModal({
+ open,
+ onOpenChange,
+ onSave,
+ isLoading,
+ initialName,
+ initialDescription
+}: SaveModalProps) {
const [name, setName] = useState(initialName || 'My Enricher')
const [description, setDescription] = useState(initialDescription || '')
const [nameError, setNameError] = useState('')
diff --git a/flowsint-app/src/components/icons/network.tsx b/flowsint-app/src/components/icons/network.tsx
index 7542a7d0..d7bd908b 100644
--- a/flowsint-app/src/components/icons/network.tsx
+++ b/flowsint-app/src/components/icons/network.tsx
@@ -1,11 +1,14 @@
export const NetworkIcon = (props: any) => (
- <svg
- {...props}
- xmlns="http://www.w3.org/2000/svg"
- viewBox="0 0 60 60"
- className="stroke-foreground opacity-70 fill-none"
- >
- <path stroke="currentColor"
- strokeWidth="1.7" d="M49,0c-3.309,0-6,2.691-6,6c0,1.035,0.263,2.009,0.726,2.86l-9.829,9.829C32.542,17.634,30.846,17,29,17 s-3.542,0.634-4.898,1.688l-7.669-7.669C16.785,10.424,17,9.74,17,9c0-2.206-1.794-4-4-4S9,6.794,9,9s1.794,4,4,4 c0.74,0,1.424-0.215,2.019-0.567l7.669,7.669C21.634,21.458,21,23.154,21,25s0.634,3.542,1.688,4.897L10.024,42.562 C8.958,41.595,7.549,41,6,41c-3.309,0-6,2.691-6,6s2.691,6,6,6s6-2.691,6-6c0-1.035-0.263-2.009-0.726-2.86l12.829-12.829 c1.106,0.86,2.44,1.436,3.898,1.619v10.16c-2.833,0.478-5,2.942-5,5.91c0,3.309,2.691,6,6,6s6-2.691,6-6c0-2.967-2.167-5.431-5-5.91 v-10.16c1.458-0.183,2.792-0.759,3.898-1.619l7.669,7.669C41.215,39.576,41,40.26,41,41c0,2.206,1.794,4,4,4s4-1.794,4-4 s-1.794-4-4-4c-0.74,0-1.424,0.215-2.019,0.567l-7.669-7.669C36.366,28.542,37,26.846,37,25s-0.634-3.542-1.688-4.897l9.665-9.665 C46.042,11.405,47.451,12,49,12c3.309,0,6-2.691,6-6S52.309,0,49,0z M11,9c0-1.103,0.897-2,2-2s2,0.897,2,2s-0.897,2-2,2 S11,10.103,11,9z M6,51c-2.206,0-4-1.794-4-4s1.794-4,4-4s4,1.794,4,4S8.206,51,6,51z M33,49c0,2.206-1.794,4-4,4s-4-1.794-4-4 s1.794-4,4-4S33,46.794,33,49z M29,31c-3.309,0-6-2.691-6-6s2.691-6,6-6s6,2.691,6,6S32.309,31,29,31z M47,41c0,1.103-0.897,2-2,2 s-2-0.897-2-2s0.897-2,2-2S47,39.897,47,41z M49,10c-2.206,0-4-1.794-4-4s1.794-4,4-4s4,1.794,4,4S51.206,10,49,10z" />
- </svg>
+ <svg
+ {...props}
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 60 60"
+ className="stroke-foreground opacity-70 fill-none"
+ >
+ <path
+ stroke="currentColor"
+ strokeWidth="1.7"
+ d="M49,0c-3.309,0-6,2.691-6,6c0,1.035,0.263,2.009,0.726,2.86l-9.829,9.829C32.542,17.634,30.846,17,29,17 s-3.542,0.634-4.898,1.688l-7.669-7.669C16.785,10.424,17,9.74,17,9c0-2.206-1.794-4-4-4S9,6.794,9,9s1.794,4,4,4 c0.74,0,1.424-0.215,2.019-0.567l7.669,7.669C21.634,21.458,21,23.154,21,25s0.634,3.542,1.688,4.897L10.024,42.562 C8.958,41.595,7.549,41,6,41c-3.309,0-6,2.691-6,6s2.691,6,6,6s6-2.691,6-6c0-1.035-0.263-2.009-0.726-2.86l12.829-12.829 c1.106,0.86,2.44,1.436,3.898,1.619v10.16c-2.833,0.478-5,2.942-5,5.91c0,3.309,2.691,6,6,6s6-2.691,6-6c0-2.967-2.167-5.431-5-5.91 v-10.16c1.458-0.183,2.792-0.759,3.898-1.619l7.669,7.669C41.215,39.576,41,40.26,41,41c0,2.206,1.794,4,4,4s4-1.794,4-4 s-1.794-4-4-4c-0.74,0-1.424,0.215-2.019,0.567l-7.669-7.669C36.366,28.542,37,26.846,37,25s-0.634-3.542-1.688-4.897l9.665-9.665 C46.042,11.405,47.451,12,49,12c3.309,0,6-2.691,6-6S52.309,0,49,0z M11,9c0-1.103,0.897-2,2-2s2,0.897,2,2s-0.897,2-2,2 S11,10.103,11,9z M6,51c-2.206,0-4-1.794-4-4s1.794-4,4-4s4,1.794,4,4S8.206,51,6,51z M33,49c0,2.206-1.794,4-4,4s-4-1.794-4-4 s1.794-4,4-4S33,46.794,33,49z M29,31c-3.309,0-6-2.691-6-6s2.691-6,6-6s6,2.691,6,6S32.309,31,29,31z M47,41c0,1.103-0.897,2-2,2 s-2-0.897-2-2s0.897-2,2-2S47,39.897,47,41z M49,10c-2.206,0-4-1.794-4-4s1.794-4,4-4s4,1.794,4,4S51.206,10,49,10z"
+ />
+ </svg>
)
diff --git a/flowsint-app/src/components/investigations/investigation-list.tsx b/flowsint-app/src/components/investigations/investigation-list.tsx
index d1f13aa6..dc93ede1 100644
--- a/flowsint-app/src/components/investigations/investigation-list.tsx
+++ b/flowsint-app/src/components/investigations/investigation-list.tsx
@@ -5,21 +5,17 @@ import NewInvestigation from './new-investigation'
import { cn } from '@/lib/utils'
import { Link } from '@tanstack/react-router'
import { SkeletonList } from '../shared/skeleton-list'
-import { FolderOpen, Plus } from "lucide-react"
+import { FolderOpen, Plus } from 'lucide-react'
import { queryKeys } from '@/api/query-keys'
import ErrorState from '../shared/error-state'
-
const InvestigationList = () => {
const { data, isLoading, error, refetch } = useQuery({
queryKey: queryKeys.investigations.list,
queryFn: investigationService.get
})
- if (isLoading)
- return (
- <SkeletonList rowCount={6} />
- )
+ if (isLoading) return <SkeletonList rowCount={6} />
if (error)
return (
<ErrorState
@@ -51,18 +47,18 @@ const InvestigationList = () => {
>
<button
className={cn(
- "w-full flex items-center gap-2 px-2 py-1.5 rounded text-sm transition-colors text-left group",
- "text-muted-foreground hover:bg-muted hover:text-sidebar-foreground"
+ 'w-full flex items-center gap-2 px-2 py-1.5 rounded text-sm transition-colors text-left group',
+ 'text-muted-foreground hover:bg-muted hover:text-sidebar-foreground'
)}
>
<FolderOpen className="w-4 h-4 shrink-0 opacity-60" />
<span className="truncate flex-1">{caseItem.name}</span>
<span
className={cn(
- "w-1.5 h-1.5 rounded-full shrink-0",
- caseItem.status === "active" && "bg-success",
- caseItem.status === "closed" && "bg-muted-foreground/50",
- caseItem.status === "on-hold" && "bg-warning",
+ 'w-1.5 h-1.5 rounded-full shrink-0',
+ caseItem.status === 'active' && 'bg-success',
+ caseItem.status === 'closed' && 'bg-muted-foreground/50',
+ caseItem.status === 'on-hold' && 'bg-warning'
)}
/>
</button>
@@ -70,8 +66,8 @@ const InvestigationList = () => {
))}
</div>
</div>
- </div >
+ </div>
)
}
-export default InvestigationList
\ No newline at end of file
+export default InvestigationList
diff --git a/flowsint-app/src/components/investigations/sketch-list.tsx b/flowsint-app/src/components/investigations/sketch-list.tsx
index 1b089c14..8a710e70 100644
--- a/flowsint-app/src/components/investigations/sketch-list.tsx
+++ b/flowsint-app/src/components/investigations/sketch-list.tsx
@@ -30,7 +30,9 @@ const SketchList = () => {
if (!searchQuery.trim()) return investigation.sketches
const query = searchQuery.toLowerCase().trim()
- return investigation.sketches.filter((sketch: Sketch) => sketch.title.toLowerCase().includes(query))
+ return investigation.sketches.filter((sketch: Sketch) =>
+ sketch.title.toLowerCase().includes(query)
+ )
}, [investigation?.sketches, searchQuery])
if (error)
@@ -71,24 +73,24 @@ const SketchList = () => {
to="/dashboard/investigations/$investigationId/$type/$id"
params={{
investigationId: sketch.investigation_id,
- type: "graph",
+ type: 'graph',
id: sketch.id
}}
>
<button
className={cn(
- "w-full flex items-center gap-2 px-2 py-1.5 rounded text-sm transition-colors text-left group",
- "text-muted-foreground hover:bg-muted hover:text-sidebar-foreground"
+ 'w-full flex items-center gap-2 px-2 py-1.5 rounded text-sm transition-colors text-left group',
+ 'text-muted-foreground hover:bg-muted hover:text-sidebar-foreground'
)}
>
<FolderOpen className="w-4 h-4 shrink-0 opacity-60" />
<span className="truncate flex-1">{sketch.title}</span>
<span
className={cn(
- "w-1.5 h-1.5 rounded-full shrink-0",
- sketch.status === "active" && "bg-success",
- sketch.status === "closed" && "bg-muted-foreground/50",
- sketch.status === "on-hold" && "bg-warning",
+ 'w-1.5 h-1.5 rounded-full shrink-0',
+ sketch.status === 'active' && 'bg-success',
+ sketch.status === 'closed' && 'bg-muted-foreground/50',
+ sketch.status === 'on-hold' && 'bg-warning'
)}
/>
</button>
diff --git a/flowsint-app/src/components/layout/info.tsx b/flowsint-app/src/components/layout/info.tsx
index 5f6c4f6b..6c6280a1 100644
--- a/flowsint-app/src/components/layout/info.tsx
+++ b/flowsint-app/src/components/layout/info.tsx
@@ -40,8 +40,8 @@ const InfoDialog = () => {
<strong>investigative graph</strong>.
</li>
<li>
- Offers <strong>visual enrichers</strong> to pivot from one entity to related
- ones: find <strong>connected individuals</strong>, discover{' '}
+ Offers <strong>visual enrichers</strong> to pivot from one entity to related ones:
+ find <strong>connected individuals</strong>, discover{' '}
<strong>infrastructure</strong>, uncover <strong>aliases</strong>.
</li>
<li>
diff --git a/flowsint-app/src/components/layout/persistent-log-panel.tsx b/flowsint-app/src/components/layout/persistent-log-panel.tsx
index c4cda04a..3841aa8c 100644
--- a/flowsint-app/src/components/layout/persistent-log-panel.tsx
+++ b/flowsint-app/src/components/layout/persistent-log-panel.tsx
@@ -35,13 +35,7 @@ export const PersistentLogPanel = () => {
{isOpenConsole ? (
<>
<ResizableHandle />
- <ResizablePanel
- id="console"
- order={5}
- defaultSize={30}
- minSize={10}
- maxSize={50}
- >
+ <ResizablePanel id="console" order={5} defaultSize={30} minSize={10} maxSize={50}>
<div className="h-full overflow-hidden flex flex-col">
<div className="h-8 shrink-0">
<StatusBar />
diff --git a/flowsint-app/src/components/layout/root.layout.tsx b/flowsint-app/src/components/layout/root.layout.tsx
index 64279898..6441e6d7 100644
--- a/flowsint-app/src/components/layout/root.layout.tsx
+++ b/flowsint-app/src/components/layout/root.layout.tsx
@@ -65,7 +65,7 @@ export default function RootLayout({ children }: LayoutProps) {
minSize={16}
maxSize={40}
onCollapse={closeDetails}
- onExpand={() => { }} // No auto-open here
+ onExpand={() => {}} // No auto-open here
collapsible={true}
collapsedSize={2}
>
@@ -90,7 +90,7 @@ export default function RootLayout({ children }: LayoutProps) {
minSize={16}
maxSize={40}
onCollapse={closeDetails}
- onExpand={() => { }} // No auto-open here
+ onExpand={() => {}} // No auto-open here
collapsible={true}
collapsedSize={2}
>
diff --git a/flowsint-app/src/components/map/map.tsx b/flowsint-app/src/components/map/map.tsx
index 3f8e9415..0ad1fad0 100644
--- a/flowsint-app/src/components/map/map.tsx
+++ b/flowsint-app/src/components/map/map.tsx
@@ -12,9 +12,7 @@ import { useGraphStore } from '@/stores/graph-store'
import { Switch } from '../ui/switch'
import { Label } from '../ui/label'
import type { MapRef } from 'react-map-gl/maplibre'
-import type {
- StyleSpecification
-} from 'maplibre-gl'
+import type { StyleSpecification } from 'maplibre-gl'
export type LocationPoint = {
nodeId?: string
@@ -203,9 +201,9 @@ export const MapFromAddress: React.FC<MapFromAddressProps> = ({
setIconsReady(true)
return
}
- Promise.all(
- Array.from(uniqueTypes).map((t) => preloadImage(t, '#ffffff'))
- ).then(() => setIconsReady(true)).catch(() => setIconsReady(true))
+ Promise.all(Array.from(uniqueTypes).map((t) => preloadImage(t, '#ffffff')))
+ .then(() => setIconsReady(true))
+ .catch(() => setIconsReady(true))
}, [validLocations])
// Fly to markers on data load
@@ -241,7 +239,7 @@ export const MapFromAddress: React.FC<MapFromAddressProps> = ({
const setCurrentNodeId = useGraphStore((s) => s.setCurrentNodeId)
const onMarkerClick = useCallback(
- (loc: typeof validLocations[number]) => {
+ (loc: (typeof validLocations)[number]) => {
const lat = Number(loc.coordinates!.lat)
const lon = Number(loc.coordinates!.lon)
if (loc.nodeId) setCurrentNodeId(loc.nodeId)
@@ -432,7 +430,8 @@ export const MapFromAddress: React.FC<MapFromAddressProps> = ({
const lat = Number(loc.coordinates!.lat)
const lon = Number(loc.coordinates!.lon)
const color = loc.color || DEFAULT_MARKER_COLOR
- const cachedImg = showDetails && loc.nodeType ? getCachedImage(loc.nodeType, '#ffffff') : undefined
+ const cachedImg =
+ showDetails && loc.nodeType ? getCachedImage(loc.nodeType, '#ffffff') : undefined
const dotSize = showDetails ? 24 : 10
const glowSize = showDetails ? 36 : 16
return (
@@ -463,9 +462,7 @@ export const MapFromAddress: React.FC<MapFromAddressProps> = ({
transition: 'width 0.2s, height 0.2s, box-shadow 0.2s'
}}
>
- {cachedImg && (
- <img src={cachedImg.src} width={14} height={14} alt="" />
- )}
+ {cachedImg && <img src={cachedImg.src} width={14} height={14} alt="" />}
</div>
</Marker>
)
diff --git a/flowsint-app/src/components/nav-user.tsx b/flowsint-app/src/components/nav-user.tsx
index dd6bb756..077800ca 100644
--- a/flowsint-app/src/components/nav-user.tsx
+++ b/flowsint-app/src/components/nav-user.tsx
@@ -45,7 +45,9 @@ export function NavUser() {
<UserAvatar user={user} />
<div className="grid flex-1 text-left text-sm leading-tight">
<span className="truncate font-medium">{displayName}</span>
- {user?.email && <span className="truncate text-xs text-muted-foreground">{user.email}</span>}
+ {user?.email && (
+ <span className="truncate text-xs text-muted-foreground">{user.email}</span>
+ )}
</div>
</div>
</DropdownMenuLabel>
diff --git a/flowsint-app/src/components/shared/form-field.tsx b/flowsint-app/src/components/shared/form-field.tsx
index f896b49e..73a7c7f0 100644
--- a/flowsint-app/src/components/shared/form-field.tsx
+++ b/flowsint-app/src/components/shared/form-field.tsx
@@ -40,8 +40,9 @@ const FormField: React.FC<FormFieldProps> = ({
id={name}
type={type}
placeholder={placeholder}
- className={`mt-1 block w-full px-3 py-2 border ${fieldError ? 'border-red-300' : 'border-border'
- } rounded-md placeholder-gray-400 focus:outline-none sm:text-sm`}
+ className={`mt-1 block w-full px-3 py-2 border ${
+ fieldError ? 'border-red-300' : 'border-border'
+ } rounded-md placeholder-gray-400 focus:outline-none sm:text-sm`}
{...(register ? register(name, registerOptions) : {})}
{...rest}
/>
diff --git a/flowsint-app/src/components/sketches/details-panel/details-panel.tsx b/flowsint-app/src/components/sketches/details-panel/details-panel.tsx
index a03e73a8..dbba6ed5 100644
--- a/flowsint-app/src/components/sketches/details-panel/details-panel.tsx
+++ b/flowsint-app/src/components/sketches/details-panel/details-panel.tsx
@@ -106,13 +106,7 @@ const formatDate = (value: unknown): string => {
// ── Sub-components ────────────────────────────────────────────────────────────
-function TitleInput({
- value,
- onChange
-}: {
- value: string
- onChange: (val: string) => void
-}) {
+function TitleInput({ value, onChange }: { value: string; onChange: (val: string) => void }) {
const [editing, setEditing] = useState(false)
const [draft, setDraft] = useState(value)
const inputRef = useRef<HTMLInputElement>(null)
@@ -132,10 +126,7 @@ function TitleInput({
if (!editing) {
return (
- <button
- onClick={() => setEditing(true)}
- className="min-w-0 flex-1 text-left"
- >
+ <button onClick={() => setEditing(true)} className="min-w-0 flex-1 text-left">
<span className="block truncate text-2xl font-bold">
{value || <span className="text-muted-foreground/40">Untitled</span>}
</span>
@@ -182,11 +173,7 @@ function CollapsibleSection({
onClick={() => setOpen((o) => !o)}
className="flex w-full items-center gap-2 px-6 py-2.5 text-sm font-medium text-muted-foreground hover:bg-muted/50 transition-colors"
>
- {open ? (
- <ChevronDown className="size-3.5" />
- ) : (
- <ChevronRightIcon className="size-3.5" />
- )}
+ {open ? <ChevronDown className="size-3.5" /> : <ChevronRightIcon className="size-3.5" />}
{label}
</button>
{open && children}
@@ -276,9 +263,9 @@ const DetailsPanel = memo(() => {
const currentNodeType = findActionItemByKey(node!.nodeType, actionItems)
const getNodePropertyType = (propertyName: string): FieldType | undefined => {
- const field = currentNodeType?.fields.find((f: FormField) => f.name === propertyName);
+ const field = currentNodeType?.fields.find((f: FormField) => f.name === propertyName)
- return field?.type;
+ return field?.type
}
const [formData, setFormData] = useState<FormData>({
@@ -466,12 +453,9 @@ const DetailsPanel = memo(() => {
)
const copyField = (value: any): string | undefined => {
- if (typeof value === 'string')
- return value
- else if (Array.isArray(value) && value.length > 0)
- return value.join(',')
- else
- return undefined
+ if (typeof value === 'string') return value
+ else if (Array.isArray(value) && value.length > 0) return value.join(',')
+ else return undefined
}
// ── Empty state ─────────────────────────────────────────────────────────────
@@ -503,7 +487,9 @@ const DetailsPanel = memo(() => {
<IconComponent size={24} />
</button>
) : (
- <div className="shrink-0 mt-1.5"><IconComponent size={24} /></div>
+ <div className="shrink-0 mt-1.5">
+ <IconComponent size={24} />
+ </div>
)}
{canEdit ? (
<TitleInput value={formData.nodeLabel} onChange={handleLabelCommit} />
@@ -532,7 +518,10 @@ const DetailsPanel = memo(() => {
)}
{/* Tabs */}
- <Tabs defaultValue="properties" className="flex-1 min-h-0 flex flex-col overflow-hidden gap-0">
+ <Tabs
+ defaultValue="properties"
+ className="flex-1 min-h-0 flex flex-col overflow-hidden gap-0"
+ >
<div className="px-3 pb-0 shrink-0 border-b">
<TabsList className="w-full h-9 bg-transparent rounded-none p-0 gap-0">
<TabsTrigger
@@ -569,11 +558,7 @@ const DetailsPanel = memo(() => {
<CollapsibleSection label="Properties" defaultOpen noBorderTop>
{propertiesFields.length > 0 ? (
propertiesFields.map(([key, value]) => (
- <PropertyRow
- key={key}
- label={key}
- copyValue={copyField(value)}
- >
+ <PropertyRow key={key} label={key} copyValue={copyField(value)}>
{typeof value === 'boolean' ? (
canEdit ? (
<Switch
@@ -603,11 +588,13 @@ const DetailsPanel = memo(() => {
<TagsInput
value={value || []}
onChange={(tags) => handlePropertyBlur(key, tags)}
- orientation='vertical'
- placeholder={value?.length === 0 ? "Empty" : `Enter ${key.toLowerCase()}`}
+ orientation="vertical"
+ placeholder={value?.length === 0 ? 'Empty' : `Enter ${key.toLowerCase()}`}
/>
) : (
- <span className="text-muted-foreground truncate">{Array.isArray(value) ? value.join(', ') : formatValue(value)}</span>
+ <span className="text-muted-foreground truncate">
+ {Array.isArray(value) ? value.join(', ') : formatValue(value)}
+ </span>
)
) : canEdit ? (
<PropertyInput
@@ -630,7 +617,7 @@ const DetailsPanel = memo(() => {
value={formData.notes}
onChange={canEdit ? handleNotesChange : undefined}
output="html"
- placeholder={canEdit ? "Write something..." : ""}
+ placeholder={canEdit ? 'Write something...' : ''}
showToolbar={false}
editorContentClassName="px-6 py-3 !max-w-none prose-sm"
immediatelyRender={false}
diff --git a/flowsint-app/src/components/sketches/details-panel/resizable-details-panels.tsx b/flowsint-app/src/components/sketches/details-panel/resizable-details-panels.tsx
index 9564be8c..d915afc6 100644
--- a/flowsint-app/src/components/sketches/details-panel/resizable-details-panels.tsx
+++ b/flowsint-app/src/components/sketches/details-panel/resizable-details-panels.tsx
@@ -114,7 +114,12 @@ export function ResizableDetailsPanel({
if (currentOpenGroup.length > 0) {
const groupKey = currentOpenGroup.map((s) => s.id).join('-')
result.push(
- <PanelGroup key={groupKey} direction="vertical" className="flex-1 min-h-0" autoSaveId={`details-panel-${groupKey}`}>
+ <PanelGroup
+ key={groupKey}
+ direction="vertical"
+ className="flex-1 min-h-0"
+ autoSaveId={`details-panel-${groupKey}`}
+ >
{currentOpenGroup.map((section, index) => {
const isLast = index === currentOpenGroup.length - 1
return (
diff --git a/flowsint-app/src/components/sketches/dynamic-form.tsx b/flowsint-app/src/components/sketches/dynamic-form.tsx
index 1b17aece..bbfdd3c8 100644
--- a/flowsint-app/src/components/sketches/dynamic-form.tsx
+++ b/flowsint-app/src/components/sketches/dynamic-form.tsx
@@ -265,14 +265,16 @@ export function DynamicForm({
<Controller
control={control}
name={field.name}
- defaultValue={Array.isArray(initialData?.[field.name]) ? initialData?.[field.name] : []}
+ defaultValue={
+ Array.isArray(initialData?.[field.name]) ? initialData?.[field.name] : []
+ }
render={({ field: { onChange, value, ref } }) => (
<TagsInput
value={Array.isArray(value) ? value : []}
onChange={(tags) => onChange(tags)}
placeholder={field.placeholder || `Enter ${field.label.toLowerCase()}`}
orientation="vertical"
- variant='full'
+ variant="full"
/>
)}
/>
diff --git a/flowsint-app/src/components/sketches/filters/rule-filters.tsx b/flowsint-app/src/components/sketches/filters/rule-filters.tsx
index 4d58ef37..6c6b76fc 100644
--- a/flowsint-app/src/components/sketches/filters/rule-filters.tsx
+++ b/flowsint-app/src/components/sketches/filters/rule-filters.tsx
@@ -1,10 +1,16 @@
-import { Button } from "@/components/ui/button"
-import { Input } from "@/components/ui/input"
-import { Plus, XIcon } from "lucide-react"
-import { Select, SelectItem, SelectContent, SelectTrigger, SelectValue } from "@/components/ui/select"
-import { memo, useState } from "react"
-import { v4 as uuidv4 } from "uuid"
-import type { RuleFilter, Filters, RuleKey, RuleOperator } from "@/types/filter"
+import { Button } from '@/components/ui/button'
+import { Input } from '@/components/ui/input'
+import { Plus, XIcon } from 'lucide-react'
+import {
+ Select,
+ SelectItem,
+ SelectContent,
+ SelectTrigger,
+ SelectValue
+} from '@/components/ui/select'
+import { memo, useState } from 'react'
+import { v4 as uuidv4 } from 'uuid'
+import type { RuleFilter, Filters, RuleKey, RuleOperator } from '@/types/filter'
type RuleFiltersProps = {
filters: Filters
@@ -17,7 +23,7 @@ function RuleFilters({ filters, setFilters }: RuleFiltersProps) {
const { rules } = draft
const setDraftRules = (newRules: RuleFilter[]) => {
- setDraft(prev => ({ ...prev, rules: newRules }))
+ setDraft((prev) => ({ ...prev, rules: newRules }))
}
const addRule = () => {
@@ -25,21 +31,19 @@ function RuleFilters({ filters, setFilters }: RuleFiltersProps) {
...rules,
{
id: uuidv4(),
- key: "label",
- operator: "is",
- matcher: ""
+ key: 'label',
+ operator: 'is',
+ matcher: ''
}
])
}
const removeRule = (id: string) => {
- setDraftRules(rules.filter(r => r.id !== id))
+ setDraftRules(rules.filter((r) => r.id !== id))
}
- const updateRule = (id: string, patch: Partial<Omit<RuleFilter, "id">>) => {
- setDraftRules(
- rules.map(r => (r.id === id ? { ...r, ...patch } : r))
- )
+ const updateRule = (id: string, patch: Partial<Omit<RuleFilter, 'id'>>) => {
+ setDraftRules(rules.map((r) => (r.id === id ? { ...r, ...patch } : r)))
}
const applyChanges = () => {
@@ -74,16 +78,14 @@ function RuleFilters({ filters, setFilters }: RuleFiltersProps) {
</div>
{rules.length === 0 ? (
- <p className="text-xs text-muted-foreground">
- Start by adding a filter rule.
- </p>
+ <p className="text-xs text-muted-foreground">Start by adding a filter rule.</p>
) : (
<ul className="space-y-2">
- {rules.map(rule => (
+ {rules.map((rule) => (
<RuleItem
key={rule.id}
rule={rule}
- onChange={patch => updateRule(rule.id, patch)}
+ onChange={(patch) => updateRule(rule.id, patch)}
onRemove={() => removeRule(rule.id)}
/>
))}
@@ -93,10 +95,9 @@ function RuleFilters({ filters, setFilters }: RuleFiltersProps) {
)
}
-
type RuleItemProps = {
rule: RuleFilter
- onChange: (patch: Partial<Omit<RuleFilter, "id">>) => void
+ onChange: (patch: Partial<Omit<RuleFilter, 'id'>>) => void
onRemove: () => void
}
@@ -109,7 +110,7 @@ const RuleItem = memo(({ rule, onChange, onRemove }: RuleItemProps) => (
<Input
value={rule.matcher}
- onChange={e => onChange({ matcher: e.target.value })}
+ onChange={(e) => onChange({ matcher: e.target.value })}
className="h-7 grow w-1/3"
placeholder="matcher"
/>
@@ -126,30 +127,41 @@ const RuleItem = memo(({ rule, onChange, onRemove }: RuleItemProps) => (
</li>
))
-
-const KEYS: RuleKey[] = ["label", "domain", "ip"]
-const OPERATORS: RuleOperator[] = ["is", "not", "like", "startsWith", "endsWith"]
-
-const KeyDropDown = memo(({ value, onChange }: { value: RuleKey, onChange: (v: RuleKey) => void }) => (
- <Select value={value} onValueChange={onChange}>
- <SelectTrigger className="!h-7 w-1/3">
- <SelectValue placeholder="property" />
- </SelectTrigger>
- <SelectContent>
- {KEYS.map(k => <SelectItem key={k} value={k}>{k}</SelectItem>)}
- </SelectContent>
- </Select>
-))
-
-const OperatorDropDown = memo(({ value, onChange }: { value: RuleOperator, onChange: (v: RuleOperator) => void }) => (
- <Select value={value} onValueChange={onChange}>
- <SelectTrigger className="!h-7 grow w-1/3">
- <SelectValue />
- </SelectTrigger>
- <SelectContent>
- {OPERATORS.map(o => <SelectItem key={o} value={o}>{o}</SelectItem>)}
- </SelectContent>
- </Select>
-))
+const KEYS: RuleKey[] = ['label', 'domain', 'ip']
+const OPERATORS: RuleOperator[] = ['is', 'not', 'like', 'startsWith', 'endsWith']
+
+const KeyDropDown = memo(
+ ({ value, onChange }: { value: RuleKey; onChange: (v: RuleKey) => void }) => (
+ <Select value={value} onValueChange={onChange}>
+ <SelectTrigger className="!h-7 w-1/3">
+ <SelectValue placeholder="property" />
+ </SelectTrigger>
+ <SelectContent>
+ {KEYS.map((k) => (
+ <SelectItem key={k} value={k}>
+ {k}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ )
+)
+
+const OperatorDropDown = memo(
+ ({ value, onChange }: { value: RuleOperator; onChange: (v: RuleOperator) => void }) => (
+ <Select value={value} onValueChange={onChange}>
+ <SelectTrigger className="!h-7 grow w-1/3">
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ {OPERATORS.map((o) => (
+ <SelectItem key={o} value={o}>
+ {o}
+ </SelectItem>
+ ))}
+ </SelectContent>
+ </Select>
+ )
+)
export default RuleFilters
diff --git a/flowsint-app/src/components/sketches/filters/type-filters.tsx b/flowsint-app/src/components/sketches/filters/type-filters.tsx
index c91f756b..89fb3596 100644
--- a/flowsint-app/src/components/sketches/filters/type-filters.tsx
+++ b/flowsint-app/src/components/sketches/filters/type-filters.tsx
@@ -2,32 +2,32 @@ import { Checkbox } from '@/components/ui/checkbox'
import { TypeFilter, Filters } from '@/types/filter'
type TypeFiltersProps = {
- filters: Filters,
- toggleTypeFilter: (filter: TypeFilter) => void
+ filters: Filters
+ toggleTypeFilter: (filter: TypeFilter) => void
}
const TypeFilters = ({ filters, toggleTypeFilter }: TypeFiltersProps) => {
- return (
- <div className='space-y-2'>
- <p className="opacity-90 text-sm">Filter by entity type</p>
- {filters.types.length === 0 ? (
- <p className="text-muted-foreground text-xs">No filter to display.</p>
- ) : (
- <ul className="grid grid-cols-3 gap-2">
- {filters.types.map((filter) => (
- <li>
- <div className="flex items-center gap-1">
- <Checkbox
- checked={filter.checked}
- onCheckedChange={() => toggleTypeFilter(filter)}
- />
- {filter.type}
- </div>
- </li>
- ))}
- </ul>
- )}
- </div>
- )
+ return (
+ <div className="space-y-2">
+ <p className="opacity-90 text-sm">Filter by entity type</p>
+ {filters.types.length === 0 ? (
+ <p className="text-muted-foreground text-xs">No filter to display.</p>
+ ) : (
+ <ul className="grid grid-cols-3 gap-2">
+ {filters.types.map((filter) => (
+ <li>
+ <div className="flex items-center gap-1">
+ <Checkbox
+ checked={filter.checked}
+ onCheckedChange={() => toggleTypeFilter(filter)}
+ />
+ {filter.type}
+ </div>
+ </li>
+ ))}
+ </ul>
+ )}
+ </div>
+ )
}
-export default TypeFilters
\ No newline at end of file
+export default TypeFilters
diff --git a/flowsint-app/src/components/sketches/graph/components/graph-empty-state.tsx b/flowsint-app/src/components/sketches/graph/components/graph-empty-state.tsx
index d413bc18..654b5e69 100644
--- a/flowsint-app/src/components/sketches/graph/components/graph-empty-state.tsx
+++ b/flowsint-app/src/components/sketches/graph/components/graph-empty-state.tsx
@@ -15,10 +15,7 @@ export const GraphEmptyState: React.FC<GraphEmptyStateProps> = ({
style
}) => {
return (
- <div
- className={`flex h-full w-full items-center justify-center ${className}`}
- style={style}
- >
+ <div className={`flex h-full w-full items-center justify-center ${className}`} style={style}>
<div className="text-center text-muted-foreground max-w-md mx-auto p-6">
<div className="mb-4">
<svg
@@ -41,8 +38,7 @@ export const GraphEmptyState: React.FC<GraphEmptyStateProps> = ({
</p>
<div className="space-y-2 text-xs text-muted-foreground mb-6">
<p>
- <strong>Tip:</strong> Use the search bar to find entities or import data to get
- started
+ <strong>Tip:</strong> Use the search bar to find entities or import data to get started
</p>
<p>
<strong>Explore:</strong> Try searching for domains, emails, or other entities
@@ -51,17 +47,17 @@ export const GraphEmptyState: React.FC<GraphEmptyStateProps> = ({
<strong>Labels:</strong> Zoom in (over 2x) to see all labels, icons, and edges
</p>
</div>
- <div className='flex flex-col justify-center gap-1'>
+ <div className="flex flex-col justify-center gap-1">
<Button onClick={onOpenAddDialog}>
<Plus />
Add your first item
</Button>
- <span className='opacity-60'>or</span>
+ <span className="opacity-60">or</span>
<Button variant="secondary" onClick={onOpenImportDialog}>
<Upload /> Import data
</Button>
</div>
</div>
- </div >
+ </div>
)
}
diff --git a/flowsint-app/src/components/sketches/graph/components/graph-main.tsx b/flowsint-app/src/components/sketches/graph/components/graph-main.tsx
index 52007d69..9c69cd86 100644
--- a/flowsint-app/src/components/sketches/graph/components/graph-main.tsx
+++ b/flowsint-app/src/components/sketches/graph/components/graph-main.tsx
@@ -114,7 +114,15 @@ const GraphMain = () => {
setEdgeMenu(null)
setBackgroundMenu(null)
},
- [openQuickAdd, linkCreation.mode, cancelLinkCreation, setCurrentNodeId, clearSelectedNodes, clearSelectedEdges, setCurrentEdgeId]
+ [
+ openQuickAdd,
+ linkCreation.mode,
+ cancelLinkCreation,
+ setCurrentNodeId,
+ clearSelectedNodes,
+ clearSelectedEdges,
+ setCurrentEdgeId
+ ]
)
// Stable ref so ForceGraph2D always calls the latest version
@@ -234,14 +242,24 @@ const GraphMain = () => {
)
const linkCreationProp = useMemo(
- () => canCreate ? ({
+ () =>
+ canCreate
+ ? {
+ shiftHeld,
+ sourceNode: linkCreation.sourceNode,
+ onStartLinking: startLinking,
+ onCompleteLinking: handleCompleteLinking,
+ onCancel: cancelLinkCreation
+ }
+ : undefined,
+ [
+ canCreate,
shiftHeld,
- sourceNode: linkCreation.sourceNode,
- onStartLinking: startLinking,
- onCompleteLinking: handleCompleteLinking,
- onCancel: cancelLinkCreation
- }) : undefined,
- [canCreate, shiftHeld, linkCreation.sourceNode, startLinking, handleCompleteLinking, cancelLinkCreation]
+ linkCreation.sourceNode,
+ startLinking,
+ handleCompleteLinking,
+ cancelLinkCreation
+ ]
)
const handleGraphRef = useCallback((ref: any) => {
diff --git a/flowsint-app/src/components/sketches/graph/components/graph-selector-overlay.tsx b/flowsint-app/src/components/sketches/graph/components/graph-selector-overlay.tsx
index cb3e5584..bd542fa3 100644
--- a/flowsint-app/src/components/sketches/graph/components/graph-selector-overlay.tsx
+++ b/flowsint-app/src/components/sketches/graph/components/graph-selector-overlay.tsx
@@ -22,7 +22,7 @@ export const GraphSelectorOverlay: React.FC<GraphSelectorOverlayProps> = ({
return (
<>
<div className="absolute z-20 top-3 flex items-center gap-1 left-3 bg-primary/20 text-primary border border-primary/40 rounded-lg p-1 px-2 text-xs pointer-events-none">
- <Info className='h-3 w-3 ' />
+ <Info className="h-3 w-3 " />
{selectionMode === 'lasso' ? 'Lasso' : 'Rectangle'} selection is active
</div>
{selectionMode === 'lasso' ? (
diff --git a/flowsint-app/src/components/sketches/graph/components/minimap.tsx b/flowsint-app/src/components/sketches/graph/components/minimap.tsx
index 27c888bc..e450f7be 100644
--- a/flowsint-app/src/components/sketches/graph/components/minimap.tsx
+++ b/flowsint-app/src/components/sketches/graph/components/minimap.tsx
@@ -31,7 +31,10 @@ const MinimapCanvas = ({
const validNodes = nodes.filter((n) => typeof n.x === 'number' && typeof n.y === 'number')
if (validNodes.length === 0) return null
- let minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity
+ let minX = Infinity,
+ minY = Infinity,
+ maxX = -Infinity,
+ maxY = -Infinity
for (const node of validNodes) {
if (node.x && node.x < minX) minX = node.x
@@ -53,8 +56,10 @@ const MinimapCanvas = ({
try {
// Check if required methods exist
- if (typeof graphRef.current.graph2ScreenCoords !== 'function' ||
- typeof graphRef.current.zoom !== 'function') {
+ if (
+ typeof graphRef.current.graph2ScreenCoords !== 'function' ||
+ typeof graphRef.current.zoom !== 'function'
+ ) {
return
}
@@ -109,7 +114,7 @@ const MinimapCanvas = ({
ctx.clearRect(0, 0, width, height)
// Draw nodes
- const nodeRadius = .75
+ const nodeRadius = 0.75
for (const node of nodes) {
if (typeof node.x !== 'number' || typeof node.y !== 'number') continue
@@ -137,7 +142,6 @@ const MinimapCanvas = ({
ctx.roundRect(rectX, rectY, rectWidth, rectHeight, 2)
ctx.fill()
ctx.stroke()
-
} catch (error) {
// Silent fail if graph not ready
return
@@ -164,12 +168,7 @@ const MinimapCanvas = ({
style={{ width, height }}
className="absolute bottom-3 right-3 bg-background/90 backdrop-blur-sm overflow-hidden border border-border rounded-lg"
>
- <canvas
- ref={canvasRef}
- width={width}
- height={height}
- className="bg-transparent"
- />
+ <canvas ref={canvasRef} width={width} height={height} className="bg-transparent" />
</div>
)
}
diff --git a/flowsint-app/src/components/sketches/graph/context-menu/node-context-menu.tsx b/flowsint-app/src/components/sketches/graph/context-menu/node-context-menu.tsx
index cb01efa3..d40de920 100644
--- a/flowsint-app/src/components/sketches/graph/context-menu/node-context-menu.tsx
+++ b/flowsint-app/src/components/sketches/graph/context-menu/node-context-menu.tsx
@@ -140,7 +140,11 @@ export default function ContextMenu({
<div className="px-3 py-2 border-b border-border shrink-0">
<Tabs value={activeTab} onValueChange={setActiveTab} className="w-full">
<TabsList className="w-full h-9">
- <TabsTrigger value="enrichers" className="flex-1" onClick={(e) => e.stopPropagation()}>
+ <TabsTrigger
+ value="enrichers"
+ className="flex-1"
+ onClick={(e) => e.stopPropagation()}
+ >
<Zap className="h-3 w-3 mr-1" />
Enrichers
</TabsTrigger>
@@ -154,159 +158,163 @@ export default function ContextMenu({
)}
{/* Tab Content */}
- {canEdit && <Tabs value={activeTab} className="flex-1 flex flex-col min-h-0">
- {/* Enrichers Tab */}
- <TabsContent value="enrichers" className="flex-1 flex flex-col min-h-0 mt-0">
- {/* Enrichers Search */}
- <div className="px-3 py-2 border-b border-border shrink-0">
- <div className="relative">
- <Search className="absolute left-2 top-1/2 transform -translate-y-1/2 h-3 w-3 text-muted-foreground" />
- <Input
- type="search"
- placeholder="Search enrichers..."
- value={enrichersSearchQuery}
- onChange={(e) => {
- e.stopPropagation()
- setEnrichersSearchQuery(e.target.value)
- }}
- onClick={(e) => e.stopPropagation()}
- className="h-7 pl-7 text-xs"
- />
+ {canEdit && (
+ <Tabs value={activeTab} className="flex-1 flex flex-col min-h-0">
+ {/* Enrichers Tab */}
+ <TabsContent value="enrichers" className="flex-1 flex flex-col min-h-0 mt-0">
+ {/* Enrichers Search */}
+ <div className="px-3 py-2 border-b border-border shrink-0">
+ <div className="relative">
+ <Search className="absolute left-2 top-1/2 transform -translate-y-1/2 h-3 w-3 text-muted-foreground" />
+ <Input
+ type="search"
+ placeholder="Search enrichers..."
+ value={enrichersSearchQuery}
+ onChange={(e) => {
+ e.stopPropagation()
+ setEnrichersSearchQuery(e.target.value)
+ }}
+ onClick={(e) => e.stopPropagation()}
+ className="h-7 pl-7 text-xs"
+ />
+ </div>
</div>
- </div>
- {/* Enrichers List */}
- <div className="flex-1 grow overflow-auto min-h-0">
- {isLoadingEnrichers ? (
- <div className="p-2 space-y-2">
- {[...Array(3)].map((_, i) => (
- <div key={i} className="flex items-center gap-2 p-2 rounded-md">
- <Skeleton className="h-4 w-4" />
- <div className="flex-1 space-y-1">
- <Skeleton className="h-3 w-3/4" />
- <Skeleton className="h-2 w-1/2" />
+ {/* Enrichers List */}
+ <div className="flex-1 grow overflow-auto min-h-0">
+ {isLoadingEnrichers ? (
+ <div className="p-2 space-y-2">
+ {[...Array(3)].map((_, i) => (
+ <div key={i} className="flex items-center gap-2 p-2 rounded-md">
+ <Skeleton className="h-4 w-4" />
+ <div className="flex-1 space-y-1">
+ <Skeleton className="h-3 w-3/4" />
+ <Skeleton className="h-2 w-1/2" />
+ </div>
</div>
- </div>
- ))}
- </div>
- ) : filteredEnrichers.length > 0 ? (
- <div className="p-1">
- {filteredEnrichers.map((enricher: Enricher) => (
- <button
- key={enricher.id}
- className="w-full flex items-center gap-2 p-2 rounded-md hover:bg-muted text-left transition-colors"
- onClick={(e) => handleEnricherClick(e, enricher.name)}
- >
- <Zap className="h-4 w-4 text-muted-foreground shrink-0" />
- <div className="flex-1 min-w-0">
- <p className="text-sm font-medium flex gap-1 items-center truncate">
- <span>
- {enricher.wobblyType ? (
- <BadgeAlert className="h-3 w-3 text-orange-400" />
- ) : (
- <BadgeCheck className="h-3 w-3 text-green-400" />
- )}{' '}
- </span>{' '}
- {enricher.name || '(Unnamed enricher)'}
- </p>
- {enricher.description && (
- <p className="text-xs text-muted-foreground truncate">
- {enricher.description}
+ ))}
+ </div>
+ ) : filteredEnrichers.length > 0 ? (
+ <div className="p-1">
+ {filteredEnrichers.map((enricher: Enricher) => (
+ <button
+ key={enricher.id}
+ className="w-full flex items-center gap-2 p-2 rounded-md hover:bg-muted text-left transition-colors"
+ onClick={(e) => handleEnricherClick(e, enricher.name)}
+ >
+ <Zap className="h-4 w-4 text-muted-foreground shrink-0" />
+ <div className="flex-1 min-w-0">
+ <p className="text-sm font-medium flex gap-1 items-center truncate">
+ <span>
+ {enricher.wobblyType ? (
+ <BadgeAlert className="h-3 w-3 text-orange-400" />
+ ) : (
+ <BadgeCheck className="h-3 w-3 text-green-400" />
+ )}{' '}
+ </span>{' '}
+ {enricher.name || '(Unnamed enricher)'}
</p>
- )}
- </div>
- <div className="flex items-center gap-1">
- {/* <FavoriteButton isFavorite={false} /> */}
- <InfoButton description={enricher.description ?? ''} />
- </div>
- </button>
- ))}
- </div>
- ) : (
- <div className="p-4 text-center">
- <p className="text-sm text-muted-foreground">
- {enrichersSearchQuery ? 'No enrichers found' : 'No enrichers available'}
- </p>
- </div>
- )}
- </div>
- </TabsContent>
-
- {/* Flows Tab */}
- <TabsContent value="flows" className="flex-1 flex flex-col min-h-0 mt-0">
- {/* Flows Search */}
- <div className="px-3 py-2 border-b border-border shrink-0">
- <div className="relative">
- <Search className="absolute left-2 top-1/2 transform -translate-y-1/2 h-3 w-3 text-muted-foreground" />
- <Input
- type="search"
- placeholder="Search flows..."
- value={flowsSearchQuery}
- onChange={(e) => {
- e.stopPropagation()
- setFlowsSearchQuery(e.target.value)
- }}
- onClick={(e) => e.stopPropagation()}
- className="h-7 pl-7 text-xs"
- />
+ {enricher.description && (
+ <p className="text-xs text-muted-foreground truncate">
+ {enricher.description}
+ </p>
+ )}
+ </div>
+ <div className="flex items-center gap-1">
+ {/* <FavoriteButton isFavorite={false} /> */}
+ <InfoButton description={enricher.description ?? ''} />
+ </div>
+ </button>
+ ))}
+ </div>
+ ) : (
+ <div className="p-4 text-center">
+ <p className="text-sm text-muted-foreground">
+ {enrichersSearchQuery ? 'No enrichers found' : 'No enrichers available'}
+ </p>
+ </div>
+ )}
</div>
- </div>
+ </TabsContent>
- {/* Flows List */}
- <div className="flex-1 grow overflow-auto min-h-0">
- {isLoadingFlows ? (
- <div className="p-2 space-y-2">
- {[...Array(3)].map((_, i) => (
- <div key={i} className="flex items-center gap-2 p-2 rounded-md">
- <Skeleton className="h-4 w-4" />
- <div className="flex-1 space-y-1">
- <Skeleton className="h-3 w-3/4" />
- <Skeleton className="h-2 w-1/2" />
- </div>
- </div>
- ))}
+ {/* Flows Tab */}
+ <TabsContent value="flows" className="flex-1 flex flex-col min-h-0 mt-0">
+ {/* Flows Search */}
+ <div className="px-3 py-2 border-b border-border shrink-0">
+ <div className="relative">
+ <Search className="absolute left-2 top-1/2 transform -translate-y-1/2 h-3 w-3 text-muted-foreground" />
+ <Input
+ type="search"
+ placeholder="Search flows..."
+ value={flowsSearchQuery}
+ onChange={(e) => {
+ e.stopPropagation()
+ setFlowsSearchQuery(e.target.value)
+ }}
+ onClick={(e) => e.stopPropagation()}
+ className="h-7 pl-7 text-xs"
+ />
</div>
- ) : filteredFlows.length > 0 ? (
- <div className="p-1">
- {filteredFlows.map((flow: Flow) => (
- <button
- key={flow.id}
- className="w-full flex items-center gap-2 p-2 rounded-md hover:bg-muted text-left transition-colors"
- onClick={(e) => handleFlowClick(e, flow.id)}
- >
- <FileCode2 className="h-4 w-4 text-muted-foreground shrink-0" />
- <div className="flex-1 min-w-0">
- <p className="flex items-center gap-1 text-sm font-medium truncate">
- <span>
- {flow.wobblyType ? (
- <BadgeAlert className="h-3 w-3 text-orange-400" />
- ) : (
- <BadgeCheck className="h-3 w-3 text-green-400" />
- )}{' '}
- </span>{' '}
- {flow.name || '(Unnamed flow)'}
- </p>
- {flow.description && (
- <p className="text-xs text-muted-foreground truncate">{flow.description}</p>
- )}
- </div>
- <div className="flex items-center gap-1">
- {/* <FavoriteButton isFavorite={false} /> */}
- <InfoButton description={flow.description} />
+ </div>
+
+ {/* Flows List */}
+ <div className="flex-1 grow overflow-auto min-h-0">
+ {isLoadingFlows ? (
+ <div className="p-2 space-y-2">
+ {[...Array(3)].map((_, i) => (
+ <div key={i} className="flex items-center gap-2 p-2 rounded-md">
+ <Skeleton className="h-4 w-4" />
+ <div className="flex-1 space-y-1">
+ <Skeleton className="h-3 w-3/4" />
+ <Skeleton className="h-2 w-1/2" />
+ </div>
</div>
- </button>
- ))}
- </div>
- ) : (
- <div className="p-4 text-center">
- <p className="text-sm text-muted-foreground">
- {flowsSearchQuery ? 'No flows found' : 'No flows available'}
- </p>
- </div>
- )}
- </div>
- </TabsContent>
- </Tabs>}
+ ))}
+ </div>
+ ) : filteredFlows.length > 0 ? (
+ <div className="p-1">
+ {filteredFlows.map((flow: Flow) => (
+ <button
+ key={flow.id}
+ className="w-full flex items-center gap-2 p-2 rounded-md hover:bg-muted text-left transition-colors"
+ onClick={(e) => handleFlowClick(e, flow.id)}
+ >
+ <FileCode2 className="h-4 w-4 text-muted-foreground shrink-0" />
+ <div className="flex-1 min-w-0">
+ <p className="flex items-center gap-1 text-sm font-medium truncate">
+ <span>
+ {flow.wobblyType ? (
+ <BadgeAlert className="h-3 w-3 text-orange-400" />
+ ) : (
+ <BadgeCheck className="h-3 w-3 text-green-400" />
+ )}{' '}
+ </span>{' '}
+ {flow.name || '(Unnamed flow)'}
+ </p>
+ {flow.description && (
+ <p className="text-xs text-muted-foreground truncate">
+ {flow.description}
+ </p>
+ )}
+ </div>
+ <div className="flex items-center gap-1">
+ {/* <FavoriteButton isFavorite={false} /> */}
+ <InfoButton description={flow.description} />
+ </div>
+ </button>
+ ))}
+ </div>
+ ) : (
+ <div className="p-4 text-center">
+ <p className="text-sm text-muted-foreground">
+ {flowsSearchQuery ? 'No flows found' : 'No flows available'}
+ </p>
+ </div>
+ )}
+ </div>
+ </TabsContent>
+ </Tabs>
+ )}
</BaseContextMenu>
)
}
diff --git a/flowsint-app/src/components/sketches/graph/edge/link-renderer.ts b/flowsint-app/src/components/sketches/graph/edge/link-renderer.ts
index 9b31787a..f302616a 100644
--- a/flowsint-app/src/components/sketches/graph/edge/link-renderer.ts
+++ b/flowsint-app/src/components/sketches/graph/edge/link-renderer.ts
@@ -57,7 +57,7 @@ export const renderLink = ({
const isHighlighted = highlightLinks.has(linkKey)
const isSelected = rc.selectedEdgeIds.has(link.id)
const isCurrent = currentEdge?.id === link.id
- let linkWidthBase = forceSettings?.linkWidth?.value ?? 2
+ const linkWidthBase = forceSettings?.linkWidth?.value ?? 2
const linkWidth = rc.shouldRenderDetails
? linkWidthBase
@@ -159,9 +159,12 @@ export const renderLink = ({
// Arrow
if (arrowLength && arrowLength > 0) {
const endTan = bezierTangentAt1(
- adjustedStartX, adjustedStartY,
- ctrlX, ctrlY,
- adjustedEndX, adjustedEndY,
+ adjustedStartX,
+ adjustedStartY,
+ ctrlX,
+ ctrlY,
+ adjustedEndX,
+ adjustedEndY,
isCurved
)
const angle = Math.atan2(endTan.y, endTan.x)
diff --git a/flowsint-app/src/components/sketches/graph/hooks/use-graph-layout.ts b/flowsint-app/src/components/sketches/graph/hooks/use-graph-layout.ts
index 5641b3d1..3e4d7f20 100644
--- a/flowsint-app/src/components/sketches/graph/hooks/use-graph-layout.ts
+++ b/flowsint-app/src/components/sketches/graph/hooks/use-graph-layout.ts
@@ -30,36 +30,39 @@ export const useGraphLayout = ({
}
})
- const regenerateLayout = useCallback(async (layoutType: 'force' | 'hierarchy') => {
- if (!graphRef.current || !graphData?.nodes) {
- console.warn('Cannot regenerate layout: graph not ready')
- return
- }
+ const regenerateLayout = useCallback(
+ async (layoutType: 'force' | 'hierarchy') => {
+ if (!graphRef.current || !graphData?.nodes) {
+ console.warn('Cannot regenerate layout: graph not ready')
+ return
+ }
- setIsRegeneratingLayout(true)
+ setIsRegeneratingLayout(true)
- try {
- await applyLayout({
- layoutType,
- nodes: graphData.nodes,
- edges: graphData.links
- })
+ try {
+ await applyLayout({
+ layoutType,
+ nodes: graphData.nodes,
+ edges: graphData.links
+ })
- // Wait a bit for positions to be applied, then zoom to fit
- setTimeout(() => {
- if (graphRef.current?.zoomToFit) {
- graphRef.current.zoomToFit(400)
- }
- }, 100)
- } catch (error) {
- console.error('Layout calculation failed:', error)
- } finally {
- // Keep overlay visible for smooth transition
- setTimeout(() => {
- setIsRegeneratingLayout(false)
- }, 600)
- }
- }, [applyLayout, graphRef, graphData])
+ // Wait a bit for positions to be applied, then zoom to fit
+ setTimeout(() => {
+ if (graphRef.current?.zoomToFit) {
+ graphRef.current.zoomToFit(400)
+ }
+ }, 100)
+ } catch (error) {
+ console.error('Layout calculation failed:', error)
+ } finally {
+ // Keep overlay visible for smooth transition
+ setTimeout(() => {
+ setIsRegeneratingLayout(false)
+ }, 600)
+ }
+ },
+ [applyLayout, graphRef, graphData]
+ )
return {
isRegeneratingLayout,
diff --git a/flowsint-app/src/components/sketches/graph/node/node-renderer.ts b/flowsint-app/src/components/sketches/graph/node/node-renderer.ts
index b9d871de..f998032c 100644
--- a/flowsint-app/src/components/sketches/graph/node/node-renderer.ts
+++ b/flowsint-app/src/components/sketches/graph/node/node-renderer.ts
@@ -133,11 +133,7 @@ const getNodeVisual = (node: GraphNode, iconColor: string): NodeVisual => {
// --- Flag drawing (single shared helper) ---
-const drawFlag = (
- ctx: CanvasRenderingContext2D,
- node: GraphNode,
- size: number
-) => {
+const drawFlag = (ctx: CanvasRenderingContext2D, node: GraphNode, size: number) => {
const flagColor = FLAG_COLORS[node.nodeFlag!]
if (!flagColor) return
@@ -366,13 +362,7 @@ const drawCardFlag = (
const fSize = 6 * s
const prevAlpha = ctx.globalAlpha
ctx.globalAlpha = 1
- ctx.drawImage(
- cachedFlag,
- cardX + cardWidth - fSize * 0.6,
- cardY - fSize * 0.4,
- fSize,
- fSize
- )
+ ctx.drawImage(cachedFlag, cardX + cardWidth - fSize * 0.6, cardY - fSize * 0.4, fSize, fSize)
ctx.globalAlpha = prevAlpha
}
@@ -582,8 +572,16 @@ const renderDotNode = (params: NodeRenderParams) => {
// Icons
if (showIcons) {
drawNodeIcon(
- ctx, node, node.x, node.y, size, shape,
- isOutlined, isHighlighted, rc.hasAnyHighlight, theme
+ ctx,
+ node,
+ node.x,
+ node.y,
+ size,
+ shape,
+ isOutlined,
+ isHighlighted,
+ rc.hasAnyHighlight,
+ theme
)
}
@@ -622,7 +620,7 @@ const squareEdgeDistance = (angle: number, size: number): number => {
const hexEdgeDistance = (angle: number, size: number): number => {
const apothem = (size * SQRT3) / 2
- let a = ((angle % (Math.PI * 2)) + Math.PI * 2) % (Math.PI * 2)
+ const a = ((angle % (Math.PI * 2)) + Math.PI * 2) % (Math.PI * 2)
const sectorCenter = Math.round(a / (Math.PI / 3)) * (Math.PI / 3)
const offset = a - sectorCenter
return apothem / Math.cos(offset)
diff --git a/flowsint-app/src/components/sketches/graph/panels/selected-items-panel.tsx b/flowsint-app/src/components/sketches/graph/panels/selected-items-panel.tsx
index 7189bac5..cb86456a 100644
--- a/flowsint-app/src/components/sketches/graph/panels/selected-items-panel.tsx
+++ b/flowsint-app/src/components/sketches/graph/panels/selected-items-panel.tsx
@@ -86,7 +86,6 @@ const ActionBar = () => {
const clearSelectedNodes = useGraphStore((s) => s.clearSelectedNodes)
const settings = useGraphSettingsStore((s) => s.settings)
-
// Ask AI dialog
const handleAskAI = useCallback(
(e: React.MouseEvent) => {
@@ -132,7 +131,7 @@ const ActionBar = () => {
return (
<div className="flex items-center gap-1">
<TooltipProvider>
- {canEdit && Boolean(settings?.general?.showFlow?.value) &&
+ {canEdit && Boolean(settings?.general?.showFlow?.value) && (
<Tooltip>
<TooltipTrigger asChild>
<div>
@@ -149,7 +148,8 @@ const ActionBar = () => {
<TooltipContent>
<p>Ask AI</p>
</TooltipContent>
- </Tooltip>}
+ </Tooltip>
+ )}
{canEdit && (
<Tooltip>
<TooltipTrigger asChild>
diff --git a/flowsint-app/src/components/sketches/graph/utils/export-to-png.ts b/flowsint-app/src/components/sketches/graph/utils/export-to-png.ts
index d07219f2..983c6958 100644
--- a/flowsint-app/src/components/sketches/graph/utils/export-to-png.ts
+++ b/flowsint-app/src/components/sketches/graph/utils/export-to-png.ts
@@ -1,29 +1,29 @@
export const exportToPNG = async (canvaId: string, sketchId: string) => {
- if (!canvaId) {
- throw new Error('Graph ref not available')
- }
- // Get the canvas element from the ForceGraph2D component
- const canvas = document.getElementById(canvaId) as HTMLCanvasElement
- if (!canvas) {
- throw new Error('Canvas element not found')
- }
- return new Promise<void>((resolve, reject) => {
- canvas.toBlob((blob) => {
- if (!blob) {
- reject(new Error('Failed to create image blob'))
- return
- }
- // Create download link
- const url = URL.createObjectURL(blob)
- const a = document.createElement('a')
- a.href = url
- a.download = `sketch-${sketchId || 'export'}-${Date.now()}.png`
- document.body.appendChild(a)
- a.click()
- // Cleanup
- URL.revokeObjectURL(url)
- document.body.removeChild(a)
- resolve()
- }, 'image/png')
- })
-}
\ No newline at end of file
+ if (!canvaId) {
+ throw new Error('Graph ref not available')
+ }
+ // Get the canvas element from the ForceGraph2D component
+ const canvas = document.getElementById(canvaId) as HTMLCanvasElement
+ if (!canvas) {
+ throw new Error('Canvas element not found')
+ }
+ return new Promise<void>((resolve, reject) => {
+ canvas.toBlob((blob) => {
+ if (!blob) {
+ reject(new Error('Failed to create image blob'))
+ return
+ }
+ // Create download link
+ const url = URL.createObjectURL(blob)
+ const a = document.createElement('a')
+ a.href = url
+ a.download = `sketch-${sketchId || 'export'}-${Date.now()}.png`
+ document.body.appendChild(a)
+ a.click()
+ // Cleanup
+ URL.revokeObjectURL(url)
+ document.body.removeChild(a)
+ resolve()
+ }, 'image/png')
+ })
+}
diff --git a/flowsint-app/src/components/sketches/graph/utils/render-context.ts b/flowsint-app/src/components/sketches/graph/utils/render-context.ts
index 1ec507bc..a4bf5e26 100644
--- a/flowsint-app/src/components/sketches/graph/utils/render-context.ts
+++ b/flowsint-app/src/components/sketches/graph/utils/render-context.ts
@@ -48,25 +48,13 @@ export const createRenderContext = (
selectedEdgeIds: new Set(selectedEdges.map((e) => e.id)),
themeBgFill: isLight ? '#FFFFFF' : '#1a1a1a',
- themeSubtleBorder: isLight
- ? 'rgba(44, 44, 44, 0.19)'
- : 'rgba(222, 222, 222, 0.13)',
- themeMockLabelFill: isLight
- ? 'rgba(0, 0, 0, 0.15)'
- : 'rgba(255, 255, 255, 0.15)',
- themeLabelBg: isLight
- ? 'rgba(255, 255, 255, 0.75)'
- : 'rgba(32, 32, 32, 0.75)',
- themeLabelBgHighlighted: isLight
- ? 'rgba(255, 255, 255, 0.95)'
- : 'rgba(32, 32, 32, 0.95)',
- themeLabelBorder: isLight
- ? 'rgba(0, 0, 0, 0.1)'
- : 'rgba(255, 255, 255, 0.1)',
+ themeSubtleBorder: isLight ? 'rgba(44, 44, 44, 0.19)' : 'rgba(222, 222, 222, 0.13)',
+ themeMockLabelFill: isLight ? 'rgba(0, 0, 0, 0.15)' : 'rgba(255, 255, 255, 0.15)',
+ themeLabelBg: isLight ? 'rgba(255, 255, 255, 0.75)' : 'rgba(32, 32, 32, 0.75)',
+ themeLabelBgHighlighted: isLight ? 'rgba(255, 255, 255, 0.95)' : 'rgba(32, 32, 32, 0.95)',
+ themeLabelBorder: isLight ? 'rgba(0, 0, 0, 0.1)' : 'rgba(255, 255, 255, 0.1)',
themeTextColor: isLight ? GRAPH_COLORS.TEXT_LIGHT : GRAPH_COLORS.TEXT_DARK,
- themeEdgeLabelBg: isLight
- ? 'rgba(255, 255, 255, 0.95)'
- : 'rgba(32, 32, 32, 0.95)',
+ themeEdgeLabelBg: isLight ? 'rgba(255, 255, 255, 0.95)' : 'rgba(32, 32, 32, 0.95)',
dimmedColorCache: new Map()
}
@@ -121,7 +109,8 @@ export const isEdgeInViewport = (
screenStartX <= canvasWidth + margin &&
screenStartY >= -margin &&
screenStartY <= canvasHeight + margin
- ) return true
+ )
+ return true
const screenEndX = endX * transform.a + transform.e
const screenEndY = endY * transform.d + transform.f
@@ -131,7 +120,8 @@ export const isEdgeInViewport = (
screenEndX <= canvasWidth + margin &&
screenEndY >= -margin &&
screenEndY <= canvasHeight + margin
- ) return true
+ )
+ return true
// AABB intersection (edge might cross viewport even if both endpoints are outside)
const minX = Math.min(screenStartX, screenEndX)
diff --git a/flowsint-app/src/components/sketches/launch-enricher.tsx b/flowsint-app/src/components/sketches/launch-enricher.tsx
index c9ebd15e..77b8bd97 100644
--- a/flowsint-app/src/components/sketches/launch-enricher.tsx
+++ b/flowsint-app/src/components/sketches/launch-enricher.tsx
@@ -26,7 +26,17 @@ import { Search, FileCode2, Zap, PlusIcon, GitBranch, FileX, Sparkles } from 'lu
import { Enricher, Flow } from '@/types'
const LaunchEnricherOrFlowPanel = memo(
- ({ values, type, children, disabled }: { values: string[]; type: string; children?: React.ReactNode, disabled?: boolean }) => {
+ ({
+ values,
+ type,
+ children,
+ disabled
+ }: {
+ values: string[]
+ type: string
+ children?: React.ReactNode
+ disabled?: boolean
+ }) => {
const { launchEnricher } = useLaunchEnricher()
const { launchFlow } = useLaunchFlow()
const { id: sketch_id } = useParams({ strict: false })
@@ -86,9 +96,7 @@ const LaunchEnricherOrFlowPanel = memo(
}
}, [selectedEnricher, activeTab, launchEnricher, launchFlow, values, sketch_id])
- if (disabled) return (
- <>{children}</>
- )
+ if (disabled) return <>{children}</>
return (
<div>
<Sheet open={isOpen} onOpenChange={setIsOpen}>
@@ -179,12 +187,13 @@ const LaunchEnricherOrFlowPanel = memo(
filteredEnrichers.map((enricher: Enricher) => (
<Card
key={enricher.name}
- className={`cursor-pointer border py-1 transition-all ${selectedEnricher &&
+ className={`cursor-pointer border py-1 transition-all ${
+ selectedEnricher &&
'name' in selectedEnricher &&
selectedEnricher.name === enricher.name
- ? 'border-primary bg-primary/5'
- : 'hover:border-primary/50'
- }`}
+ ? 'border-primary bg-primary/5'
+ : 'hover:border-primary/50'
+ }`}
onClick={() => handleSelectEnricher(enricher)}
>
<CardHeader className="p-4">
@@ -216,9 +225,7 @@ const LaunchEnricherOrFlowPanel = memo(
</div>
<div className="space-y-2">
<h3 className="text-lg font-semibold">
- {enrichersSearchQuery
- ? 'No enrichers found'
- : 'No enrichers available'}
+ {enrichersSearchQuery ? 'No enrichers found' : 'No enrichers available'}
</h3>
<p className="text-sm text-muted-foreground max-w-sm mx-auto">
{enrichersSearchQuery
@@ -258,9 +265,7 @@ const LaunchEnricherOrFlowPanel = memo(
<div className="p-4 grow overflow-auto">
<RadioGroup
value={
- selectedEnricher && 'id' in selectedEnricher
- ? selectedEnricher.id
- : undefined
+ selectedEnricher && 'id' in selectedEnricher ? selectedEnricher.id : undefined
}
className="space-y-3"
>
@@ -290,12 +295,13 @@ const LaunchEnricherOrFlowPanel = memo(
filteredFlows.map((flow: Flow) => (
<Card
key={flow.id}
- className={`cursor-pointer border py-1 transition-all ${selectedEnricher &&
+ className={`cursor-pointer border py-1 transition-all ${
+ selectedEnricher &&
'id' in selectedEnricher &&
selectedEnricher.id === flow.id
- ? 'border-primary bg-primary/5'
- : 'hover:border-primary/50'
- }`}
+ ? 'border-primary bg-primary/5'
+ : 'hover:border-primary/50'
+ }`}
onClick={() => handleSelectEnricher(flow)}
>
<CardHeader className="p-4">
diff --git a/flowsint-app/src/components/sketches/settings/settings.tsx b/flowsint-app/src/components/sketches/settings/settings.tsx
index c2aab2a1..ae339245 100644
--- a/flowsint-app/src/components/sketches/settings/settings.tsx
+++ b/flowsint-app/src/components/sketches/settings/settings.tsx
@@ -577,7 +577,9 @@ export default function GlobalSettings() {
label="Description"
description="A brief description of what this sketch represents"
value={formData.description}
- onValueChange={canEdit ? (value) => handleInputChange('description', value) : () => {}}
+ onValueChange={
+ canEdit ? (value) => handleInputChange('description', value) : () => {}
+ }
placeholder="Enter sketch description"
rows={4}
/>
diff --git a/flowsint-app/src/components/sketches/view-toggle.tsx b/flowsint-app/src/components/sketches/view-toggle.tsx
index e5f2f6d9..bfb6a3e6 100644
--- a/flowsint-app/src/components/sketches/view-toggle.tsx
+++ b/flowsint-app/src/components/sketches/view-toggle.tsx
@@ -17,19 +17,11 @@ const views = [
export function ViewToggle({ view, setView }: ViewToggleProps) {
return (
- <ToggleGroup
- type="single"
- value={view}
- onValueChange={(v) => v && setView(v as typeof view)}
- >
+ <ToggleGroup type="single" value={view} onValueChange={(v) => v && setView(v as typeof view)}>
{views.map(({ value, icon: Icon, label }) => (
<Tooltip key={value}>
<TooltipTrigger asChild>
- <ToggleGroupItem
- value={value}
- aria-label={label}
- className="h-7 w-7 p-0"
- >
+ <ToggleGroupItem value={value} aria-label={label} className="h-7 w-7 p-0">
<Icon className="h-4 w-4" />
</ToggleGroupItem>
</TooltipTrigger>
diff --git a/flowsint-app/src/components/table/nodes-view.tsx b/flowsint-app/src/components/table/nodes-view.tsx
index 700aa195..6f26c871 100644
--- a/flowsint-app/src/components/table/nodes-view.tsx
+++ b/flowsint-app/src/components/table/nodes-view.tsx
@@ -70,7 +70,7 @@ const NodeItem = memo(function NodeItem({
const formatNodeData = useCallback((data: any) => {
if (!data) return ''
const entries = Object.entries(data)
- .map(([key, value]) => `${key}:${Boolean(value) ? value : 'N/A'}`)
+ .map(([key, value]) => `${key}:${value ? value : 'N/A'}`)
.join(', ')
return entries
}, [])
@@ -80,7 +80,9 @@ const NodeItem = memo(function NodeItem({
<div
className="grid items-center h-14 gap-3 text-sm border-b last:border-b-0"
style={{
- gridTemplateColumns: canEdit ? '24px 32px auto 1fr 140px 160px 32px' : '32px auto 1fr 140px 160px 32px'
+ gridTemplateColumns: canEdit
+ ? '24px 32px auto 1fr 140px 160px 32px'
+ : '32px auto 1fr 140px 160px 32px'
}}
>
{/* Checkbox */}
@@ -290,7 +292,11 @@ export default function NodesTable({ nodes }: NodesTableProps) {
{/* Table Header */}
<div
className="grid items-center h-11 px-4 bg-muted/50 p-2 rounded-t-md border text-sm font-medium text-muted-foreground"
- style={{ gridTemplateColumns: canEdit ? '24px 32px auto 1fr 140px 160px 32px' : '32px auto 1fr 140px 160px 32px' }}
+ style={{
+ gridTemplateColumns: canEdit
+ ? '24px 32px auto 1fr 140px 160px 32px'
+ : '32px auto 1fr 140px 160px 32px'
+ }}
>
{canEdit && (
<div className="flex items-center">
diff --git a/flowsint-app/src/components/templates/index.ts b/flowsint-app/src/components/templates/index.ts
index f048b6e4..c06932ce 100644
--- a/flowsint-app/src/components/templates/index.ts
+++ b/flowsint-app/src/components/templates/index.ts
@@ -7,4 +7,10 @@ export type { TestResult } from './template-test-panel'
export { AIChatPanel } from './ai-chat-panel'
export type { AIChatPanelHandle } from './ai-chat-panel'
export { templateSchema, defaultTemplate } from './template-schema'
-export type { TemplateData, TemplateInput, TemplateHttpRequest, TemplateHttpResponse, TemplateOutput } from './template-schema'
+export type {
+ TemplateData,
+ TemplateInput,
+ TemplateHttpRequest,
+ TemplateHttpResponse,
+ TemplateOutput
+} from './template-schema'
diff --git a/flowsint-app/src/components/templates/template-editor.tsx b/flowsint-app/src/components/templates/template-editor.tsx
index 3187d33b..8e852e19 100644
--- a/flowsint-app/src/components/templates/template-editor.tsx
+++ b/flowsint-app/src/components/templates/template-editor.tsx
@@ -3,12 +3,7 @@ import { useMutation, useQueryClient } from '@tanstack/react-query'
import { useNavigate } from '@tanstack/react-router'
import { parse as parseYaml, stringify as stringifyYaml } from 'yaml'
import { toast } from 'sonner'
-import {
- FileCode2,
- FlaskConical,
- CheckCircle2,
- XCircle
-} from 'lucide-react'
+import { FileCode2, FlaskConical, CheckCircle2, XCircle } from 'lucide-react'
import type { editor } from 'monaco-editor'
import { Tabs, TabsList, TabsTrigger } from '@/components/ui/tabs'
diff --git a/flowsint-app/src/components/templates/template-test-panel.tsx b/flowsint-app/src/components/templates/template-test-panel.tsx
index 8896e3b9..7e999f9c 100644
--- a/flowsint-app/src/components/templates/template-test-panel.tsx
+++ b/flowsint-app/src/components/templates/template-test-panel.tsx
@@ -51,190 +51,193 @@ export function TemplateTestPanel({
<ResizablePanelGroup direction="horizontal" className="h-full">
{/* Test Input */}
<ResizablePanel defaultSize={30} minSize={20}>
- <div className="h-full p-6 flex flex-col gap-6 overflow-y-auto">
- <div>
- <h3 className="text-lg font-semibold mb-1">Test your template</h3>
- <p className="text-sm text-muted-foreground">
- Enter a test value to simulate the enricher request.
- </p>
- </div>
-
- <div className="space-y-4">
- <div className="space-y-2">
- <Label htmlFor="test-input">
- Input Value
- {validationData?.input?.key && (
- <span className="text-muted-foreground ml-1">({validationData.input.key})</span>
- )}
- </Label>
- <Input
- id="test-input"
- placeholder={`Enter ${validationData?.input?.type || 'value'}...`}
- value={testInput}
- onChange={(e) => onTestInputChange(e.target.value)}
- onKeyDown={(e) => e.key === 'Enter' && onRunTest()}
- />
+ <div className="h-full p-6 flex flex-col gap-6 overflow-y-auto">
+ <div>
+ <h3 className="text-lg font-semibold mb-1">Test your template</h3>
+ <p className="text-sm text-muted-foreground">
+ Enter a test value to simulate the enricher request.
+ </p>
</div>
- {paramKeys.length > 0 && (
+ <div className="space-y-4">
<div className="space-y-2">
- <Label className="text-muted-foreground">Query Parameters</Label>
- <div className="border rounded-md overflow-hidden">
- <table className="w-full text-sm">
- <thead>
- <tr className="bg-muted/50 border-b">
- <th className="text-left px-3 py-1.5 text-xs font-medium text-muted-foreground w-1/3">
- Key
- </th>
- <th className="text-left px-3 py-1.5 text-xs font-medium text-muted-foreground">
- Value
- </th>
- </tr>
- </thead>
- <tbody>
- {paramKeys.map((paramKey, idx) => {
- const defaultValue = templateParams[paramKey] ?? ''
- return (
- <tr key={paramKey} className={idx < paramKeys.length - 1 ? 'border-b' : ''}>
- <td className="px-3 py-1.5 font-mono text-xs text-muted-foreground">
- {paramKey}
- </td>
- <td className="px-1 py-1">
- <Input
- placeholder={String(defaultValue) || 'Value'}
- value={testParams[paramKey] ?? ''}
- onChange={(e) =>
- onTestParamsChange({
- ...testParams,
- [paramKey]: e.target.value
- })
- }
- className="h-7 text-xs border-0 bg-transparent focus-visible:ring-1 focus-visible:ring-offset-0"
- />
- </td>
- </tr>
- )
- })}
- </tbody>
- </table>
- </div>
+ <Label htmlFor="test-input">
+ Input Value
+ {validationData?.input?.key && (
+ <span className="text-muted-foreground ml-1">({validationData.input.key})</span>
+ )}
+ </Label>
+ <Input
+ id="test-input"
+ placeholder={`Enter ${validationData?.input?.type || 'value'}...`}
+ value={testInput}
+ onChange={(e) => onTestInputChange(e.target.value)}
+ onKeyDown={(e) => e.key === 'Enter' && onRunTest()}
+ />
</div>
- )}
- {validationData?.request?.url && (
- <div className="space-y-2">
- <Label className="text-muted-foreground">Request URL</Label>
- <code className="block text-xs bg-muted p-2 rounded break-all">
- {buildPreviewUrl()}
- </code>
- </div>
- )}
+ {paramKeys.length > 0 && (
+ <div className="space-y-2">
+ <Label className="text-muted-foreground">Query Parameters</Label>
+ <div className="border rounded-md overflow-hidden">
+ <table className="w-full text-sm">
+ <thead>
+ <tr className="bg-muted/50 border-b">
+ <th className="text-left px-3 py-1.5 text-xs font-medium text-muted-foreground w-1/3">
+ Key
+ </th>
+ <th className="text-left px-3 py-1.5 text-xs font-medium text-muted-foreground">
+ Value
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ {paramKeys.map((paramKey, idx) => {
+ const defaultValue = templateParams[paramKey] ?? ''
+ return (
+ <tr
+ key={paramKey}
+ className={idx < paramKeys.length - 1 ? 'border-b' : ''}
+ >
+ <td className="px-3 py-1.5 font-mono text-xs text-muted-foreground">
+ {paramKey}
+ </td>
+ <td className="px-1 py-1">
+ <Input
+ placeholder={String(defaultValue) || 'Value'}
+ value={testParams[paramKey] ?? ''}
+ onChange={(e) =>
+ onTestParamsChange({
+ ...testParams,
+ [paramKey]: e.target.value
+ })
+ }
+ className="h-7 text-xs border-0 bg-transparent focus-visible:ring-1 focus-visible:ring-offset-0"
+ />
+ </td>
+ </tr>
+ )
+ })}
+ </tbody>
+ </table>
+ </div>
+ </div>
+ )}
- <Button
- onClick={onRunTest}
- disabled={isTesting || hasErrors || !testInput.trim()}
- className="w-full gap-2"
- >
- {isTesting ? (
- <>
- <Loader2 className="h-4 w-4 animate-spin" />
- Testing...
- </>
- ) : (
- <>
- <Play className="h-4 w-4" />
- Run test
- </>
+ {validationData?.request?.url && (
+ <div className="space-y-2">
+ <Label className="text-muted-foreground">Request URL</Label>
+ <code className="block text-xs bg-muted p-2 rounded break-all">
+ {buildPreviewUrl()}
+ </code>
+ </div>
)}
- </Button>
- </div>
- {hasErrors && (
- <div className="p-3 rounded-lg bg-destructive/10 border border-destructive/20">
- <p className="text-sm text-destructive">Fix validation errors before testing.</p>
+ <Button
+ onClick={onRunTest}
+ disabled={isTesting || hasErrors || !testInput.trim()}
+ className="w-full gap-2"
+ >
+ {isTesting ? (
+ <>
+ <Loader2 className="h-4 w-4 animate-spin" />
+ Testing...
+ </>
+ ) : (
+ <>
+ <Play className="h-4 w-4" />
+ Run test
+ </>
+ )}
+ </Button>
</div>
- )}
- </div>
+
+ {hasErrors && (
+ <div className="p-3 rounded-lg bg-destructive/10 border border-destructive/20">
+ <p className="text-sm text-destructive">Fix validation errors before testing.</p>
+ </div>
+ )}
+ </div>
</ResizablePanel>
<ResizableHandle className="hover:bg-primary/20 active:bg-primary/30 transition-colors data-[resize-handle-state=drag]:bg-primary/30" />
{/* Test Result */}
<ResizablePanel defaultSize={70} minSize={30}>
- <div className="h-full p-4 bg-muted/20 overflow-y-auto">
- <div className="h-full flex flex-col">
- <div className="shrink-0 flex items-center justify-between mb-4">
- {testResult?.duration !== undefined && testResult.duration > 0 && (
- <Badge variant="secondary" className="text-xs">
- {testResult.duration}ms
- </Badge>
- )}
- </div>
+ <div className="h-full p-4 bg-muted/20 overflow-y-auto">
+ <div className="h-full flex flex-col">
+ <div className="shrink-0 flex items-center justify-between mb-4">
+ {testResult?.duration !== undefined && testResult.duration > 0 && (
+ <Badge variant="secondary" className="text-xs">
+ {testResult.duration}ms
+ </Badge>
+ )}
+ </div>
- {!testResult ? (
- <div className="flex-1 flex items-center justify-center">
- <div className="text-center text-muted-foreground">
- <FlaskConical className="h-12 w-12 mx-auto mb-4 opacity-20" />
- <p className="text-sm">Run a test to see the response here.</p>
+ {!testResult ? (
+ <div className="flex-1 flex items-center justify-center">
+ <div className="text-center text-muted-foreground">
+ <FlaskConical className="h-12 w-12 mx-auto mb-4 opacity-20" />
+ <p className="text-sm">Run a test to see the response here.</p>
+ </div>
</div>
- </div>
- ) : (
- <div className="flex-1 min-h-0 flex flex-col gap-4">
- <div
- className={`shrink-0 p-2 rounded-lg border ${
- testResult.success
- ? 'bg-emerald-500/10 border-emerald-500/20'
- : 'bg-destructive/10 border-destructive/20'
- }`}
- >
- <div className="flex items-center gap-2">
- {testResult.success ? (
- <>
- <CheckCircle2 className="h-5 w-5 text-emerald-500" />
- <span className="font-medium text-emerald-600">Request Successful</span>
- </>
- ) : (
- <>
- <XCircle className="h-5 w-5 text-destructive" />
- <span className="font-medium text-destructive">Request Failed</span>
- </>
+ ) : (
+ <div className="flex-1 min-h-0 flex flex-col gap-4">
+ <div
+ className={`shrink-0 p-2 rounded-lg border ${
+ testResult.success
+ ? 'bg-emerald-500/10 border-emerald-500/20'
+ : 'bg-destructive/10 border-destructive/20'
+ }`}
+ >
+ <div className="flex items-center gap-2">
+ {testResult.success ? (
+ <>
+ <CheckCircle2 className="h-5 w-5 text-emerald-500" />
+ <span className="font-medium text-emerald-600">Request Successful</span>
+ </>
+ ) : (
+ <>
+ <XCircle className="h-5 w-5 text-destructive" />
+ <span className="font-medium text-destructive">Request Failed</span>
+ </>
+ )}
+ </div>
+ {testResult.error && (
+ <p className="text-sm text-destructive mt-1">{testResult.error}</p>
)}
</div>
- {testResult.error && (
- <p className="text-sm text-destructive mt-1">{testResult.error}</p>
- )}
- </div>
- {(testResult?.data?.raw_results != null || testResult?.data?.results != null) && (
- <ResizablePanelGroup direction="vertical" className="flex-1 min-h-0">
- {testResult?.data?.raw_results != null && (
- <>
+ {(testResult?.data?.raw_results != null || testResult?.data?.results != null) && (
+ <ResizablePanelGroup direction="vertical" className="flex-1 min-h-0">
+ {testResult?.data?.raw_results != null && (
+ <>
+ <ResizablePanel defaultSize={50} minSize={20}>
+ <div className="h-full flex flex-col">
+ <Label className="shrink-0 mb-2 block">Raw response</Label>
+ <div className="flex-1 min-h-0 rounded-md border overflow-hidden">
+ <JsonViewer data={testResult.data.raw_results} />
+ </div>
+ </div>
+ </ResizablePanel>
+ {testResult?.data?.results != null && (
+ <ResizableHandle className="my-2 hover:bg-primary/20 active:bg-primary/30 transition-colors data-[resize-handle-state=drag]:bg-primary/30" />
+ )}
+ </>
+ )}
+ {testResult?.data?.results != null && (
<ResizablePanel defaultSize={50} minSize={20}>
<div className="h-full flex flex-col">
- <Label className="shrink-0 mb-2 block">Raw response</Label>
+ <Label className="shrink-0 mb-2 block">Inserted nodes</Label>
<div className="flex-1 min-h-0 rounded-md border overflow-hidden">
- <JsonViewer data={testResult.data.raw_results} />
+ <JsonViewer data={testResult.data.results} />
</div>
</div>
</ResizablePanel>
- {testResult?.data?.results != null && (
- <ResizableHandle className="my-2 hover:bg-primary/20 active:bg-primary/30 transition-colors data-[resize-handle-state=drag]:bg-primary/30" />
- )}
- </>
- )}
- {testResult?.data?.results != null && (
- <ResizablePanel defaultSize={50} minSize={20}>
- <div className="h-full flex flex-col">
- <Label className="shrink-0 mb-2 block">Inserted nodes</Label>
- <div className="flex-1 min-h-0 rounded-md border overflow-hidden">
- <JsonViewer data={testResult.data.results} />
- </div>
- </div>
- </ResizablePanel>
- )}
- </ResizablePanelGroup>
- )}
- </div>
- )}
+ )}
+ </ResizablePanelGroup>
+ )}
+ </div>
+ )}
+ </div>
</div>
- </div>
</ResizablePanel>
</ResizablePanelGroup>
)
diff --git a/flowsint-app/src/components/terminal/xterm-terminal.tsx b/flowsint-app/src/components/terminal/xterm-terminal.tsx
index 612e9c39..8ef4bc8f 100644
--- a/flowsint-app/src/components/terminal/xterm-terminal.tsx
+++ b/flowsint-app/src/components/terminal/xterm-terminal.tsx
@@ -66,7 +66,7 @@ export const XTermTerminal = forwardRef<TerminalHandle, XTermTerminalProps>(
brightBlue: '#3b82f6',
brightMagenta: '#a855f7',
brightCyan: '#06b6d4',
- brightWhite: '#171717',
+ brightWhite: '#171717'
}
// Dark theme colors
@@ -92,11 +92,12 @@ export const XTermTerminal = forwardRef<TerminalHandle, XTermTerminalProps>(
brightBlue: '#60a5fa',
brightMagenta: '#c084fc',
brightCyan: '#22d3ee',
- brightWhite: '#fafafa',
+ brightWhite: '#fafafa'
}
const terminal = new Terminal({
- fontFamily: '"Fira Code", "JetBrains Mono", "Cascadia Code", Menlo, Monaco, "Courier New", monospace',
+ fontFamily:
+ '"Fira Code", "JetBrains Mono", "Cascadia Code", Menlo, Monaco, "Courier New", monospace',
fontSize: 13,
lineHeight: 1.4,
cursorBlink: false,
@@ -106,7 +107,7 @@ export const XTermTerminal = forwardRef<TerminalHandle, XTermTerminalProps>(
scrollback: 10000,
convertEol: true,
disableStdin: true,
- allowTransparency: false,
+ allowTransparency: false
})
// Setup addons
diff --git a/flowsint-app/src/components/tutorial/index.ts b/flowsint-app/src/components/tutorial/index.ts
index baf1d84a..e34d39ac 100644
--- a/flowsint-app/src/components/tutorial/index.ts
+++ b/flowsint-app/src/components/tutorial/index.ts
@@ -1,3 +1,3 @@
-export { TutorialProvider } from './tutorial-provider';
-export { useTutorial } from './use-tutorial';
-export { tutorialSteps, getStepsForRoute, hasStepsForRoute } from './tutorial-steps';
+export { TutorialProvider } from './tutorial-provider'
+export { useTutorial } from './use-tutorial'
+export { tutorialSteps, getStepsForRoute, hasStepsForRoute } from './tutorial-steps'
diff --git a/flowsint-app/src/components/tutorial/tutorial-provider.tsx b/flowsint-app/src/components/tutorial/tutorial-provider.tsx
index a5f4be73..607e7e51 100644
--- a/flowsint-app/src/components/tutorial/tutorial-provider.tsx
+++ b/flowsint-app/src/components/tutorial/tutorial-provider.tsx
@@ -1,101 +1,107 @@
-import React, { createContext, useCallback, useEffect, useState } from 'react';
-import Joyride, { CallBackProps, STATUS, Step } from 'react-joyride';
-import { useLocation } from '@tanstack/react-router';
-import { getStepsForRoute } from './tutorial-steps';
+import React, { createContext, useCallback, useEffect, useState } from 'react'
+import Joyride, { CallBackProps, STATUS, Step } from 'react-joyride'
+import { useLocation } from '@tanstack/react-router'
+import { getStepsForRoute } from './tutorial-steps'
interface TutorialContextValue {
- startTutorial: () => void;
- stopTutorial: () => void;
- resetTutorial: () => void;
- isRunning: boolean;
+ startTutorial: () => void
+ stopTutorial: () => void
+ resetTutorial: () => void
+ isRunning: boolean
}
-export const TutorialContext = createContext<TutorialContextValue | null>(null);
+export const TutorialContext = createContext<TutorialContextValue | null>(null)
-const STORAGE_KEY = 'flowsint-tutorial-completed';
+const STORAGE_KEY = 'flowsint-tutorial-completed'
interface TutorialProviderProps {
- children: React.ReactNode;
+ children: React.ReactNode
}
export function TutorialProvider({ children }: TutorialProviderProps) {
- const location = useLocation();
- const [run, setRun] = useState(false);
- const [steps, setSteps] = useState<Step[]>([]);
- const [stepIndex, setStepIndex] = useState(0);
+ const location = useLocation()
+ const [run, setRun] = useState(false)
+ const [steps, setSteps] = useState<Step[]>([])
+ const [stepIndex, setStepIndex] = useState(0)
const getCompletedRoutes = useCallback((): Set<string> => {
try {
- const stored = localStorage.getItem(STORAGE_KEY);
- return stored ? new Set(JSON.parse(stored)) : new Set();
+ const stored = localStorage.getItem(STORAGE_KEY)
+ return stored ? new Set(JSON.parse(stored)) : new Set()
} catch {
- return new Set();
+ return new Set()
}
- }, []);
+ }, [])
- const markRouteAsCompleted = useCallback((route: string) => {
- const completed = getCompletedRoutes();
- completed.add(route);
- localStorage.setItem(STORAGE_KEY, JSON.stringify([...completed]));
- }, [getCompletedRoutes]);
+ const markRouteAsCompleted = useCallback(
+ (route: string) => {
+ const completed = getCompletedRoutes()
+ completed.add(route)
+ localStorage.setItem(STORAGE_KEY, JSON.stringify([...completed]))
+ },
+ [getCompletedRoutes]
+ )
const startTutorial = useCallback(() => {
- const currentPath = location.pathname;
- const routeSteps = getStepsForRoute(currentPath);
+ const currentPath = location.pathname
+ const routeSteps = getStepsForRoute(currentPath)
if (routeSteps.length > 0) {
- setSteps(routeSteps);
- setStepIndex(0);
- setRun(true);
+ setSteps(routeSteps)
+ setStepIndex(0)
+ setRun(true)
}
- }, [location.pathname]);
+ }, [location.pathname])
const stopTutorial = useCallback(() => {
- setRun(false);
- }, []);
+ setRun(false)
+ }, [])
const resetTutorial = useCallback(() => {
- localStorage.removeItem(STORAGE_KEY);
- setRun(false);
- setSteps([]);
- setStepIndex(0);
- }, []);
+ localStorage.removeItem(STORAGE_KEY)
+ setRun(false)
+ setSteps([])
+ setStepIndex(0)
+ }, [])
useEffect(() => {
- const currentPath = location.pathname;
- const routeSteps = getStepsForRoute(currentPath);
+ const currentPath = location.pathname
+ const routeSteps = getStepsForRoute(currentPath)
if (routeSteps.length > 0) {
- const completed = getCompletedRoutes();
+ const completed = getCompletedRoutes()
if (!completed.has(currentPath)) {
- setSteps(routeSteps);
- setStepIndex(0);
+ setSteps(routeSteps)
+ setStepIndex(0)
setTimeout(() => {
- setRun(true);
- }, 500);
+ setRun(true)
+ }, 500)
}
} else {
- setRun(false);
+ setRun(false)
}
- }, [location.pathname, getCompletedRoutes]);
+ }, [location.pathname, getCompletedRoutes])
- const handleJoyrideCallback = useCallback((data: CallBackProps) => {
- const { status } = data;
- const finishedStatuses: string[] = [STATUS.FINISHED, STATUS.SKIPPED];
+ const handleJoyrideCallback = useCallback(
+ (data: CallBackProps) => {
+ const { status } = data
+ const finishedStatuses: string[] = [STATUS.FINISHED, STATUS.SKIPPED]
- if (finishedStatuses.includes(status)) {
- setRun(false);
- markRouteAsCompleted(location.pathname);
- }
- }, [location.pathname, markRouteAsCompleted]);
+ if (finishedStatuses.includes(status)) {
+ setRun(false)
+ markRouteAsCompleted(location.pathname)
+ }
+ },
+ [location.pathname, markRouteAsCompleted]
+ )
const contextValue: TutorialContextValue = {
startTutorial,
stopTutorial,
resetTutorial,
- isRunning: run,
- };
+ isRunning: run
+ }
return (
<TutorialContext.Provider value={contextValue}>
@@ -123,5 +129,5 @@ export function TutorialProvider({ children }: TutorialProviderProps) {
/> */}
{children}
</TutorialContext.Provider>
- );
+ )
}
diff --git a/flowsint-app/src/components/tutorial/tutorial-steps.ts b/flowsint-app/src/components/tutorial/tutorial-steps.ts
index d36ee921..b4d59a5e 100644
--- a/flowsint-app/src/components/tutorial/tutorial-steps.ts
+++ b/flowsint-app/src/components/tutorial/tutorial-steps.ts
@@ -1,87 +1,91 @@
-import { Step } from 'react-joyride';
+import { Step } from 'react-joyride'
export const tutorialSteps: Record<string, Step[]> = {
'/dashboard': [
{
target: '[data-tour-id="welcome"]',
content: 'Welcome to Flowsint! This tutorial will guide you through the main features.',
- disableBeacon: true,
+ disableBeacon: true
},
{
target: '[data-tour-id="navigation"]',
- content: 'Use this navigation bar to access different sections.',
- },
+ content: 'Use this navigation bar to access different sections.'
+ }
],
'/dashboard/flows/$flowId': [
{
target: '[data-tour-id="flow-sidebar"]',
content: 'Welcome to the flow editor! Use the sidebar to drag enrichers into your flow.',
- disableBeacon: true,
+ disableBeacon: true
},
{
target: '[data-tour-id="flow-canvas"]',
- content: 'The canvas is your workspace. Drag and drop enrichers here and connect them to create your data pipeline.',
+ content:
+ 'The canvas is your workspace. Drag and drop enrichers here and connect them to create your data pipeline.'
},
{
target: '[data-tour-id="add-type-node"]',
- content: 'Start by adding a Type node to define the input data type for your flow.',
+ content: 'Start by adding a Type node to define the input data type for your flow.'
},
{
target: '[data-tour-id="add-enricher-node"]',
- content: 'Then add enrichers to process your data. Connect them by clicking on the connection points.',
+ content:
+ 'Then add enrichers to process your data. Connect them by clicking on the connection points.'
},
{
target: '[data-tour-id="node-params"]',
- content: 'Double-click on a node or right-click to configure its parameters.',
+ content: 'Double-click on a node or right-click to configure its parameters.'
},
{
target: '[data-tour-id="layout-button"]',
- content: 'Use the auto-layout button to organize your nodes neatly.',
+ content: 'Use the auto-layout button to organize your nodes neatly.'
},
{
target: '[data-tour-id="save-button"]',
- content: 'Save your flow to reuse and share it.',
+ content: 'Save your flow to reuse and share it.'
},
{
target: '[data-tour-id="compute-button"]',
- content: 'Use the "Compute" button to simulate your flow execution and visualize the data path.',
+ content:
+ 'Use the "Compute" button to simulate your flow execution and visualize the data path.'
},
{
target: '[data-tour-id="simulation-controls"]',
- content: 'Control the simulation with Pause, Skip, and Reset buttons. Adjust the speed as needed.',
- },
+ content:
+ 'Control the simulation with Pause, Skip, and Reset buttons. Adjust the speed as needed.'
+ }
],
'/dashboard/flows': [
{
target: '[data-tour-id="create-flow"]',
content: 'Click here to create a new data enrichment flow.',
- disableBeacon: true,
+ disableBeacon: true
},
{
target: '[data-tour-id="flow-list"]',
- content: 'All your flows are listed here. Click on a flow to edit or launch it.',
- },
+ content: 'All your flows are listed here. Click on a flow to edit or launch it.'
+ }
],
'/dashboard/investigations': [
{
target: '[data-tour-id="create-investigation"]',
content: 'Start a new investigation here.',
- disableBeacon: true,
+ disableBeacon: true
},
{
target: '[data-tour-id="investigation-list"]',
- content: 'Manage your ongoing investigations and access their relationship graphs.',
- },
- ],
-};
+ content: 'Manage your ongoing investigations and access their relationship graphs.'
+ }
+ ]
+}
export function hasStepsForRoute(route: string): boolean {
- return route in tutorialSteps;
+ return route in tutorialSteps
}
export function getStepsForRoute(route: string): Step[] {
- return tutorialSteps[route] || [];
+ return tutorialSteps[route] || []
}
diff --git a/flowsint-app/src/components/tutorial/use-tutorial.ts b/flowsint-app/src/components/tutorial/use-tutorial.ts
index 43925447..c05b8e02 100644
--- a/flowsint-app/src/components/tutorial/use-tutorial.ts
+++ b/flowsint-app/src/components/tutorial/use-tutorial.ts
@@ -1,12 +1,12 @@
-import { useContext } from 'react';
-import { TutorialContext } from './tutorial-provider';
+import { useContext } from 'react'
+import { TutorialContext } from './tutorial-provider'
export function useTutorial() {
- const context = useContext(TutorialContext);
+ const context = useContext(TutorialContext)
if (!context) {
- throw new Error('useTutorial must be used within TutorialProvider');
+ throw new Error('useTutorial must be used within TutorialProvider')
}
- return context;
+ return context
}
diff --git a/flowsint-app/src/components/ui/avatar.tsx b/flowsint-app/src/components/ui/avatar.tsx
index d9dedf34..fbdf5b3a 100644
--- a/flowsint-app/src/components/ui/avatar.tsx
+++ b/flowsint-app/src/components/ui/avatar.tsx
@@ -13,7 +13,7 @@ const SIZES = {
sm: { root: 'size-6', text: 'text-[10px]' },
md: { root: 'size-7', text: 'text-xs' },
lg: { root: 'size-8', text: 'text-sm' },
- xl: { root: 'size-10', text: 'text-base' },
+ xl: { root: 'size-10', text: 'text-base' }
} as const
type AvatarSize = keyof typeof SIZES
@@ -89,11 +89,7 @@ function AvatarGroup({ users, size = 'sm', max, className }: AvatarGroupProps) {
<Tooltip key={user?.id ?? i}>
<TooltipTrigger asChild>
<div>
- <UserAvatar
- user={user}
- size={size}
- className="border border-background"
- />
+ <UserAvatar user={user} size={size} className="border border-background" />
</div>
</TooltipTrigger>
<TooltipContent>{getDisplayName(user)}</TooltipContent>
diff --git a/flowsint-app/src/components/ui/popover.tsx b/flowsint-app/src/components/ui/popover.tsx
index 0df056f6..5169b330 100644
--- a/flowsint-app/src/components/ui/popover.tsx
+++ b/flowsint-app/src/components/ui/popover.tsx
@@ -1,23 +1,19 @@
-import * as React from "react"
-import * as PopoverPrimitive from "@radix-ui/react-popover"
+import * as React from 'react'
+import * as PopoverPrimitive from '@radix-ui/react-popover'
-import { cn } from "@/lib/utils"
+import { cn } from '@/lib/utils'
-function Popover({
- ...props
-}: React.ComponentProps<typeof PopoverPrimitive.Root>) {
+function Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>) {
return <PopoverPrimitive.Root data-slot="popover" {...props} />
}
-function PopoverTrigger({
- ...props
-}: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {
+function PopoverTrigger({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {
return <PopoverPrimitive.Trigger data-slot="popover-trigger" {...props} />
}
function PopoverContent({
className,
- align = "center",
+ align = 'center',
sideOffset = 4,
...props
}: React.ComponentProps<typeof PopoverPrimitive.Content>) {
@@ -28,7 +24,7 @@ function PopoverContent({
align={align}
sideOffset={sideOffset}
className={cn(
- "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",
+ 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden',
className
)}
{...props}
@@ -37,40 +33,29 @@ function PopoverContent({
)
}
-function PopoverAnchor({
- ...props
-}: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {
+function PopoverAnchor({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {
return <PopoverPrimitive.Anchor data-slot="popover-anchor" {...props} />
}
-function PopoverHeader({ className, ...props }: React.ComponentProps<"div">) {
+function PopoverHeader({ className, ...props }: React.ComponentProps<'div'>) {
return (
<div
data-slot="popover-header"
- className={cn("flex flex-col gap-1 text-sm", className)}
+ className={cn('flex flex-col gap-1 text-sm', className)}
{...props}
/>
)
}
-function PopoverTitle({ className, ...props }: React.ComponentProps<"h2">) {
- return (
- <div
- data-slot="popover-title"
- className={cn("font-medium", className)}
- {...props}
- />
- )
+function PopoverTitle({ className, ...props }: React.ComponentProps<'h2'>) {
+ return <div data-slot="popover-title" className={cn('font-medium', className)} {...props} />
}
-function PopoverDescription({
- className,
- ...props
-}: React.ComponentProps<"p">) {
+function PopoverDescription({ className, ...props }: React.ComponentProps<'p'>) {
return (
<p
data-slot="popover-description"
- className={cn("text-muted-foreground", className)}
+ className={cn('text-muted-foreground', className)}
{...props}
/>
)
@@ -83,5 +68,5 @@ export {
PopoverAnchor,
PopoverHeader,
PopoverTitle,
- PopoverDescription,
+ PopoverDescription
}
diff --git a/flowsint-app/src/components/ui/resizable-container.tsx b/flowsint-app/src/components/ui/resizable-container.tsx
index 7406a5fe..6fc8c5ef 100644
--- a/flowsint-app/src/components/ui/resizable-container.tsx
+++ b/flowsint-app/src/components/ui/resizable-container.tsx
@@ -99,7 +99,17 @@ export const ResizableContainer: React.FC<ResizableContainerProps> = ({
setSize({ width: newWidth, height: newHeight })
onResize?.(newWidth, newHeight)
},
- [isResizing, resizeDirection, startPos, startDimensions, minWidth, minHeight, maxWidth, maxHeight, onResize]
+ [
+ isResizing,
+ resizeDirection,
+ startPos,
+ startDimensions,
+ minWidth,
+ minHeight,
+ maxWidth,
+ maxHeight,
+ onResize
+ ]
)
const handleMouseUp = useCallback(() => {
diff --git a/flowsint-app/src/components/ui/tag-input.tsx b/flowsint-app/src/components/ui/tag-input.tsx
index 996d4e4d..1528e677 100644
--- a/flowsint-app/src/components/ui/tag-input.tsx
+++ b/flowsint-app/src/components/ui/tag-input.tsx
@@ -30,8 +30,7 @@ export function TagInput({
const filteredOptions = options?.filter(
(opt) =>
- !value.includes(opt.value) &&
- opt.label.toLowerCase().includes(inputValue.toLowerCase())
+ !value.includes(opt.value) && opt.label.toLowerCase().includes(inputValue.toLowerCase())
)
const showDropdown = isOpen && filteredOptions && filteredOptions.length > 0
@@ -81,14 +80,10 @@ export function TagInput({
if (showDropdown) {
if (e.key === 'ArrowDown') {
e.preventDefault()
- setActiveIndex((prev) =>
- prev < filteredOptions!.length - 1 ? prev + 1 : 0
- )
+ setActiveIndex((prev) => (prev < filteredOptions!.length - 1 ? prev + 1 : 0))
} else if (e.key === 'ArrowUp') {
e.preventDefault()
- setActiveIndex((prev) =>
- prev > 0 ? prev - 1 : filteredOptions!.length - 1
- )
+ setActiveIndex((prev) => (prev > 0 ? prev - 1 : filteredOptions!.length - 1))
} else if (e.key === 'Escape') {
setIsOpen(false)
setActiveIndex(-1)
diff --git a/flowsint-app/src/components/ui/tags-input.tsx b/flowsint-app/src/components/ui/tags-input.tsx
index ff998a1c..341e2159 100644
--- a/flowsint-app/src/components/ui/tags-input.tsx
+++ b/flowsint-app/src/components/ui/tags-input.tsx
@@ -1,20 +1,20 @@
-import * as React from 'react';
-import { X } from 'lucide-react';
-import { Badge } from '@/components/ui/badge';
-import { Button } from '@/components/ui/button';
-import { Input } from '@/components/ui/input';
-import { cn } from '@/lib/utils';
+import * as React from 'react'
+import { X } from 'lucide-react'
+import { Badge } from '@/components/ui/badge'
+import { Button } from '@/components/ui/button'
+import { Input } from '@/components/ui/input'
+import { cn } from '@/lib/utils'
interface TagsInputProps {
- id?: string | undefined;
- value: string[];
- onChange: (tags: string[]) => void;
- placeholder?: string;
- disabled?: boolean;
- orientation?: 'vertical' | 'horizontal';
- variant?: 'full' | 'compact';
- className?: string | undefined;
-};
+ id?: string | undefined
+ value: string[]
+ onChange: (tags: string[]) => void
+ placeholder?: string
+ disabled?: boolean
+ orientation?: 'vertical' | 'horizontal'
+ variant?: 'full' | 'compact'
+ className?: string | undefined
+}
function TagsInput({
id,
@@ -27,35 +27,33 @@ function TagsInput({
variant = 'compact',
...props
}: TagsInputProps) {
- const [inputValue, setInputValue] = React.useState("");
+ const [inputValue, setInputValue] = React.useState('')
const addTag = () => {
- const trimmed = inputValue.trim();
+ const trimmed = inputValue.trim()
if (trimmed && !value.includes(trimmed)) {
- onChange([...value, trimmed]);
+ onChange([...value, trimmed])
}
- setInputValue("");
- };
+ setInputValue('')
+ }
const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {
- if (e.key === "Enter" || e.key === ",") {
- e.preventDefault();
- addTag();
+ if (e.key === 'Enter' || e.key === ',') {
+ e.preventDefault()
+ addTag()
}
- };
+ }
const removeTag = (tagToRemove: string) => {
- onChange(value.filter((tag) => tag !== tagToRemove));
- };
+ onChange(value.filter((tag) => tag !== tagToRemove))
+ }
return (
<div
className={cn(
- "flex items-center gap-2 rounded-md text-sm",
- orientation === 'horizontal'
- ? "flex-wrap items-center gap-2"
- : "flex-col items-end gap-2",
- disabled && "cursor-not-allowed opacity-50",
+ 'flex items-center gap-2 rounded-md text-sm',
+ orientation === 'horizontal' ? 'flex-wrap items-center gap-2' : 'flex-col items-end gap-2',
+ disabled && 'cursor-not-allowed opacity-50',
className
)}
{...props}
@@ -86,7 +84,8 @@ function TagsInput({
onBlur={addTag}
className="w-full bg-transparent outline-none placeholder:text-muted-foreground/30 focus:bg-muted/20 px-1 rounded transition-colors"
placeholder={placeholder ?? 'Empty'}
- />) : (
+ />
+ ) : (
<Input
id={id}
type="text"
@@ -97,9 +96,8 @@ function TagsInput({
placeholder={placeholder}
/>
)}
-
</div>
- );
+ )
}
-export { TagsInput }
\ No newline at end of file
+export { TagsInput }
diff --git a/flowsint-app/src/env.d.ts b/flowsint-app/src/env.d.ts
index 8af8a338..be2fddb6 100644
--- a/flowsint-app/src/env.d.ts
+++ b/flowsint-app/src/env.d.ts
@@ -1,2 +1,2 @@
/// <reference types="vite/client" />
-declare module '@tanstack/react-table';
+declare module '@tanstack/react-table'
diff --git a/flowsint-app/src/hooks/use-can.ts b/flowsint-app/src/hooks/use-can.ts
index dfb82ddb..3fd9bdc2 100644
--- a/flowsint-app/src/hooks/use-can.ts
+++ b/flowsint-app/src/hooks/use-can.ts
@@ -2,12 +2,7 @@ import { useMemo } from 'react'
import { useLoaderData } from '@tanstack/react-router'
import type { InvestigationRole } from '@/types'
-type Action =
- | 'read'
- | 'create'
- | 'update'
- | 'delete'
- | 'manage'
+type Action = 'read' | 'create' | 'update' | 'delete' | 'manage'
export type Permissions = {
can: (action: Action) => boolean
@@ -71,7 +66,7 @@ export function usePermissions(): Permissions {
const role = useLoaderData({
from: '/_auth/dashboard/investigations/$investigationId',
select: (d: any) => d?.investigation?.current_user_role ?? null,
- strict: false,
+ strict: false
}) as InvestigationRole | null | undefined
return useCan(role)
}
diff --git a/flowsint-app/src/hooks/use-create-analysis.ts b/flowsint-app/src/hooks/use-create-analysis.ts
index 7dc51772..cb3f2ee9 100644
--- a/flowsint-app/src/hooks/use-create-analysis.ts
+++ b/flowsint-app/src/hooks/use-create-analysis.ts
@@ -1,35 +1,34 @@
-import { analysisService } from "@/api/analysis-service"
-import { Analysis } from "@/types"
-import { useMutation, useQueryClient } from "@tanstack/react-query"
+import { analysisService } from '@/api/analysis-service'
+import { Analysis } from '@/types'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import default_content from '@/components/analyses/default_content.json'
-import { queryKeys } from "@/api/query-keys"
-import { toast } from "sonner"
+import { queryKeys } from '@/api/query-keys'
+import { toast } from 'sonner'
export const useCreateAnalysis = (investigationId: string, onAnalysisCreate?: any) => {
+ const queryClient = useQueryClient()
- const queryClient = useQueryClient()
-
- return useMutation({
- mutationFn: async () => {
- const newAnalysis: Partial<Analysis> = {
- title: 'Untitled Analysis',
- investigation_id: investigationId,
- content: default_content
- }
- const res = await analysisService.create(JSON.stringify(newAnalysis))
- return res
- },
- onSuccess: async () => {
- queryClient.invalidateQueries({
- queryKey: queryKeys.analyses.byInvestigation(investigationId || '')
- })
- onAnalysisCreate?.(investigationId)
- toast.success('New analysis created')
- },
- onError: (error) => {
- toast.error(
- 'Failed to create analysis: ' + (error instanceof Error ? error.message : 'Unknown error')
- )
- }
- })
-}
\ No newline at end of file
+ return useMutation({
+ mutationFn: async () => {
+ const newAnalysis: Partial<Analysis> = {
+ title: 'Untitled Analysis',
+ investigation_id: investigationId,
+ content: default_content
+ }
+ const res = await analysisService.create(JSON.stringify(newAnalysis))
+ return res
+ },
+ onSuccess: async () => {
+ queryClient.invalidateQueries({
+ queryKey: queryKeys.analyses.byInvestigation(investigationId || '')
+ })
+ onAnalysisCreate?.(investigationId)
+ toast.success('New analysis created')
+ },
+ onError: (error) => {
+ toast.error(
+ 'Failed to create analysis: ' + (error instanceof Error ? error.message : 'Unknown error')
+ )
+ }
+ })
+}
diff --git a/flowsint-app/src/hooks/use-events.ts b/flowsint-app/src/hooks/use-events.ts
index ab7d8aa5..c61fc325 100644
--- a/flowsint-app/src/hooks/use-events.ts
+++ b/flowsint-app/src/hooks/use-events.ts
@@ -7,7 +7,6 @@ import { connectSSE } from '@/api/sse'
const API_URL = import.meta.env.VITE_API_URL ?? ''
-
export function useEvents(sketch_id: string | undefined) {
const [liveLogs, setLiveLogs] = useState<Event[]>([])
const token = useAuthStore((s) => s.token)
@@ -15,7 +14,7 @@ export function useEvents(sketch_id: string | undefined) {
const { data: previousLogs = [], refetch } = useQuery({
queryKey: queryKeys.logs.bySketch(sketch_id as string),
queryFn: () => logService.get(sketch_id as string),
- enabled: !!sketch_id,
+ enabled: !!sketch_id
})
const handleRefresh = () => {
@@ -42,16 +41,13 @@ export function useEvents(sketch_id: string | undefined) {
} catch (error) {
console.error('[useSketchEvents] Failed to parse log payload:', error, raw.data)
}
- },
+ }
})
return dispose
}, [sketch_id, token])
- const logs = useMemo(
- () => [...previousLogs, ...liveLogs].slice(-100),
- [previousLogs, liveLogs]
- )
+ const logs = useMemo(() => [...previousLogs, ...liveLogs].slice(-100), [previousLogs, liveLogs])
return {
logs,
diff --git a/flowsint-app/src/hooks/use-graph-refresh.ts b/flowsint-app/src/hooks/use-graph-refresh.ts
index 32049a01..0080769c 100644
--- a/flowsint-app/src/hooks/use-graph-refresh.ts
+++ b/flowsint-app/src/hooks/use-graph-refresh.ts
@@ -52,7 +52,7 @@ export function useGraphRefresh(sketch_id: string | undefined) {
} catch (error) {
console.error('[useGraphRefresh] Failed to parse status payload:', error, raw.data)
}
- },
+ }
})
return dispose
diff --git a/flowsint-app/src/hooks/use-keyboard.ts b/flowsint-app/src/hooks/use-keyboard.ts
index e526e15a..114c8bde 100644
--- a/flowsint-app/src/hooks/use-keyboard.ts
+++ b/flowsint-app/src/hooks/use-keyboard.ts
@@ -1,31 +1,27 @@
-import { useEffect } from "react";
+import { useEffect } from 'react'
-type Callback = (event: KeyboardEvent) => void;
+type Callback = (event: KeyboardEvent) => void
-export function useKeyboard(
- targetKey?: string,
- onKeyDown?: Callback,
- onKeyUp?: Callback
-) {
- useEffect(() => {
- function handleKeyDown(e: KeyboardEvent) {
- if (!targetKey || e.key === targetKey) {
- onKeyDown?.(e);
- }
- }
+export function useKeyboard(targetKey?: string, onKeyDown?: Callback, onKeyUp?: Callback) {
+ useEffect(() => {
+ function handleKeyDown(e: KeyboardEvent) {
+ if (!targetKey || e.key === targetKey) {
+ onKeyDown?.(e)
+ }
+ }
- function handleKeyUp(e: KeyboardEvent) {
- if (!targetKey || e.key === targetKey) {
- onKeyUp?.(e);
- }
- }
+ function handleKeyUp(e: KeyboardEvent) {
+ if (!targetKey || e.key === targetKey) {
+ onKeyUp?.(e)
+ }
+ }
- window.addEventListener("keydown", handleKeyDown);
- window.addEventListener("keyup", handleKeyUp);
+ window.addEventListener('keydown', handleKeyDown)
+ window.addEventListener('keyup', handleKeyUp)
- return () => {
- window.removeEventListener("keydown", handleKeyDown);
- window.removeEventListener("keyup", handleKeyUp);
- };
- }, [targetKey, onKeyDown, onKeyUp]);
+ return () => {
+ window.removeEventListener('keydown', handleKeyDown)
+ window.removeEventListener('keyup', handleKeyUp)
+ }
+ }, [targetKey, onKeyDown, onKeyUp])
}
diff --git a/flowsint-app/src/hooks/use-layout.ts b/flowsint-app/src/hooks/use-layout.ts
index 5621f75e..d79ee84e 100644
--- a/flowsint-app/src/hooks/use-layout.ts
+++ b/flowsint-app/src/hooks/use-layout.ts
@@ -10,7 +10,7 @@ interface UseLayoutProps {
interface LayoutOptions {
layoutType: 'force' | 'hierarchy'
- nodes: GraphNode[],
+ nodes: GraphNode[]
edges: GraphEdge[]
}
@@ -18,16 +18,15 @@ export function useLayout({
forceSettings,
containerSize,
saveAllNodePositions,
- onProgress,
+ onProgress
}: UseLayoutProps) {
const workerRef = useRef<Worker | null>(null)
// Initialize worker once
useEffect(() => {
- workerRef.current = new Worker(
- new URL('../workers/layout.worker.ts', import.meta.url),
- { type: 'module' }
- )
+ workerRef.current = new Worker(new URL('../workers/layout.worker.ts', import.meta.url), {
+ type: 'module'
+ })
return () => {
// Cleanup worker on unmount
workerRef.current?.terminate()
@@ -90,11 +89,11 @@ export function useLayout({
if (layoutType === 'hierarchy') {
worker.postMessage({
type: 'dagre',
- nodes: nodes.map(n => ({ ...n })), // Clone to avoid reference issues
- edges: edges.map(e => ({ ...e })),
+ nodes: nodes.map((n) => ({ ...n })), // Clone to avoid reference issues
+ edges: edges.map((e) => ({ ...e })),
options: {
- dagLevelDistance: forceSettings.dagLevelDistance?.value ?? 50,
- },
+ dagLevelDistance: forceSettings.dagLevelDistance?.value ?? 50
+ }
})
} else {
const width = containerSize.width || 800
@@ -104,8 +103,8 @@ export function useLayout({
worker.postMessage({
type: 'force',
- nodes: nodes.map(n => ({ ...n })),
- edges: edges.map(e => ({ ...e })),
+ nodes: nodes.map((n) => ({ ...n })),
+ edges: edges.map((e) => ({ ...e })),
options: {
width,
height,
@@ -118,9 +117,9 @@ export function useLayout({
iterations: forceSettings.cooldownTicks?.value ?? 300,
collisionRadius: forceSettings.collisionRadius?.value ?? 22,
collisionStrength: forceSettings.collisionStrength?.value ?? 0.95,
- centerGravity: forceSettings.centerGravity?.value ?? 0.15,
+ centerGravity: forceSettings.centerGravity?.value ?? 0.15
// maxRadius,
- },
+ }
})
}
})
diff --git a/flowsint-app/src/hooks/use-pathfinder.ts b/flowsint-app/src/hooks/use-pathfinder.ts
index 7e9880e8..8ab636b6 100644
--- a/flowsint-app/src/hooks/use-pathfinder.ts
+++ b/flowsint-app/src/hooks/use-pathfinder.ts
@@ -5,17 +5,21 @@ export function usePathfinder() {
const workerRef = useRef<Worker | null>(null)
useEffect(() => {
- workerRef.current = new Worker(
- new URL('../workers/pathfinder.worker.ts', import.meta.url),
- { type: 'module' }
- )
+ workerRef.current = new Worker(new URL('../workers/pathfinder.worker.ts', import.meta.url), {
+ type: 'module'
+ })
return () => {
workerRef.current?.terminate()
}
}, [])
const findPath = useCallback(
- (nodes: GraphNode[], edges: GraphEdge[], sourceId: string, targetId: string): Promise<Path | null> => {
+ (
+ nodes: GraphNode[],
+ edges: GraphEdge[],
+ sourceId: string,
+ targetId: string
+ ): Promise<Path | null> => {
if (!workerRef.current) {
return Promise.reject(new Error('Pathfinder worker not initialized'))
}
@@ -45,9 +49,15 @@ export function usePathfinder() {
worker.postMessage({
nodes: nodes.map((n) => ({ id: n.id, nodeLabel: n.nodeLabel, nodeType: n.nodeType })),
- edges: edges.map((e) => ({ id: e.id, source: e.source, target: e.target, label: e.label, caption: e.caption })),
+ edges: edges.map((e) => ({
+ id: e.id,
+ source: e.source,
+ target: e.target,
+ label: e.label,
+ caption: e.caption
+ })),
sourceId,
- targetId,
+ targetId
})
})
},
diff --git a/flowsint-app/src/hooks/use-save-node-positions.ts b/flowsint-app/src/hooks/use-save-node-positions.ts
index 2dd55f40..3c8c4d28 100644
--- a/flowsint-app/src/hooks/use-save-node-positions.ts
+++ b/flowsint-app/src/hooks/use-save-node-positions.ts
@@ -16,8 +16,10 @@ export type SaveStatus = 'idle' | 'pending' | 'saving' | 'saved' | 'error'
* Handles debouncing and batch updates for all nodes
*/
export function useSaveNodePositions(sketchId?: string) {
- const [changedNodePositions, setChangedNodePositions] = useState<Map<string, NodePosition>>(new Map())
- const setNodes = useGraphStore(s => s.setNodes)
+ const [changedNodePositions, setChangedNodePositions] = useState<Map<string, NodePosition>>(
+ new Map()
+ )
+ const setNodes = useGraphStore((s) => s.setNodes)
const isStabilizingRef = useRef(false) // Start as false, mark as true only during layout regeneration
const setSaveStatus = useGraphSaveStatus((state) => state.setSaveStatus)
@@ -48,32 +50,35 @@ export function useSaveNodePositions(sketchId?: string) {
* @param nodes - Array of nodes or graphData.nodes
* @param force - Force save even if stabilizing (for layout regeneration)
*/
- const saveAllNodePositions = useCallback((nodes: any[], force = false) => {
- if (!sketchId) {
- return
- }
+ const saveAllNodePositions = useCallback(
+ (nodes: any[], force = false) => {
+ if (!sketchId) {
+ return
+ }
- if (!force && isStabilizingRef.current) {
- return
- }
+ if (!force && isStabilizingRef.current) {
+ return
+ }
- const newMap = new Map<string, NodePosition>()
+ const newMap = new Map<string, NodePosition>()
- nodes.forEach((node: any) => {
- if (node.x !== undefined && node.y !== undefined) {
- // Fix node position to prevent force simulation from moving it
- node.fx = node.x
- node.fy = node.y
- newMap.set(node.id, { x: node.x, y: node.y })
- }
- })
+ nodes.forEach((node: any) => {
+ if (node.x !== undefined && node.y !== undefined) {
+ // Fix node position to prevent force simulation from moving it
+ node.fx = node.x
+ node.fy = node.y
+ newMap.set(node.id, { x: node.x, y: node.y })
+ }
+ })
- if (newMap.size > 0) {
- setChangedNodePositions(newMap)
- setNodes(nodes)
- setSaveStatus('pending')
- }
- }, [sketchId])
+ if (newMap.size > 0) {
+ setChangedNodePositions(newMap)
+ setNodes(nodes)
+ setSaveStatus('pending')
+ }
+ },
+ [sketchId]
+ )
/**
* Clear pending changes (useful when switching sketches)
@@ -96,7 +101,8 @@ export function useSaveNodePositions(sketchId?: string) {
setSaveStatus('saving')
- sketchService.updateNodePositions(sketchId, positions)
+ sketchService
+ .updateNodePositions(sketchId, positions)
.then(() => {
setChangedNodePositions(new Map())
setSaveStatus('saved')
diff --git a/flowsint-app/src/lib/action-items.ts b/flowsint-app/src/lib/action-items.ts
index c49d4052..4724c70d 100644
--- a/flowsint-app/src/lib/action-items.ts
+++ b/flowsint-app/src/lib/action-items.ts
@@ -1,43 +1,57 @@
-export type FieldType = "text" | "date" | "email" | "number" | "select" | "textarea" | "hidden" | "tel" | "url" | "metadata" | "list"
+export type FieldType =
+ | 'text'
+ | 'date'
+ | 'email'
+ | 'number'
+ | 'select'
+ | 'textarea'
+ | 'hidden'
+ | 'tel'
+ | 'url'
+ | 'metadata'
+ | 'list'
export interface SelectOption {
- label: string
- value: string
+ label: string
+ value: string
}
export interface FormField {
- name: string
- label: string
- type: FieldType
- required: boolean
- options?: SelectOption[]
- placeholder?: string
- description?: string
+ name: string
+ label: string
+ type: FieldType
+ required: boolean
+ options?: SelectOption[]
+ placeholder?: string
+ description?: string
}
export interface ActionItem {
- id: number
- type: string
- key: string
- icon: string
- label: string
- color?: string
- fields: FormField[]
- size?: string
- label_key: string
- disabled?: boolean
- comingSoon?: boolean
- children?: ActionItem[]
- description: string
+ id: number
+ type: string
+ key: string
+ icon: string
+ label: string
+ color?: string
+ fields: FormField[]
+ size?: string
+ label_key: string
+ disabled?: boolean
+ comingSoon?: boolean
+ children?: ActionItem[]
+ description: string
}
-export function findActionItemByKey(key: string, actionItems: ActionItem[] | undefined): ActionItem | undefined {
- if (!actionItems) return
- for (const item of actionItems) {
- if (item.key === key) return item
- if (item.children) {
- const found = item.children.find(child => child.key === key)
- if (found) return found
- }
+export function findActionItemByKey(
+ key: string,
+ actionItems: ActionItem[] | undefined
+): ActionItem | undefined {
+ if (!actionItems) return
+ for (const item of actionItems) {
+ if (item.key === key) return item
+ if (item.children) {
+ const found = item.children.find((child) => child.key === key)
+ if (found) return found
}
- return undefined;
-}
\ No newline at end of file
+ }
+ return undefined
+}
diff --git a/flowsint-app/src/lib/auth-utils.ts b/flowsint-app/src/lib/auth-utils.ts
index 6d6b704f..3be29214 100644
--- a/flowsint-app/src/lib/auth-utils.ts
+++ b/flowsint-app/src/lib/auth-utils.ts
@@ -3,29 +3,29 @@ import { redirect } from '@tanstack/react-router'
import type { User } from '@/stores/auth-store'
export function requireAuth(locationHref: string) {
- const isAuth = useAuthStore.getState().isAuthenticated
- const token = useAuthStore.getState().token
+ const isAuth = useAuthStore.getState().isAuthenticated
+ const token = useAuthStore.getState().token
- if (!isAuth || !token) {
- throw redirect({
- to: '/login',
- search: {
- redirect: locationHref,
- },
- })
- }
+ if (!isAuth || !token) {
+ throw redirect({
+ to: '/login',
+ search: {
+ redirect: locationHref
+ }
+ })
+ }
}
export function isAuthenticated(): boolean {
- const isAuth = useAuthStore.getState().isAuthenticated
- const token = useAuthStore.getState().token
- return Boolean(isAuth && token)
+ const isAuth = useAuthStore.getState().isAuthenticated
+ const token = useAuthStore.getState().token
+ return Boolean(isAuth && token)
}
export function getAuthToken(): string | null {
- return useAuthStore.getState().token
+ return useAuthStore.getState().token
}
export function getUser(): User | null {
- return useAuthStore.getState().user
+ return useAuthStore.getState().user
}
diff --git a/flowsint-app/src/lib/tools.test.ts b/flowsint-app/src/lib/tools.test.ts
index 4265499a..cfaa7a16 100644
--- a/flowsint-app/src/lib/tools.test.ts
+++ b/flowsint-app/src/lib/tools.test.ts
@@ -16,7 +16,7 @@ const makeNode = (id: string, overrides?: Partial<GraphNode>): GraphNode => ({
nodeMetadata: {},
x: 0,
y: 0,
- ...overrides,
+ ...overrides
})
describe('getListOfAllChildrenFromNodes', () => {
@@ -29,7 +29,9 @@ describe('getListOfAllChildrenFromNodes', () => {
})
it('should handle multiple nodes', () => {
- expect(getListOfAllChildrenFromNodes([makeNode('node-1'), makeNode('node-2')])).toEqual(undefined)
+ expect(getListOfAllChildrenFromNodes([makeNode('node-1'), makeNode('node-2')])).toEqual(
+ undefined
+ )
})
it('should handle nodes with neighbors', () => {
diff --git a/flowsint-app/src/lib/user-display.ts b/flowsint-app/src/lib/user-display.ts
index 96c6e933..d510af21 100644
--- a/flowsint-app/src/lib/user-display.ts
+++ b/flowsint-app/src/lib/user-display.ts
@@ -1,7 +1,7 @@
import type { Profile } from '@/types'
import type { User } from '@/stores/auth-store'
-type UserLike = Partial<Profile> & Partial<User> | null | undefined
+type UserLike = (Partial<Profile> & Partial<User>) | null | undefined
/**
* Returns the best display name available:
diff --git a/flowsint-app/src/lib/utils.ts b/flowsint-app/src/lib/utils.ts
index 36e0003b..421acac4 100644
--- a/flowsint-app/src/lib/utils.ts
+++ b/flowsint-app/src/lib/utils.ts
@@ -243,7 +243,7 @@ export function getAvatarColor(name: string): string {
}
export const flattenObj = (ob: Record<string, any>) => {
- let result: Record<string, any> = {}
+ const result: Record<string, any> = {}
for (const i in ob) {
if (ob[i] && typeof ob[i] === 'object' && !Array.isArray(ob[i])) {
const temp = flattenObj(ob[i])
diff --git a/flowsint-app/src/routeTree.gen.ts b/flowsint-app/src/routeTree.gen.ts
index 26f8cd99..4e4f3461 100644
--- a/flowsint-app/src/routeTree.gen.ts
+++ b/flowsint-app/src/routeTree.gen.ts
@@ -33,110 +33,104 @@ import { Route as AuthDashboardInvestigationsInvestigationIdTypeIdRouteImport }
const RegisterRoute = RegisterRouteImport.update({
id: '/register',
path: '/register',
- getParentRoute: () => rootRouteImport,
+ getParentRoute: () => rootRouteImport
} as any)
const MiddlewareRoute = MiddlewareRouteImport.update({
id: '/middleware',
path: '/middleware',
- getParentRoute: () => rootRouteImport,
+ getParentRoute: () => rootRouteImport
} as any)
const LoginRoute = LoginRouteImport.update({
id: '/login',
path: '/login',
- getParentRoute: () => rootRouteImport,
+ getParentRoute: () => rootRouteImport
} as any)
const AuthRoute = AuthRouteImport.update({
id: '/_auth',
- getParentRoute: () => rootRouteImport,
+ getParentRoute: () => rootRouteImport
} as any)
const IndexRoute = IndexRouteImport.update({
id: '/',
path: '/',
- getParentRoute: () => rootRouteImport,
+ getParentRoute: () => rootRouteImport
} as any)
const AuthDashboardRoute = AuthDashboardRouteImport.update({
id: '/dashboard',
path: '/dashboard',
- getParentRoute: () => AuthRoute,
+ getParentRoute: () => AuthRoute
} as any)
const AuthDashboardIndexRoute = AuthDashboardIndexRouteImport.update({
id: '/',
path: '/',
- getParentRoute: () => AuthDashboardRoute,
+ getParentRoute: () => AuthDashboardRoute
} as any)
const AuthDashboardVaultRoute = AuthDashboardVaultRouteImport.update({
id: '/vault',
path: '/vault',
- getParentRoute: () => AuthDashboardRoute,
+ getParentRoute: () => AuthDashboardRoute
} as any)
const AuthDashboardToolsRoute = AuthDashboardToolsRouteImport.update({
id: '/tools',
path: '/tools',
- getParentRoute: () => AuthDashboardRoute,
+ getParentRoute: () => AuthDashboardRoute
} as any)
const AuthDashboardProfileRoute = AuthDashboardProfileRouteImport.update({
id: '/profile',
path: '/profile',
- getParentRoute: () => AuthDashboardRoute,
+ getParentRoute: () => AuthDashboardRoute
} as any)
const AuthDashboardFlowsIndexRoute = AuthDashboardFlowsIndexRouteImport.update({
id: '/flows/',
path: '/flows/',
- getParentRoute: () => AuthDashboardRoute,
+ getParentRoute: () => AuthDashboardRoute
+} as any)
+const AuthDashboardEnrichersIndexRoute = AuthDashboardEnrichersIndexRouteImport.update({
+ id: '/enrichers/',
+ path: '/enrichers/',
+ getParentRoute: () => AuthDashboardRoute
+} as any)
+const AuthDashboardCustomTypesIndexRoute = AuthDashboardCustomTypesIndexRouteImport.update({
+ id: '/custom-types/',
+ path: '/custom-types/',
+ getParentRoute: () => AuthDashboardRoute
} as any)
-const AuthDashboardEnrichersIndexRoute =
- AuthDashboardEnrichersIndexRouteImport.update({
- id: '/enrichers/',
- path: '/enrichers/',
- getParentRoute: () => AuthDashboardRoute,
- } as any)
-const AuthDashboardCustomTypesIndexRoute =
- AuthDashboardCustomTypesIndexRouteImport.update({
- id: '/custom-types/',
- path: '/custom-types/',
- getParentRoute: () => AuthDashboardRoute,
- } as any)
const AuthDashboardInvestigationsInvestigationIdRoute =
AuthDashboardInvestigationsInvestigationIdRouteImport.update({
id: '/investigations/$investigationId',
path: '/investigations/$investigationId',
- getParentRoute: () => AuthDashboardRoute,
- } as any)
-const AuthDashboardFlowsFlowIdRoute =
- AuthDashboardFlowsFlowIdRouteImport.update({
- id: '/flows/$flowId',
- path: '/flows/$flowId',
- getParentRoute: () => AuthDashboardRoute,
- } as any)
-const AuthDashboardEnrichersNewRoute =
- AuthDashboardEnrichersNewRouteImport.update({
- id: '/enrichers/new',
- path: '/enrichers/new',
- getParentRoute: () => AuthDashboardRoute,
- } as any)
-const AuthDashboardEnrichersEnricherIdRoute =
- AuthDashboardEnrichersEnricherIdRouteImport.update({
- id: '/enrichers/$enricherId',
- path: '/enrichers/$enricherId',
- getParentRoute: () => AuthDashboardRoute,
- } as any)
-const AuthDashboardCustomTypesTypeIdRoute =
- AuthDashboardCustomTypesTypeIdRouteImport.update({
- id: '/custom-types/$typeId',
- path: '/custom-types/$typeId',
- getParentRoute: () => AuthDashboardRoute,
+ getParentRoute: () => AuthDashboardRoute
} as any)
+const AuthDashboardFlowsFlowIdRoute = AuthDashboardFlowsFlowIdRouteImport.update({
+ id: '/flows/$flowId',
+ path: '/flows/$flowId',
+ getParentRoute: () => AuthDashboardRoute
+} as any)
+const AuthDashboardEnrichersNewRoute = AuthDashboardEnrichersNewRouteImport.update({
+ id: '/enrichers/new',
+ path: '/enrichers/new',
+ getParentRoute: () => AuthDashboardRoute
+} as any)
+const AuthDashboardEnrichersEnricherIdRoute = AuthDashboardEnrichersEnricherIdRouteImport.update({
+ id: '/enrichers/$enricherId',
+ path: '/enrichers/$enricherId',
+ getParentRoute: () => AuthDashboardRoute
+} as any)
+const AuthDashboardCustomTypesTypeIdRoute = AuthDashboardCustomTypesTypeIdRouteImport.update({
+ id: '/custom-types/$typeId',
+ path: '/custom-types/$typeId',
+ getParentRoute: () => AuthDashboardRoute
+} as any)
const AuthDashboardInvestigationsInvestigationIdIndexRoute =
AuthDashboardInvestigationsInvestigationIdIndexRouteImport.update({
id: '/',
path: '/',
- getParentRoute: () => AuthDashboardInvestigationsInvestigationIdRoute,
+ getParentRoute: () => AuthDashboardInvestigationsInvestigationIdRoute
} as any)
const AuthDashboardInvestigationsInvestigationIdTypeIdRoute =
AuthDashboardInvestigationsInvestigationIdTypeIdRouteImport.update({
id: '/$type/$id',
path: '/$type/$id',
- getParentRoute: () => AuthDashboardInvestigationsInvestigationIdRoute,
+ getParentRoute: () => AuthDashboardInvestigationsInvestigationIdRoute
} as any)
export interface FileRoutesByFullPath {
@@ -430,12 +424,12 @@ const AuthDashboardInvestigationsInvestigationIdRouteChildren: AuthDashboardInve
AuthDashboardInvestigationsInvestigationIdIndexRoute:
AuthDashboardInvestigationsInvestigationIdIndexRoute,
AuthDashboardInvestigationsInvestigationIdTypeIdRoute:
- AuthDashboardInvestigationsInvestigationIdTypeIdRoute,
+ AuthDashboardInvestigationsInvestigationIdTypeIdRoute
}
const AuthDashboardInvestigationsInvestigationIdRouteWithChildren =
AuthDashboardInvestigationsInvestigationIdRoute._addFileChildren(
- AuthDashboardInvestigationsInvestigationIdRouteChildren,
+ AuthDashboardInvestigationsInvestigationIdRouteChildren
)
interface AuthDashboardRouteChildren {
@@ -466,11 +460,11 @@ const AuthDashboardRouteChildren: AuthDashboardRouteChildren = {
AuthDashboardInvestigationsInvestigationIdRouteWithChildren,
AuthDashboardCustomTypesIndexRoute: AuthDashboardCustomTypesIndexRoute,
AuthDashboardEnrichersIndexRoute: AuthDashboardEnrichersIndexRoute,
- AuthDashboardFlowsIndexRoute: AuthDashboardFlowsIndexRoute,
+ AuthDashboardFlowsIndexRoute: AuthDashboardFlowsIndexRoute
}
const AuthDashboardRouteWithChildren = AuthDashboardRoute._addFileChildren(
- AuthDashboardRouteChildren,
+ AuthDashboardRouteChildren
)
interface AuthRouteChildren {
@@ -478,7 +472,7 @@ interface AuthRouteChildren {
}
const AuthRouteChildren: AuthRouteChildren = {
- AuthDashboardRoute: AuthDashboardRouteWithChildren,
+ AuthDashboardRoute: AuthDashboardRouteWithChildren
}
const AuthRouteWithChildren = AuthRoute._addFileChildren(AuthRouteChildren)
@@ -488,7 +482,7 @@ const rootRouteChildren: RootRouteChildren = {
AuthRoute: AuthRouteWithChildren,
LoginRoute: LoginRoute,
MiddlewareRoute: MiddlewareRoute,
- RegisterRoute: RegisterRoute,
+ RegisterRoute: RegisterRoute
}
export const routeTree = rootRouteImport
._addFileChildren(rootRouteChildren)
diff --git a/flowsint-app/src/routes/_auth.dashboard.custom-types.index.tsx b/flowsint-app/src/routes/_auth.dashboard.custom-types.index.tsx
index 345dd164..56c4fcb7 100644
--- a/flowsint-app/src/routes/_auth.dashboard.custom-types.index.tsx
+++ b/flowsint-app/src/routes/_auth.dashboard.custom-types.index.tsx
@@ -24,11 +24,7 @@ const getStatusBadge = (status: string) => {
published: 'default',
archived: 'secondary'
}
- return (
- <Badge variant={variants[status] || 'default'}>
- {status}
- </Badge>
- )
+ return <Badge variant={variants[status] || 'default'}>{status}</Badge>
}
function CustomTypesPage() {
@@ -59,15 +55,17 @@ function CustomTypesPage() {
const confirmDelete = (customType: CustomType) => {
deleteMutation.mutate(customType.id)
-
}
const handleDelete = async (customType: CustomType) => {
- if (await confirm({ title: "Are you sure you want to delete this custom type ?", message: "this action is irreversible." }))
+ if (
+ await confirm({
+ title: 'Are you sure you want to delete this custom type ?',
+ message: 'this action is irreversible.'
+ })
+ )
confirmDelete(customType)
}
-
-
// Group by status
const draftTypes = customTypes?.filter((t) => t.status === 'draft') || []
const publishedTypes = customTypes?.filter((t) => t.status === 'published') || []
@@ -104,49 +102,53 @@ function CustomTypesPage() {
}
>
{!customTypes?.length ? (
- <div className="flex flex-col items-center justify-center py-12 text-center">
- <div className="rounded-full bg-muted/50 p-4 mb-4">
- <FileX className="w-8 h-8 text-muted-foreground" />
- </div>
- <h3 className="text-xl font-semibold mb-2">No custom types yet</h3>
- <p className="text-muted-foreground mb-6 max-w-md">
- Get started by creating your first custom type. Custom types allow you to define
- your own data structures for use in flows and investigations.
- </p>
- <Button onClick={() => navigate({
- // @ts-ignore
- to: '/dashboard/custom-types/new'
- })}>
- <PlusIcon className="w-4 h-4 mr-2" />
- Create your first custom type
- </Button>
+ <div className="flex flex-col items-center justify-center py-12 text-center">
+ <div className="rounded-full bg-muted/50 p-4 mb-4">
+ <FileX className="w-8 h-8 text-muted-foreground" />
</div>
- ) : (
- <Tabs defaultValue="all" className="w-full">
- <TabsList>
- <TabsTrigger value="all">All ({customTypes.length})</TabsTrigger>
- <TabsTrigger value="published">Published ({publishedTypes.length})</TabsTrigger>
- <TabsTrigger value="draft">Drafts ({draftTypes.length})</TabsTrigger>
- <TabsTrigger value="archived">Archived ({archivedTypes.length})</TabsTrigger>
- </TabsList>
-
- <TabsContent value="all" className="mt-6">
- <CustomTypesList types={customTypes} onDelete={handleDelete} navigate={navigate} />
- </TabsContent>
-
- <TabsContent value="published" className="mt-6">
- <CustomTypesList types={publishedTypes} onDelete={handleDelete} navigate={navigate} />
- </TabsContent>
-
- <TabsContent value="draft" className="mt-6">
- <CustomTypesList types={draftTypes} onDelete={handleDelete} navigate={navigate} />
- </TabsContent>
-
- <TabsContent value="archived" className="mt-6">
- <CustomTypesList types={archivedTypes} onDelete={handleDelete} navigate={navigate} />
- </TabsContent>
- </Tabs>
- )}
+ <h3 className="text-xl font-semibold mb-2">No custom types yet</h3>
+ <p className="text-muted-foreground mb-6 max-w-md">
+ Get started by creating your first custom type. Custom types allow you to define your
+ own data structures for use in flows and investigations.
+ </p>
+ <Button
+ onClick={() =>
+ navigate({
+ // @ts-ignore
+ to: '/dashboard/custom-types/new'
+ })
+ }
+ >
+ <PlusIcon className="w-4 h-4 mr-2" />
+ Create your first custom type
+ </Button>
+ </div>
+ ) : (
+ <Tabs defaultValue="all" className="w-full">
+ <TabsList>
+ <TabsTrigger value="all">All ({customTypes.length})</TabsTrigger>
+ <TabsTrigger value="published">Published ({publishedTypes.length})</TabsTrigger>
+ <TabsTrigger value="draft">Drafts ({draftTypes.length})</TabsTrigger>
+ <TabsTrigger value="archived">Archived ({archivedTypes.length})</TabsTrigger>
+ </TabsList>
+
+ <TabsContent value="all" className="mt-6">
+ <CustomTypesList types={customTypes} onDelete={handleDelete} navigate={navigate} />
+ </TabsContent>
+
+ <TabsContent value="published" className="mt-6">
+ <CustomTypesList types={publishedTypes} onDelete={handleDelete} navigate={navigate} />
+ </TabsContent>
+
+ <TabsContent value="draft" className="mt-6">
+ <CustomTypesList types={draftTypes} onDelete={handleDelete} navigate={navigate} />
+ </TabsContent>
+
+ <TabsContent value="archived" className="mt-6">
+ <CustomTypesList types={archivedTypes} onDelete={handleDelete} navigate={navigate} />
+ </TabsContent>
+ </Tabs>
+ )}
</PageLayout>
)
}
@@ -169,49 +171,46 @@ function CustomTypesList({ types, onDelete, navigate }: CustomTypesListProps) {
return (
<div style={{ containerType: 'inline-size' }}>
- <div className="grid grid-cols-1 cq-sm:grid-cols-2 cq-md:grid-cols-3 gap-4">
- {types.map((customType) => (
- <Card key={customType.id} className="hover:border-primary/50 transition-colors">
- <CardHeader>
- <div className="flex items-start justify-between">
- <div className="space-y-1 flex-1">
- <CardTitle className="text-lg">{customType.name}</CardTitle>
- <CardDescription className="line-clamp-2">
- {customType.description || 'No description'}
- </CardDescription>
+ <div className="grid grid-cols-1 cq-sm:grid-cols-2 cq-md:grid-cols-3 gap-4">
+ {types.map((customType) => (
+ <Card key={customType.id} className="hover:border-primary/50 transition-colors">
+ <CardHeader>
+ <div className="flex items-start justify-between">
+ <div className="space-y-1 flex-1">
+ <CardTitle className="text-lg">{customType.name}</CardTitle>
+ <CardDescription className="line-clamp-2">
+ {customType.description || 'No description'}
+ </CardDescription>
+ </div>
+ {getStatusBadge(customType.status)}
</div>
- {getStatusBadge(customType.status)}
- </div>
- </CardHeader>
- <CardContent>
- <div className="flex items-center gap-2 text-sm text-muted-foreground mb-4">
- <Clock className="w-4 h-4" />
- <span>
- Updated {formatDistanceToNow(new Date(customType.updated_at), { addSuffix: true })}
- </span>
- </div>
- <div className="flex items-center gap-2">
- <Button
- variant="outline"
- size="sm"
- className="flex-1"
- onClick={() => navigate({ to: `/dashboard/custom-types/${customType.id}` })}
- >
- <Edit className="w-4 h-4 mr-2" />
- Edit
- </Button>
- <Button
- variant="outline"
- size="sm"
- onClick={() => onDelete(customType)}
- >
- <Trash2 className="w-4 h-4" />
- </Button>
- </div>
- </CardContent>
- </Card>
- ))}
- </div>
+ </CardHeader>
+ <CardContent>
+ <div className="flex items-center gap-2 text-sm text-muted-foreground mb-4">
+ <Clock className="w-4 h-4" />
+ <span>
+ Updated{' '}
+ {formatDistanceToNow(new Date(customType.updated_at), { addSuffix: true })}
+ </span>
+ </div>
+ <div className="flex items-center gap-2">
+ <Button
+ variant="outline"
+ size="sm"
+ className="flex-1"
+ onClick={() => navigate({ to: `/dashboard/custom-types/${customType.id}` })}
+ >
+ <Edit className="w-4 h-4 mr-2" />
+ Edit
+ </Button>
+ <Button variant="outline" size="sm" onClick={() => onDelete(customType)}>
+ <Trash2 className="w-4 h-4" />
+ </Button>
+ </div>
+ </CardContent>
+ </Card>
+ ))}
+ </div>
</div>
)
}
diff --git a/flowsint-app/src/routes/_auth.dashboard.flows.index.tsx b/flowsint-app/src/routes/_auth.dashboard.flows.index.tsx
index 9c0eaa76..376fdb58 100644
--- a/flowsint-app/src/routes/_auth.dashboard.flows.index.tsx
+++ b/flowsint-app/src/routes/_auth.dashboard.flows.index.tsx
@@ -115,7 +115,10 @@ function FlowPage() {
{allCategories.map((category) => (
<TabsContent key={category} value={category} className="mt-0">
- <div className="grid grid-cols-1 cq-sm:grid-cols-2 cq-md:grid-cols-3 cq-lg:grid-cols-4 cq-xl:grid-cols-5 gap-6" data-tour-id="flow-list">
+ <div
+ className="grid grid-cols-1 cq-sm:grid-cols-2 cq-md:grid-cols-3 cq-lg:grid-cols-4 cq-xl:grid-cols-5 gap-6"
+ data-tour-id="flow-list"
+ >
{flows
?.filter((flow) =>
category === 'All'
diff --git a/flowsint-app/src/routes/_auth.dashboard.index.tsx b/flowsint-app/src/routes/_auth.dashboard.index.tsx
index 78bd8ced..3e48f4cc 100644
--- a/flowsint-app/src/routes/_auth.dashboard.index.tsx
+++ b/flowsint-app/src/routes/_auth.dashboard.index.tsx
@@ -8,7 +8,5 @@ export const Route = createFileRoute('/_auth/dashboard/')({
})
function Page() {
- return (
- <DashboardPage />
- )
+ return <DashboardPage />
}
diff --git a/flowsint-app/src/routes/_auth.dashboard.investigations.$investigationId.index.tsx b/flowsint-app/src/routes/_auth.dashboard.investigations.$investigationId.index.tsx
index 7527709c..18d3121b 100644
--- a/flowsint-app/src/routes/_auth.dashboard.investigations.$investigationId.index.tsx
+++ b/flowsint-app/src/routes/_auth.dashboard.investigations.$investigationId.index.tsx
@@ -2,10 +2,10 @@ import { createFileRoute, useLoaderData, useNavigate } from '@tanstack/react-rou
import { analysisService } from '@/api/analysis-service'
import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
-import { CaseOverviewPage } from "@/components/dashboard/investigation/case-overview-page"
+import { CaseOverviewPage } from '@/components/dashboard/investigation/case-overview-page'
export const Route = createFileRoute('/_auth/dashboard/investigations/$investigationId/')({
- component: InvestigationPage,
+ component: InvestigationPage
})
function InvestigationPage() {
@@ -43,7 +43,5 @@ function InvestigationPage() {
}
})
- return (
- <CaseOverviewPage investigation={investigation} />
- )
+ return <CaseOverviewPage investigation={investigation} />
}
diff --git a/flowsint-app/src/routes/_auth.dashboard.profile.tsx b/flowsint-app/src/routes/_auth.dashboard.profile.tsx
index ba7943d4..fa36af71 100644
--- a/flowsint-app/src/routes/_auth.dashboard.profile.tsx
+++ b/flowsint-app/src/routes/_auth.dashboard.profile.tsx
@@ -12,7 +12,7 @@ import { getDisplayName } from '@/lib/user-display'
import { SESSION_QUERY_KEY } from '@/hooks/use-auth'
export const Route = createFileRoute('/_auth/dashboard/profile')({
- component: ProfilePage,
+ component: ProfilePage
})
function ProfilePage() {
@@ -22,13 +22,13 @@ function ProfilePage() {
const { data: profile, isLoading } = useQuery({
queryKey: ['profile', 'me'],
- queryFn: authService.getCurrentUser,
+ queryFn: authService.getCurrentUser
})
const [form, setForm] = useState({
first_name: '',
last_name: '',
- avatar_url: '',
+ avatar_url: ''
})
useEffect(() => {
@@ -36,7 +36,7 @@ function ProfilePage() {
setForm({
first_name: profile.first_name ?? '',
last_name: profile.last_name ?? '',
- avatar_url: profile.avatar_url ?? '',
+ avatar_url: profile.avatar_url ?? ''
})
}
}, [profile])
@@ -54,12 +54,12 @@ function ProfilePage() {
first_name: data.first_name ?? undefined,
last_name: data.last_name ?? undefined,
avatar_url: data.avatar_url ?? undefined,
- username: [data.first_name, data.last_name].filter(Boolean).join(' ') || authUser.email,
+ username: [data.first_name, data.last_name].filter(Boolean).join(' ') || authUser.email
})
}
toast.success('Profile updated')
},
- onError: () => toast.error('Failed to update profile'),
+ onError: () => toast.error('Failed to update profile')
})
const handleSubmit = (e: React.FormEvent) => {
diff --git a/flowsint-app/src/stores/graph-controls-store.ts b/flowsint-app/src/stores/graph-controls-store.ts
index 3c539d57..132a9154 100644
--- a/flowsint-app/src/stores/graph-controls-store.ts
+++ b/flowsint-app/src/stores/graph-controls-store.ts
@@ -46,7 +46,7 @@ export const useGraphControls = create<GraphControlsStore>()(
setCurrentLayoutType: (layoutType) => set({ currentLayoutType: layoutType }),
setView: (view) => set({ view }),
setIsSelectorModeActive: (active) => set({ isSelectorModeActive: active }),
- setSelectionMode: (mode) => set({ selectionMode: mode }),
+ setSelectionMode: (mode) => set({ selectionMode: mode })
}),
{
name: 'graph-controls-storage',
diff --git a/flowsint-app/src/stores/graph-store.ts b/flowsint-app/src/stores/graph-store.ts
index e9488bd1..90eb8a22 100644
--- a/flowsint-app/src/stores/graph-store.ts
+++ b/flowsint-app/src/stores/graph-store.ts
@@ -162,7 +162,10 @@ export const useGraphStore = create<GraphState>()(
const filteredNodes = computeFilteredNodes(nodes, filters)
const filteredEdges = computeFilteredEdges(edges, filteredNodes)
const edgesMapping = new Map(edges.map((edge) => [edge.id, edge]))
- const selectedNodesWithEdgesAsList = computeSelectedNodesWithEdgesAsList(get().selectedNodes, edgesMapping)
+ const selectedNodesWithEdgesAsList = computeSelectedNodesWithEdgesAsList(
+ get().selectedNodes,
+ edgesMapping
+ )
set({ edges, filteredNodes, filteredEdges, edgesMapping, selectedNodesWithEdgesAsList })
},
@@ -196,7 +199,10 @@ export const useGraphStore = create<GraphState>()(
edgesMapping.set(edgeWithId.id, edgeWithId)
const filteredNodes = computeFilteredNodes(nodes, filters)
const filteredEdges = computeFilteredEdges(edges, filteredNodes)
- const selectedNodesWithEdgesAsList = computeSelectedNodesWithEdgesAsList(get().selectedNodes, edgesMapping)
+ const selectedNodesWithEdgesAsList = computeSelectedNodesWithEdgesAsList(
+ get().selectedNodes,
+ edgesMapping
+ )
set({ edges, filteredNodes, filteredEdges, edgesMapping, selectedNodesWithEdgesAsList })
return edgeWithId
},
@@ -222,8 +228,17 @@ export const useGraphStore = create<GraphState>()(
const filteredNodes = computeFilteredNodes(nodes, filters)
const filteredEdges = computeFilteredEdges(newEdges, filteredNodes)
deleteKeys(edgesMapping, edgeIdsSet)
- const selectedNodesWithEdgesAsList = computeSelectedNodesWithEdgesAsList(get().selectedNodes, edgesMapping)
- set({ edges: newEdges, filteredNodes, filteredEdges, edgesMapping, selectedNodesWithEdgesAsList })
+ const selectedNodesWithEdgesAsList = computeSelectedNodesWithEdgesAsList(
+ get().selectedNodes,
+ edgesMapping
+ )
+ set({
+ edges: newEdges,
+ filteredNodes,
+ filteredEdges,
+ edgesMapping,
+ selectedNodesWithEdgesAsList
+ })
},
updateGraphData: (nodes, edges) => {
@@ -232,8 +247,19 @@ export const useGraphStore = create<GraphState>()(
const filteredEdges = computeFilteredEdges(edges, filteredNodes)
const nodesMapping = new Map(nodes.map((node) => [node.id, node]))
const edgesMapping = new Map(edges.map((edge) => [edge.id, edge]))
- const selectedNodesWithEdgesAsList = computeSelectedNodesWithEdgesAsList(get().selectedNodes, edgesMapping)
- set({ nodes, edges, filteredNodes, filteredEdges, nodesMapping, edgesMapping, selectedNodesWithEdgesAsList })
+ const selectedNodesWithEdgesAsList = computeSelectedNodesWithEdgesAsList(
+ get().selectedNodes,
+ edgesMapping
+ )
+ set({
+ nodes,
+ edges,
+ filteredNodes,
+ filteredEdges,
+ nodesMapping,
+ edgesMapping,
+ selectedNodesWithEdgesAsList
+ })
},
updateNode: (nodeId: string, updates: Partial<GraphNode>) => {
@@ -273,8 +299,17 @@ export const useGraphStore = create<GraphState>()(
const filteredEdges = computeFilteredEdges(updatedEdges, filteredNodes)
const edge = edgesMapping.get(edgeId)
if (edge) edgesMapping.set(edgeId, { ...edge, ...updates } as GraphEdge)
- const selectedNodesWithEdgesAsList = computeSelectedNodesWithEdgesAsList(get().selectedNodes, edgesMapping)
- set({ edges: updatedEdges, filteredNodes, filteredEdges, edgesMapping, selectedNodesWithEdgesAsList })
+ const selectedNodesWithEdgesAsList = computeSelectedNodesWithEdgesAsList(
+ get().selectedNodes,
+ edgesMapping
+ )
+ set({
+ edges: updatedEdges,
+ filteredNodes,
+ filteredEdges,
+ edgesMapping,
+ selectedNodesWithEdgesAsList
+ })
},
replaceNode: (oldId, newId, nodeProperties) => {
@@ -302,7 +337,10 @@ export const useGraphStore = create<GraphState>()(
// Update edgesMapping
const newEdgesMapping = new Map(updatedEdges.map((edge) => [edge.id, edge]))
setCurrentNodeId(newId)
- const selectedNodesWithEdgesAsList = computeSelectedNodesWithEdgesAsList(get().selectedNodes, newEdgesMapping)
+ const selectedNodesWithEdgesAsList = computeSelectedNodesWithEdgesAsList(
+ get().selectedNodes,
+ newEdgesMapping
+ )
set({
nodes: updatedNodes,
edges: updatedEdges,
@@ -346,7 +384,10 @@ export const useGraphStore = create<GraphState>()(
return null
},
setSelectedNodes: (nodes) => {
- const selectedNodesWithEdgesAsList = computeSelectedNodesWithEdgesAsList(nodes, get().edgesMapping)
+ const selectedNodesWithEdgesAsList = computeSelectedNodesWithEdgesAsList(
+ nodes,
+ get().edgesMapping
+ )
set({ selectedNodes: nodes, selectedNodesWithEdgesAsList })
},
setSelectedEdges: (edges) => set({ selectedEdges: edges }),
@@ -381,7 +422,10 @@ export const useGraphStore = create<GraphState>()(
selectedNodes: newSelected,
currentNodeId: newCurrentNodeId,
...(hasSelectionChanges && {
- selectedNodesWithEdgesAsList: computeSelectedNodesWithEdgesAsList(newSelected, get().edgesMapping)
+ selectedNodesWithEdgesAsList: computeSelectedNodesWithEdgesAsList(
+ newSelected,
+ get().edgesMapping
+ )
})
})
}
diff --git a/flowsint-app/src/stores/use-chat-store.tsx b/flowsint-app/src/stores/use-chat-store.tsx
index 410f8bdb..00f5d49d 100644
--- a/flowsint-app/src/stores/use-chat-store.tsx
+++ b/flowsint-app/src/stores/use-chat-store.tsx
@@ -14,14 +14,14 @@ export const useChatState = create<ChatState>()(
setCurrentChatId: (chatId) => set({ currentChatId: chatId }),
deleteChat: (chatId) =>
set((state) => ({
- currentChatId: state.currentChatId === chatId ? null : state.currentChatId,
- })),
+ currentChatId: state.currentChatId === chatId ? null : state.currentChatId
+ }))
}),
{
name: 'chat-state-storage',
partialize: (state) => ({
- currentChatId: state.currentChatId,
- }),
+ currentChatId: state.currentChatId
+ })
}
)
)
diff --git a/flowsint-app/src/types/filter.ts b/flowsint-app/src/types/filter.ts
index 8511e173..070d7f5e 100644
--- a/flowsint-app/src/types/filter.ts
+++ b/flowsint-app/src/types/filter.ts
@@ -1,19 +1,19 @@
export type TypeFilter = {
- type: string
- checked: boolean
+ type: string
+ checked: boolean
}
-export type RuleOperator = "is" | "not" | "like" | "startsWith" | "endsWith"
-export type RuleKey = "label" | "domain" | "ip"
+export type RuleOperator = 'is' | 'not' | 'like' | 'startsWith' | 'endsWith'
+export type RuleKey = 'label' | 'domain' | 'ip'
export type RuleFilter = {
- id: string
- key: RuleKey
- operator: RuleOperator
- matcher: string
+ id: string
+ key: RuleKey
+ operator: RuleOperator
+ matcher: string
}
export type Filters = {
- types: TypeFilter[]
- rules: RuleFilter[]
-}
\ No newline at end of file
+ types: TypeFilter[]
+ rules: RuleFilter[]
+}
diff --git a/flowsint-app/src/types/table.ts b/flowsint-app/src/types/table.ts
index 473eb95b..653dd217 100644
--- a/flowsint-app/src/types/table.ts
+++ b/flowsint-app/src/types/table.ts
@@ -1,4 +1,4 @@
-import { GraphNode, GraphEdge } from "./graph"
+import { GraphNode, GraphEdge } from './graph'
export type Row = {
id: string
diff --git a/flowsint-app/src/workers/pathfinder.worker.ts b/flowsint-app/src/workers/pathfinder.worker.ts
index b92d5649..11ed861a 100644
--- a/flowsint-app/src/workers/pathfinder.worker.ts
+++ b/flowsint-app/src/workers/pathfinder.worker.ts
@@ -78,7 +78,13 @@ self.onmessage = (event: MessageEvent<PathfinderMessage>) => {
})
// Collect path edges (edges between consecutive path nodes)
- const pathEdges: { id: string; source: string; target: string; label: string; caption?: string }[] = []
+ const pathEdges: {
+ id: string
+ source: string
+ target: string
+ label: string
+ caption?: string
+ }[] = []
for (let i = 0; i < pathIds.length - 1; i++) {
const a = pathIds[i]
@@ -93,7 +99,7 @@ self.onmessage = (event: MessageEvent<PathfinderMessage>) => {
source: edge.source,
target: edge.target,
label: edge.label,
- caption: edge.caption,
+ caption: edge.caption
})
}
}
@@ -103,13 +109,13 @@ self.onmessage = (event: MessageEvent<PathfinderMessage>) => {
result: {
ids: pathIds,
nodes: pathNodes,
- edges: pathEdges,
- },
+ edges: pathEdges
+ }
})
} catch (error) {
self.postMessage({
type: 'error',
- error: error instanceof Error ? error.message : 'Unknown error',
+ error: error instanceof Error ? error.message : 'Unknown error'
})
}
}
diff --git a/flowsint-app/vite.config.ts b/flowsint-app/vite.config.ts
index e97effac..0967e5b2 100644
--- a/flowsint-app/vite.config.ts
+++ b/flowsint-app/vite.config.ts
@@ -10,25 +10,25 @@ export default defineConfig(({ mode }) => {
return {
plugins: [
- tailwindcss(),
- {
- ...tanstackRouter({
- target: 'react',
- routesDirectory: 'src/routes',
- generatedRouteTree: 'src/routeTree.gen.ts',
- // routeFileIgnorePrefix: '_',
- autoCodeSplitting: true,
- verboseFileRoutes: false,
- quoteStyle: 'double',
- semicolons: true
- }),
- enforce: 'pre'
- },
- react({
- babel: {
- plugins: ["babel-plugin-react-compiler"]
- }
- })
+ tailwindcss(),
+ {
+ ...tanstackRouter({
+ target: 'react',
+ routesDirectory: 'src/routes',
+ generatedRouteTree: 'src/routeTree.gen.ts',
+ // routeFileIgnorePrefix: '_',
+ autoCodeSplitting: true,
+ verboseFileRoutes: false,
+ quoteStyle: 'double',
+ semicolons: true
+ }),
+ enforce: 'pre'
+ },
+ react({
+ babel: {
+ plugins: ['babel-plugin-react-compiler']
+ }
+ })
],
resolve: {
alias: {
@@ -58,14 +58,10 @@ export default defineConfig(({ mode }) => {
'vendor-xyflow': ['@xyflow/react', '@xyflow/system'],
'vendor-pixi': ['pixi.js'],
'vendor-monaco': ['@monaco-editor/react'],
- 'vendor-tiptap': [
- '@tiptap/react',
- '@tiptap/starter-kit',
- '@tiptap/core',
- ],
+ 'vendor-tiptap': ['@tiptap/react', '@tiptap/starter-kit', '@tiptap/core'],
'vendor-map': ['maplibre-gl'],
'vendor-charts': ['recharts', 'd3', 'd3-force'],
- 'vendor-motion': ['framer-motion'],
+ 'vendor-motion': ['framer-motion']
}
}
}
diff --git a/flowsint-app/vitest.config.ts b/flowsint-app/vitest.config.ts
index e9f44e4d..43e8f5dd 100644
--- a/flowsint-app/vitest.config.ts
+++ b/flowsint-app/vitest.config.ts
@@ -4,10 +4,10 @@ import { resolve } from 'path'
export default defineConfig({
resolve: {
alias: {
- '@': resolve(__dirname, 'src'),
- },
+ '@': resolve(__dirname, 'src')
+ }
},
test: {
- environment: 'node',
- },
+ environment: 'node'
+ }
})