Skip to content

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

feat: analysis panel / toggle

dextmorgn8785cdd84906
diff --git a/flowsint-app/src/renderer/src/components/graphs/toolbar.tsx b/flowsint-app/src/renderer/src/components/graphs/toolbar.tsx
index ceab9af4..f94c6a1f 100644
--- a/flowsint-app/src/renderer/src/components/graphs/toolbar.tsx
+++ b/flowsint-app/src/renderer/src/components/graphs/toolbar.tsx
@@ -17,13 +17,11 @@ import {
} from "lucide-react"
import { memo, useCallback } from "react"
import { toast } from "sonner"
-import { cn } from "@/lib/utils"
+import { cn, isMac } from "@/lib/utils"
import ForceControls from './force-controls'
import Filters from "./filters"
import { useGraphStore } from "@/stores/graph-store"
-const isMac = navigator.platform.toUpperCase().indexOf('MAC') >= 0
-
// Tooltip wrapper component to avoid repetition
export const ToolbarButton = memo(function ToolbarButton({
icon,
@@ -122,7 +120,7 @@ export const Toolbar = memo(function Toolbar({ isLoading }: { isLoading: boolean
<ToolbarButton
icon={<GitFork className="h-4 w-4 opacity-70 rotate-180" />}
- tooltip={`Hierarchy (${isMac ? '⌘' : 'ctrl'}+Y)`}
+ tooltip={`Hierarchy`}
disabled={["hierarchy"].includes(view)}
onClick={handleDagreLayoutTB}
/>
diff --git a/flowsint-app/src/renderer/src/components/layout/root.layout.tsx b/flowsint-app/src/renderer/src/components/layout/root.layout.tsx
index 8dfa9ca8..75ce0b94 100644
--- a/flowsint-app/src/renderer/src/components/layout/root.layout.tsx
+++ b/flowsint-app/src/renderer/src/components/layout/root.layout.tsx
@@ -23,7 +23,7 @@ export default function RootLayout({ children }: LayoutProps) {
const isOpenPanel = useLayoutStore(s => s.isOpenPanel)
const isOpenAnalysis = useLayoutStore(s => s.isOpenAnalysis)
const isOpenDetails = useLayoutStore(s => s.isOpenDetails)
- const toggleDetails = useLayoutStore(s => s.toggleDetails)
+ const toggleAnalysis = useLayoutStore(s => s.toggleAnalysis)
const togglePanel = useLayoutStore(s => s.togglePanel)
const closePanel = useLayoutStore(s => s.closePanel)
const openPanel = useLayoutStore(s => s.openPanel)
@@ -35,7 +35,7 @@ export default function RootLayout({ children }: LayoutProps) {
useKeyboardShortcut({
key: "l",
ctrlOrCmd: true,
- callback: toggleDetails
+ callback: toggleAnalysis
})
useKeyboardShortcut({
key: "b",
diff --git a/flowsint-app/src/renderer/src/components/layout/top-navbar.tsx b/flowsint-app/src/renderer/src/components/layout/top-navbar.tsx
index 665cda40..fd63b186 100644
--- a/flowsint-app/src/renderer/src/components/layout/top-navbar.tsx
+++ b/flowsint-app/src/renderer/src/components/layout/top-navbar.tsx
@@ -23,6 +23,7 @@ import {
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu"
import { Ellipsis } from "lucide-react"
+import { isMac } from "@/lib/utils"
export const TopNavbar = memo(() => {
const { investigationId, id, type } = useParams({ strict: false })
@@ -75,7 +76,7 @@ export const TopNavbar = memo(() => {
{type === "graph" &&
<>
<Switch checked={isOpenAnalysis} onCheckedChange={handleToggleAnalysis} id="notes" />
- <Label htmlFor="notes">Toggle notes</Label>
+ <Label htmlFor="notes">Toggle notes<span className="text-[.7rem] -ml-1 opacity-60">({isMac ? '⌘' : 'ctrl'}L)</span></Label>
</>
}
</div>
@@ -96,19 +97,15 @@ export function InvestigationMenu() {
</div>
</DropdownMenuTrigger>
<DropdownMenuContent className="w-56" align="start">
- <DropdownMenuLabel>My Account</DropdownMenuLabel>
+ <DropdownMenuLabel>Settings</DropdownMenuLabel>
<DropdownMenuGroup>
<DropdownMenuItem>
- Profile
- <DropdownMenuShortcut>⇧⌘P</DropdownMenuShortcut>
+ General
+ <DropdownMenuShortcut>⌘G</DropdownMenuShortcut>
</DropdownMenuItem>
<DropdownMenuItem>
- Billing
- <DropdownMenuShortcut>⌘B</DropdownMenuShortcut>
- </DropdownMenuItem>
- <DropdownMenuItem>
- Settings
- <DropdownMenuShortcut>⌘S</DropdownMenuShortcut>
+ Preferences
+ <DropdownMenuShortcut>⌘P</DropdownMenuShortcut>
</DropdownMenuItem>
<DropdownMenuItem>
Keyboard shortcuts
@@ -131,7 +128,7 @@ export function InvestigationMenu() {
</DropdownMenuSub>
<DropdownMenuItem>
New Team
- <DropdownMenuShortcut>⌘+T</DropdownMenuShortcut>
+ <DropdownMenuShortcut>⌘T</DropdownMenuShortcut>
</DropdownMenuItem>
</DropdownMenuGroup>
<DropdownMenuSeparator />
@@ -139,8 +136,8 @@ export function InvestigationMenu() {
<DropdownMenuItem>Support</DropdownMenuItem>
<DropdownMenuItem disabled>API</DropdownMenuItem>
<DropdownMenuSeparator />
- <DropdownMenuItem>
- Log out
+ <DropdownMenuItem variant="destructive">
+ Delete
<DropdownMenuShortcut>⇧⌘Q</DropdownMenuShortcut>
</DropdownMenuItem>
</DropdownMenuContent>
diff --git a/flowsint-app/src/renderer/src/hooks/use-keyboard-shortcut.ts b/flowsint-app/src/renderer/src/hooks/use-keyboard-shortcut.ts
index 115b3193..2405caa4 100644
--- a/flowsint-app/src/renderer/src/hooks/use-keyboard-shortcut.ts
+++ b/flowsint-app/src/renderer/src/hooks/use-keyboard-shortcut.ts
@@ -1,3 +1,4 @@
+import { isMac } from "@/lib/utils"
import { useEffect, useState } from "react"
type ShortcutOptions = {
@@ -8,13 +9,7 @@ type ShortcutOptions = {
callback: () => void
}
export function useKeyboardShortcut(options: ShortcutOptions) {
- const [isMac, setIsMac] = useState(false)
- useEffect(() => {
- // Détecte si l'utilisateur est sur Mac
- if (typeof window !== "undefined") {
- setIsMac(navigator.platform.toLowerCase().includes("mac"))
- }
- }, [])
+
useEffect(() => {
const handleKeyDown = (event: KeyboardEvent) => {
const { key, ctrlKey, altKey, shiftKey, metaKey } = event
diff --git a/flowsint-app/src/renderer/src/lib/utils.ts b/flowsint-app/src/renderer/src/lib/utils.ts
index 5202eb54..89b9a682 100644
--- a/flowsint-app/src/renderer/src/lib/utils.ts
+++ b/flowsint-app/src/renderer/src/lib/utils.ts
@@ -349,4 +349,6 @@ export const getAllNodeTypes = (actionItems: any[]) => {
}
})
return types.sort()
-}
\ No newline at end of file
+}
+
+export const isMac = navigator.platform.toUpperCase().indexOf('MAC') >= 0