From 69d1e7c5d00b5e98ddcd9392f0ca42c4bb76c165 Mon Sep 17 00:00:00 2001 From: yiling Date: Mon, 1 Jun 2026 11:08:00 +0800 Subject: [PATCH] style(upload): adapt card design to use system color variables & document ui rules in AGENTS.md --- AGENTS.md | 4 ++++ src/ui/components/upload-tasks.tsx | 18 +++++++----------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 78c7e92e..b143d5dd 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -155,6 +155,10 @@ The frontend is built with: - **Framework**: React - **Styling**: Tailwind CSS + Shadcn UI (Components) +### UI Rules + +- **Prefer System Colors**: Always prefer using semantic system color design tokens (e.g., `bg-background`, `text-foreground`, `text-sidebar-primary`, `text-muted-foreground`, etc.) over hardcoded color utilities (e.g., `bg-blue-50`, `text-emerald-600`, `bg-emerald-500`). This ensures seamless compatibility with light and dark themes. + ### Development - **Run Dev**: `bun --hot src/index.ts` (Runs on port 3000) diff --git a/src/ui/components/upload-tasks.tsx b/src/ui/components/upload-tasks.tsx index a0602698..2a826c72 100644 --- a/src/ui/components/upload-tasks.tsx +++ b/src/ui/components/upload-tasks.tsx @@ -33,12 +33,12 @@ function UploadTaskItem({ task }: { task: TaskInfo }) { } return ( -
+
{/* Top row: Name & Status Badge */}
{task.name || 'Untitled Upload'} @@ -46,12 +46,12 @@ function UploadTaskItem({ task }: { task: TaskInfo }) {
{isCompleted ? ( - + Done ) : ( - + Uploading @@ -82,17 +82,13 @@ function UploadTaskItem({ task }: { task: TaskInfo }) { {task.uploaded} / {task.total} {task.total === 1 ? 'file' : 'files'} {!isCompleted && ( - - {Math.round(percent)}% - + {Math.round(percent)}% )}
-
+