From 238d9a8803ea1f9904ec5170b5ccc50c6bfe0a13 Mon Sep 17 00:00:00 2001 From: syntaxbullet Date: Thu, 8 Jan 2026 23:10:14 +0100 Subject: [PATCH] refactor(web): enhance ui visual polish and ux - Replace native selects with Shadcn UI Select in Settings - Increase ActivityChart height for better visibility - specific Economy Overview card height to fill column - Add hover/active scale animations to sidebar items --- web/src/components/ActivityChart.tsx | 2 +- web/src/components/AppSidebar.tsx | 4 +- web/src/components/ui/select.tsx | 188 +++++++++++++++++++++++++++ web/src/pages/Dashboard.tsx | 2 +- web/src/pages/Settings.tsx | 60 +++++---- 5 files changed, 227 insertions(+), 29 deletions(-) create mode 100644 web/src/components/ui/select.tsx diff --git a/web/src/components/ActivityChart.tsx b/web/src/components/ActivityChart.tsx index 71c37d9..bdf1aaf 100644 --- a/web/src/components/ActivityChart.tsx +++ b/web/src/components/ActivityChart.tsx @@ -59,7 +59,7 @@ export const ActivityChart: React.FC = ({ data, loading }) = })); return ( -
+
- +
{botAvatar ? ( @@ -74,7 +74,7 @@ export function AppSidebar() { ) { + return +} + +function SelectGroup({ + ...props +}: React.ComponentProps) { + return +} + +function SelectValue({ + ...props +}: React.ComponentProps) { + return +} + +function SelectTrigger({ + className, + size = "default", + children, + ...props +}: React.ComponentProps & { + size?: "sm" | "default" +}) { + return ( + + {children} + + + + + ) +} + +function SelectContent({ + className, + children, + position = "item-aligned", + align = "center", + ...props +}: React.ComponentProps) { + return ( + + + + + {children} + + + + + ) +} + +function SelectLabel({ + className, + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function SelectItem({ + className, + children, + ...props +}: React.ComponentProps) { + return ( + + + + + + + {children} + + ) +} + +function SelectSeparator({ + className, + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function SelectScrollUpButton({ + className, + ...props +}: React.ComponentProps) { + return ( + + + + ) +} + +function SelectScrollDownButton({ + className, + ...props +}: React.ComponentProps) { + return ( + + + + ) +} + +export { + Select, + SelectContent, + SelectGroup, + SelectItem, + SelectLabel, + SelectScrollDownButton, + SelectScrollUpButton, + SelectSeparator, + SelectTrigger, + SelectValue, +} diff --git a/web/src/pages/Dashboard.tsx b/web/src/pages/Dashboard.tsx index a8cb0b7..90efaae 100644 --- a/web/src/pages/Dashboard.tsx +++ b/web/src/pages/Dashboard.tsx @@ -100,7 +100,7 @@ export function Dashboard() {
- +
diff --git a/web/src/pages/Settings.tsx b/web/src/pages/Settings.tsx index 66fc1eb..3aea38c 100644 --- a/web/src/pages/Settings.tsx +++ b/web/src/pages/Settings.tsx @@ -5,6 +5,13 @@ import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Card, CardContent } from "@/components/ui/card"; import { Switch } from "@/components/ui/switch"; +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from "@/components/ui/select"; // Types matching the backend response interface RoleOption { id: string; name: string; color: string; } @@ -358,20 +365,28 @@ export function Settings() { })}
- { + if (value && !(config?.colorRoles || []).includes(value)) { + updateConfig("colorRoles", [...(config?.colorRoles || []), value]); } - e.target.value = ""; }} > - - {meta.roles.map(r => ( - - ))} - + + + + + {meta.roles.map((r) => ( + + + + {r.name} + + + ))} + +
@@ -477,23 +492,18 @@ function SelectField({ label, value, options, onChange }: { label: string, value return (
-
- + + + + {options.map((opt) => ( - + ))} - -
- -
-
+ +
); }