From ef959295fce78ad71f01e24b54646bb2b9097c82 Mon Sep 17 00:00:00 2001 From: mlogclub Date: Sat, 13 Jun 2026 12:25:57 +0800 Subject: [PATCH] feat: enhance workspace switcher and rail with tooltips and layout adjustments --- web/components/workbench-header.tsx | 9 +---- web/components/workbench-rail.tsx | 58 ++++++++++++++++++++------- web/components/workspace-switcher.tsx | 55 ++++++++++++++++--------- web/e2e/workbench-function.spec.ts | 29 +++++++++++--- 4 files changed, 103 insertions(+), 48 deletions(-) diff --git a/web/components/workbench-header.tsx b/web/components/workbench-header.tsx index 5e1c189..df0888b 100644 --- a/web/components/workbench-header.tsx +++ b/web/components/workbench-header.tsx @@ -21,7 +21,6 @@ import { DropdownMenuSeparator, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu" -import { WorkspaceSwitcher } from "@/components/workspace-switcher" import { useAuth } from "@/components/auth-provider" import { useNotifications } from "@/components/notification-provider" import { useI18n } from "@/i18n/provider" @@ -32,13 +31,7 @@ export function WorkbenchHeader() { return (
-
-
- -
+
diff --git a/web/components/workbench-rail.tsx b/web/components/workbench-rail.tsx index 5121589..7577234 100644 --- a/web/components/workbench-rail.tsx +++ b/web/components/workbench-rail.tsx @@ -6,6 +6,12 @@ import { usePathname } from "next/navigation" import { useI18n } from "@/i18n/provider" import { cn } from "@/lib/utils" +import { + Tooltip, + TooltipContent, + TooltipTrigger, +} from "@/components/ui/tooltip" +import { WorkspaceSwitcher } from "@/components/workspace-switcher" const workbenchRailItems = [ { @@ -22,34 +28,56 @@ const workbenchRailItems = [ }, ] +function normalizePath(path: string | null | undefined) { + if (!path) { + return "" + } + return path.length > 1 ? path.replace(/\/+$/, "") : path +} + export function WorkbenchRail() { const t = useI18n() const pathname = usePathname() + const currentPath = normalizePath(pathname) return (