From 2e6186a9bb6af17716630113c47b3d58c6ceb0f9 Mon Sep 17 00:00:00 2001 From: yoma Date: Sun, 5 Jul 2026 13:34:16 +0800 Subject: [PATCH] Collapse system info card by default --- apps/web/src/components/SettingsPane.tsx | 2 +- .../components/settings/SystemInfoCard.tsx | 73 ++++++++++++------- 2 files changed, 47 insertions(+), 28 deletions(-) diff --git a/apps/web/src/components/SettingsPane.tsx b/apps/web/src/components/SettingsPane.tsx index ef73d5fd..24d79339 100644 --- a/apps/web/src/components/SettingsPane.tsx +++ b/apps/web/src/components/SettingsPane.tsx @@ -68,9 +68,9 @@ export const SettingsPane = ({ /> - + diff --git a/apps/web/src/components/settings/SystemInfoCard.tsx b/apps/web/src/components/settings/SystemInfoCard.tsx index 36ed0c30..b9e055ed 100644 --- a/apps/web/src/components/settings/SystemInfoCard.tsx +++ b/apps/web/src/components/settings/SystemInfoCard.tsx @@ -1,8 +1,9 @@ import { useMemo, useState } from "react"; -import { Copy, Info } from "lucide-react"; +import { ChevronDown, Copy, Info } from "lucide-react"; import { useTranslation } from "react-i18next"; import { Button } from "@/components/ui/button"; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; +import { cn } from "@/lib/utils"; import { copyTextToClipboard } from "./settings-utils"; type SystemInfoItem = { @@ -54,6 +55,7 @@ const detectOperatingSystem = (userAgent: string, platform: string) => { export const SystemInfoCard = () => { const { t, i18n } = useTranslation(); const [copied, setCopied] = useState(false); + const [expanded, setExpanded] = useState(false); const infoItems = useMemo(() => { const language = navigator.language || i18n.language; @@ -97,8 +99,13 @@ export const SystemInfoCard = () => { return ( -
-
+
- -
+ + +
- - {infoItems.map((item) => ( -
-
{item.label}
-
- {item.value} -
+ {expanded && ( + +
+
- ))} -
+
+ {infoItems.map((item) => ( +
+
{item.label}
+
+ {item.value} +
+
+ ))} +
+ + )} ); };