From fa7835a29ab8e73e95de86408041964c1a696cac Mon Sep 17 00:00:00 2001 From: Daniel Kantor Date: Mon, 20 Jan 2025 14:55:27 +0100 Subject: [PATCH 01/12] move breadcrumbs out of App.tsx --- src/App.tsx | 31 +--------------------------- src/routes/route-dashboard.tsx | 37 ++++++++++++++++++++++++---------- 2 files changed, 27 insertions(+), 41 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index f3ce84c1..63ddcf46 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,17 +1,9 @@ import { Header } from "./components/Header"; import { PromptList } from "./components/PromptList"; -import { Routes, Route, Link } from "react-router-dom"; +import { Routes, Route } from "react-router-dom"; import { usePromptsData } from "./hooks/usePromptsData"; import { Sidebar } from "./components/Sidebar"; import { useSse } from "./hooks/useSse"; -import { - Breadcrumb, - BreadcrumbList, - BreadcrumbItem, - BreadcrumbSeparator, - BreadcrumbPage, -} from "./components/ui/breadcrumb"; -import { useBreadcrumb } from "./hooks/useBreadcrumb"; import { RouteWorkspace } from "./routes/route-workspace"; import { RouteWorkspaces } from "./routes/route-workspaces"; import { RouteCertificates } from "./routes/route-certificates"; @@ -23,7 +15,6 @@ import { RouteCertificateSecurity } from "./routes/route-certificate-security"; function App() { const { data: prompts, isLoading } = usePromptsData(); useSse(); - const breadcrumb = useBreadcrumb(); return (
@@ -33,26 +24,6 @@ function App() {
-
- - - - Dashboard - - {breadcrumb && ( - <> - - - - {breadcrumb} - - - - )} - - -
-
} /> diff --git a/src/routes/route-dashboard.tsx b/src/routes/route-dashboard.tsx index 766d81dc..26227f8f 100644 --- a/src/routes/route-dashboard.tsx +++ b/src/routes/route-dashboard.tsx @@ -3,7 +3,7 @@ import { useEffect } from "react"; import { BarChart } from "@/viz/BarChart"; import { LineChart } from "@/viz/LineChart"; import { PieChart } from "@/viz/PieChart"; -import { useSearchParams } from "react-router-dom"; +import { Link, useSearchParams } from "react-router-dom"; import { CodegateStatus } from "@/features/dashboard-codegate-status/components/codegate-status"; import { useAlertsData, @@ -11,6 +11,11 @@ import { } from "@/hooks/useAlertsData"; import { useAlertSearch } from "@/hooks/useAlertSearch"; import { AlertsTable } from "@/components/AlertsTable"; +import { + Breadcrumb, + BreadcrumbItem, + BreadcrumbList, +} from "@/components/ui/breadcrumb"; export function RouteDashboard() { const [searchParams] = useSearchParams(); @@ -33,17 +38,27 @@ export function RouteDashboard() { const maliciousPackages = useMaliciousPackagesChartData(); return ( -
-
- - - - -
+ <> + + + + Dashboard + + + - +
+
+ + + + +
- -
+ + + +
+ ); } From 1a068008bcaab91e5bb39421626195871ce49bf9 Mon Sep 17 00:00:00 2001 From: Daniel Kantor Date: Mon, 20 Jan 2025 15:07:28 +0100 Subject: [PATCH 02/12] fix breadcrumbs in chat route --- src/components/ui/breadcrumb.tsx | 114 ----------------------- src/routes/__tests__/route-chat.test.tsx | 14 ++- src/routes/route-chat.tsx | 72 ++++++++------ src/routes/route-dashboard.tsx | 20 ++-- 4 files changed, 62 insertions(+), 158 deletions(-) delete mode 100644 src/components/ui/breadcrumb.tsx diff --git a/src/components/ui/breadcrumb.tsx b/src/components/ui/breadcrumb.tsx deleted file mode 100644 index 314443ff..00000000 --- a/src/components/ui/breadcrumb.tsx +++ /dev/null @@ -1,114 +0,0 @@ -import * as React from "react"; -import { Slot } from "@radix-ui/react-slot"; -import { ChevronRight, MoreHorizontal } from "lucide-react"; -import { twMerge } from "tailwind-merge"; - -const Breadcrumb = React.forwardRef< - HTMLElement, - React.ComponentPropsWithoutRef<"nav"> & { - separator?: React.ReactNode; - } ->(({ ...props }, ref) =>