From 66de566a001d247788832e128417082865691eb8 Mon Sep 17 00:00:00 2001 From: sagit <36596628+Sagit-chu@users.noreply.github.com> Date: Thu, 19 Feb 2026 20:50:12 +0800 Subject: [PATCH] fix(frontend): stabilize multiselect behavior and UI spacing (#154) * fix(frontend): left-align announcement logo in homepage banner * fix(frontend): keep multiselect panels floating and preserve summaries * fix(frontend): rebalance config card header spacing * fix(frontend): normalize formatting and fix multiselect modal behavior * fix(frontend): restore config divider spacing on desktop --- vite-frontend/src/components/navbar.tsx | 4 +- .../src/components/theme-provider.tsx | 1 + vite-frontend/src/components/ui/alert.tsx | 20 +- vite-frontend/src/components/ui/button.tsx | 14 +- vite-frontend/src/components/ui/card.tsx | 20 +- vite-frontend/src/components/ui/checkbox.tsx | 5 +- vite-frontend/src/components/ui/dialog.tsx | 45 ++-- .../src/components/ui/dropdown-menu.tsx | 54 ++++- vite-frontend/src/components/ui/label.tsx | 5 +- vite-frontend/src/components/ui/progress.tsx | 10 +- .../src/components/ui/radio-group.tsx | 10 +- vite-frontend/src/components/ui/select.tsx | 27 ++- vite-frontend/src/components/ui/switch.tsx | 5 +- vite-frontend/src/components/ui/table.tsx | 32 ++- vite-frontend/src/components/ui/tabs.tsx | 26 ++- vite-frontend/src/layouts/admin.tsx | 4 +- vite-frontend/src/layouts/h5-simple.tsx | 2 +- vite-frontend/src/pages/change-password.tsx | 6 +- vite-frontend/src/pages/config.tsx | 12 +- vite-frontend/src/pages/dashboard.tsx | 11 +- .../components/announcement-banner.tsx | 2 +- .../dashboard/components/flow-chart-card.tsx | 2 +- .../src/pages/dashboard/use-dashboard-data.ts | 16 +- vite-frontend/src/pages/forward.tsx | 50 +++-- vite-frontend/src/pages/group.tsx | 48 +++-- vite-frontend/src/pages/index.tsx | 6 +- vite-frontend/src/pages/limit.tsx | 4 +- vite-frontend/src/pages/node.tsx | 52 +++-- vite-frontend/src/pages/panel-sharing.tsx | 4 +- vite-frontend/src/pages/profile.tsx | 6 +- vite-frontend/src/pages/settings.tsx | 6 +- vite-frontend/src/pages/tunnel.tsx | 46 ++-- vite-frontend/src/pages/user.tsx | 6 +- vite-frontend/src/provider.tsx | 2 +- .../src/shadcn-bridge/heroui/alert.tsx | 3 +- .../src/shadcn-bridge/heroui/button.tsx | 95 +++++++-- .../src/shadcn-bridge/heroui/card.tsx | 12 +- .../src/shadcn-bridge/heroui/checkbox.tsx | 13 +- .../src/shadcn-bridge/heroui/chip.tsx | 8 +- .../src/shadcn-bridge/heroui/date-picker.tsx | 10 +- .../src/shadcn-bridge/heroui/dropdown.tsx | 15 +- .../src/shadcn-bridge/heroui/input.tsx | 12 +- .../src/shadcn-bridge/heroui/link.tsx | 7 +- .../src/shadcn-bridge/heroui/navbar.tsx | 12 +- .../src/shadcn-bridge/heroui/progress.tsx | 8 +- .../src/shadcn-bridge/heroui/radio.tsx | 13 +- .../src/shadcn-bridge/heroui/select.tsx | 201 ++++++++++++------ .../src/shadcn-bridge/heroui/shared.tsx | 15 +- .../src/shadcn-bridge/heroui/spinner.tsx | 11 +- .../src/shadcn-bridge/heroui/switch.tsx | 6 +- .../src/shadcn-bridge/heroui/table.tsx | 35 ++- .../src/shadcn-bridge/heroui/use-theme.tsx | 5 +- 52 files changed, 743 insertions(+), 301 deletions(-) diff --git a/vite-frontend/src/components/navbar.tsx b/vite-frontend/src/components/navbar.tsx index 78d7c7a..04a0a61 100644 --- a/vite-frontend/src/components/navbar.tsx +++ b/vite-frontend/src/components/navbar.tsx @@ -1,12 +1,12 @@ import { useEffect, useState } from "react"; +import { useNavigate } from "react-router-dom"; + import { Link } from "@/shadcn-bridge/heroui/link"; import { Navbar as HeroUINavbar, NavbarBrand, NavbarContent, } from "@/shadcn-bridge/heroui/navbar"; -import { useNavigate } from "react-router-dom"; - import { Logo } from "@/components/icons"; import { siteConfig, getCachedConfig } from "@/config/site"; import { useWebViewMode } from "@/hooks/useWebViewMode"; diff --git a/vite-frontend/src/components/theme-provider.tsx b/vite-frontend/src/components/theme-provider.tsx index 72c60c6..3e2f6d7 100644 --- a/vite-frontend/src/components/theme-provider.tsx +++ b/vite-frontend/src/components/theme-provider.tsx @@ -1,4 +1,5 @@ import React, { useEffect } from "react"; + import { useTheme } from "@/shadcn-bridge/heroui/use-theme"; interface ThemeProviderProps { diff --git a/vite-frontend/src/components/ui/alert.tsx b/vite-frontend/src/components/ui/alert.tsx index 96ed73d..e1d59de 100644 --- a/vite-frontend/src/components/ui/alert.tsx +++ b/vite-frontend/src/components/ui/alert.tsx @@ -9,9 +9,12 @@ const alertVariants = cva( variants: { variant: { default: "border-default-200 bg-default-50/70 text-foreground", - destructive: "border-danger-200 bg-danger-50 text-danger-700 dark:text-danger-300", - success: "border-success-200 bg-success-50 text-success-700 dark:text-success-300", - warning: "border-warning-200 bg-warning-50 text-warning-700 dark:text-warning-300", + destructive: + "border-danger-200 bg-danger-50 text-danger-700 dark:text-danger-300", + success: + "border-success-200 bg-success-50 text-success-700 dark:text-success-300", + warning: + "border-warning-200 bg-warning-50 text-warning-700 dark:text-warning-300", }, }, defaultVariants: { @@ -45,9 +48,16 @@ function AlertTitle({ className, ...props }: React.ComponentProps<"h5">) { ); } -function AlertDescription({ className, ...props }: React.ComponentProps<"div">) { +function AlertDescription({ + className, + ...props +}: React.ComponentProps<"div">) { return ( -
+ ); } diff --git a/vite-frontend/src/components/ui/button.tsx b/vite-frontend/src/components/ui/button.tsx index ba4ffb7..14fe8bb 100644 --- a/vite-frontend/src/components/ui/button.tsx +++ b/vite-frontend/src/components/ui/button.tsx @@ -11,11 +11,15 @@ const buttonVariants = cva( variant: { default: "bg-primary text-primary-foreground hover:bg-primary/90", destructive: "bg-danger text-white hover:bg-danger/90", - outline: "border border-input bg-background hover:bg-default-100 hover:text-foreground dark:hover:bg-default-200/40", - secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80", - ghost: "hover:bg-default-100 hover:text-foreground dark:hover:bg-default-200/40", + outline: + "border border-input bg-background hover:bg-default-100 hover:text-foreground dark:hover:bg-default-200/40", + secondary: + "bg-secondary text-secondary-foreground hover:bg-secondary/80", + ghost: + "hover:bg-default-100 hover:text-foreground dark:hover:bg-default-200/40", link: "text-primary underline-offset-4 hover:underline", - light: "bg-transparent hover:bg-default-100 dark:hover:bg-default-200/40", + light: + "bg-transparent hover:bg-default-100 dark:hover:bg-default-200/40", flat: "bg-default-100 text-foreground hover:bg-default-200 dark:bg-default-100/40", }, size: { @@ -43,9 +47,9 @@ const Button = React.forwardRef