Skip to content

Build and run agents you can see, understand and trust.

fix(webui): follow system dark mode so sidebar buttons stay visible (#2467) (#2468)

PiedPiper9115b38e8b84ac7
diff --git a/examples/web_ui/frontend/index.html b/examples/web_ui/frontend/index.html
index 4f4a319dc..e9f0c57b4 100644
--- a/examples/web_ui/frontend/index.html
+++ b/examples/web_ui/frontend/index.html
@@ -5,6 +5,14 @@
<link rel="icon" type="image/svg+xml" href="/agentscope.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>AgentScope</title>
+ <script>
+ // Applied before the first paint, so the theme never flashes.
+ const darkQuery = window.matchMedia('(prefers-color-scheme: dark)');
+ const applyTheme = () =>
+ document.documentElement.classList.toggle('dark', darkQuery.matches);
+ applyTheme();
+ darkQuery.addEventListener('change', applyTheme);
+ </script>
</head>
<body>
<div id="root"></div>
diff --git a/examples/web_ui/frontend/src/assets/images/agentscope_mono.svg b/examples/web_ui/frontend/src/assets/images/agentscope_mono.svg
new file mode 100644
index 000000000..2485a6ccc
--- /dev/null
+++ b/examples/web_ui/frontend/src/assets/images/agentscope_mono.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="458.9998779296875" height="369" viewBox="0 0 458.9998779296875 369"><defs><filter id="master_svg0_19_0" filterUnits="objectBoundingBox" color-interpolation-filters="sRGB" x="-0.046620063201997915" y="-0.0471976401179941" width="1.093240126403996" height="1.1179941002949854"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"/><feOffset dy="4" dx="0"/><feGaussianBlur stdDeviation="5"/><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.30000001192092896 0"/><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow"/><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow" result="shape"/></filter></defs><g filter="url(#master_svg0_19_0)"><path d="M229.4998779296875,117.25Q229.4998779296875,185.49998,327.49999992968753,216.5Q292.4998929296875,193.5,297.9998929296875,138Q298.4970249296875,133.19413,299.90046692968747,128.49811Q306.9657749296875,104.85701,336.9998579296875,84L369.9998579296875,99.5L423.7738779296875,99.5C431.09608792968754,99.5,435.92158792968746,91.915558,432.3153079296875,85.543015Q395.5066879296875,20.5,326.9998929296875,20.5C297.9998929296875,20.5,229.4998779296875,49.000015000000005,229.4998779296875,117.25Z" fill="currentColor" fill-opacity="1"/><path d="M297.9999160790625,138.00000001015624Q291.9999160890625,193.49999991015625,327.5000132890625,216.49999991015625L387.4998782890625,238.99999791015625Q403.4998762890625,220.24999991015625,403.4998762890625,201.49999991015625Q403.4998762890625,182.74999991015625,387.4998782890625,163.99999991015625L299.9004897890625,128.49810791015625Q298.4970473890625,133.19412991015625,297.9999160790625,138.00000001015624Z" fill="currentColor" fill-opacity="1"/><path d="M76.9998779296875,257.5C78.3900447296875,256.656715,79.7727174296875,255.832466,81.1479740296875,255.026932Q79.0392768296875,256.20977,76.9998779296875,257.5ZM81.1479740296875,255.026932Q104.3716909296875,242,135.9998779296875,242C140.2692869296875,241.798294,144.4211729296875,241.980835,148.4638669296875,242.502029C204.54925792968749,249.732681,239.6220279296875,322.14301,275.9998779296875,338Q304.1248779296875,350,331.9998779296875,350Q359.8748479296875,350,387.4998479296875,338Q443.9998479296875,306,443.9998479296875,250.5Q443.9998479296875,189,387.4998479296875,164Q403.4998479296875,182.75,403.4998479296875,201.5Q403.4998479296875,220.25,387.4998479296875,239C348.3173179296875,280.25696,314.6596479296875,265.94653,273.4499379296875,248.42514799999998C240.9518579296875,234.607742,203.7572079296875,218.793476,155.4527439296875,226.65936299999998C133.2413369296875,230.27625999999998,108.6809179296875,238.899994,81.1479740296875,255.026932Z" fill="currentColor" fill-opacity="1"/><path d="M15,343.99999876953126L87.830505,343.99999876953126C95.566086,343.99999876953126,102.60804,339.53909276953124,105.913116,332.54510476953124L148.46387,242.50202941953125C144.42117,241.98083496053124,140.26929,241.79829406953124,135.99988000000002,241.99999999953124Q101.499878,241.99999999953124,76.999878,257.49999976953126C47.5,279.49999976953126,41,292.99999976953126,15,343.99999876953126Z" fill="currentColor" fill-opacity="1"/><path d="M15,343.9999930184936C41,292.9999930184936,47.5,279.4999930184936,76.999878,257.50000301849366C106.221497,239.77399301849366,132.13189,230.45693301849366,155.45274,226.65937301849365L210.59709,113.04144201849365C213.08066,107.92437601849365,213.26796,101.99190401849366,211.11215,96.72836201849366L181.94841,25.52337361849365C179.6528,19.91851421849365,171.80496,19.676670118493654,169.16859,25.12953951849365L15,343.9999930184936Z" fill="currentColor" fill-opacity="1"/></g></svg>
\ No newline at end of file
diff --git a/examples/web_ui/frontend/src/assets/images/agentscope_white.svg b/examples/web_ui/frontend/src/assets/images/agentscope_white.svg
deleted file mode 100644
index 82e3214bb..000000000
--- a/examples/web_ui/frontend/src/assets/images/agentscope_white.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="458.9998779296875" height="369" viewBox="0 0 458.9998779296875 369"><defs><filter id="master_svg0_19_0" filterUnits="objectBoundingBox" color-interpolation-filters="sRGB" x="-0.046620063201997915" y="-0.0471976401179941" width="1.093240126403996" height="1.1179941002949854"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"/><feOffset dy="4" dx="0"/><feGaussianBlur stdDeviation="5"/><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.30000001192092896 0"/><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow"/><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow" result="shape"/></filter></defs><g filter="url(#master_svg0_19_0)"><path d="M229.4998779296875,117.25Q229.4998779296875,185.49998,327.49999992968753,216.5Q292.4998929296875,193.5,297.9998929296875,138Q298.4970249296875,133.19413,299.90046692968747,128.49811Q306.9657749296875,104.85701,336.9998579296875,84L369.9998579296875,99.5L423.7738779296875,99.5C431.09608792968754,99.5,435.92158792968746,91.915558,432.3153079296875,85.543015Q395.5066879296875,20.5,326.9998929296875,20.5C297.9998929296875,20.5,229.4998779296875,49.000015000000005,229.4998779296875,117.25Z" fill="#FFFFFF" fill-opacity="1"/><path d="M297.9999160790625,138.00000001015624Q291.9999160890625,193.49999991015625,327.5000132890625,216.49999991015625L387.4998782890625,238.99999791015625Q403.4998762890625,220.24999991015625,403.4998762890625,201.49999991015625Q403.4998762890625,182.74999991015625,387.4998782890625,163.99999991015625L299.9004897890625,128.49810791015625Q298.4970473890625,133.19412991015625,297.9999160790625,138.00000001015624Z" fill="#FFFFFF" fill-opacity="1"/><path d="M76.9998779296875,257.5C78.3900447296875,256.656715,79.7727174296875,255.832466,81.1479740296875,255.026932Q79.0392768296875,256.20977,76.9998779296875,257.5ZM81.1479740296875,255.026932Q104.3716909296875,242,135.9998779296875,242C140.2692869296875,241.798294,144.4211729296875,241.980835,148.4638669296875,242.502029C204.54925792968749,249.732681,239.6220279296875,322.14301,275.9998779296875,338Q304.1248779296875,350,331.9998779296875,350Q359.8748479296875,350,387.4998479296875,338Q443.9998479296875,306,443.9998479296875,250.5Q443.9998479296875,189,387.4998479296875,164Q403.4998479296875,182.75,403.4998479296875,201.5Q403.4998479296875,220.25,387.4998479296875,239C348.3173179296875,280.25696,314.6596479296875,265.94653,273.4499379296875,248.42514799999998C240.9518579296875,234.607742,203.7572079296875,218.793476,155.4527439296875,226.65936299999998C133.2413369296875,230.27625999999998,108.6809179296875,238.899994,81.1479740296875,255.026932Z" fill="#FFFFFF" fill-opacity="1"/><path d="M15,343.99999876953126L87.830505,343.99999876953126C95.566086,343.99999876953126,102.60804,339.53909276953124,105.913116,332.54510476953124L148.46387,242.50202941953125C144.42117,241.98083496053124,140.26929,241.79829406953124,135.99988000000002,241.99999999953124Q101.499878,241.99999999953124,76.999878,257.49999976953126C47.5,279.49999976953126,41,292.99999976953126,15,343.99999876953126Z" fill="#FFFFFF" fill-opacity="1"/><path d="M15,343.9999930184936C41,292.9999930184936,47.5,279.4999930184936,76.999878,257.50000301849366C106.221497,239.77399301849366,132.13189,230.45693301849366,155.45274,226.65937301849365L210.59709,113.04144201849365C213.08066,107.92437601849365,213.26796,101.99190401849366,211.11215,96.72836201849366L181.94841,25.52337361849365C179.6528,19.91851421849365,171.80496,19.676670118493654,169.16859,25.12953951849365L15,343.9999930184936Z" fill="#FFFFFF" fill-opacity="1"/></g></svg>
\ No newline at end of file
diff --git a/examples/web_ui/frontend/src/components/chat/ConfirmCard.tsx b/examples/web_ui/frontend/src/components/chat/ConfirmCard.tsx
index c434a9953..99eb8e8b0 100644
--- a/examples/web_ui/frontend/src/components/chat/ConfirmCard.tsx
+++ b/examples/web_ui/frontend/src/components/chat/ConfirmCard.tsx
@@ -79,7 +79,7 @@ export function ConfirmCard({
{/* Capped so a long tool input (raw JSON for MCP tools) cannot
grow the card past the viewport — it floats above the
composer and is out of flow, so nothing else clips it. */}
- <div className="px-4 py-2 bg-white rounded-sm max-w-full max-h-[200px] overflow-y-auto">
+ <div className="px-4 py-2 bg-background rounded-sm max-w-full max-h-[200px] overflow-y-auto">
{renderConfirmBody(toolCall, t)}
</div>
</div>
diff --git a/examples/web_ui/frontend/src/components/chat/SubagentHitlCard.tsx b/examples/web_ui/frontend/src/components/chat/SubagentHitlCard.tsx
index bb345a301..3b4a669c6 100644
--- a/examples/web_ui/frontend/src/components/chat/SubagentHitlCard.tsx
+++ b/examples/web_ui/frontend/src/components/chat/SubagentHitlCard.tsx
@@ -37,7 +37,7 @@ export function SubagentHitlCard({
if (toolCalls.length === 0) return null;
return (
- <div className="ring ring-border rounded-[28px] w-full p-3 space-y-3 bg-white">
+ <div className="ring ring-border rounded-[28px] w-full p-3 space-y-3 bg-card">
<div className="flex items-center gap-2 text-sm font-medium text-secondary-foreground px-2">
<Users className="size-4 shrink-0" />
<span>{t('chat.subagentConfirmTitle', { name: entry.worker_agent_name })}</span>
diff --git a/examples/web_ui/frontend/src/components/layout/AppSidebar.tsx b/examples/web_ui/frontend/src/components/layout/AppSidebar.tsx
index 820307593..2bbc1d91f 100644
--- a/examples/web_ui/frontend/src/components/layout/AppSidebar.tsx
+++ b/examples/web_ui/frontend/src/components/layout/AppSidebar.tsx
@@ -12,7 +12,7 @@ import {
import { useOnborda } from 'onborda';
import { useNavigate, useLocation } from 'react-router-dom';
-import AgentScope from '@/assets/images/agentscope_white.svg?react';
+import AgentScope from '@/assets/images/agentscope_mono.svg?react';
import MCPSvg from '@/assets/images/mcp.svg?react';
import { CHAT_TOUR_NAME } from '@/components/tour/chatTourSteps';
import {
@@ -58,7 +58,7 @@ export function AppSidebar() {
>
<SidebarHeader>
<div className="flex items-center justify-center size-8 mt-2 rounded-full bg-primary">
- <AgentScope className="size-5 items-center justify-center rounded-lg" />
+ <AgentScope className="size-5 items-center justify-center rounded-lg text-primary-foreground" />
</div>
</SidebarHeader>
<SidebarContent>
diff --git a/examples/web_ui/frontend/src/index.css b/examples/web_ui/frontend/src/index.css
index 95f97395b..80e456d0f 100644
--- a/examples/web_ui/frontend/src/index.css
+++ b/examples/web_ui/frontend/src/index.css
@@ -40,7 +40,7 @@ svg.lucide {
/*font: 18px/145% var(--sans);*/
/* letter-spacing: 0.18px; */
- color-scheme: light dark;
+ color-scheme: light;
color: var(--text);
background: var(--bg);
font-synthesis: none;
@@ -122,25 +122,14 @@ svg.lucide {
--sidebar-border: transparent;
--sidebar-ring: oklch(0.708 0 0);
-}
-
-@media (prefers-color-scheme: dark) {
- :root {
- --text: #9ca3af;
- --text-h: #f3f4f6;
- --bg: #16171d;
- --border: #2e303a;
- --code-bg: #1f2028;
- --accent: #c084fc;
- --accent-bg: rgba(192, 132, 252, 0.15);
- --accent-border: rgba(192, 132, 252, 0.5);
- --social-bg: rgba(47, 48, 58, 0.5);
- --shadow: rgba(0, 0, 0, 0.4) 0 10px 15px -3px, rgba(0, 0, 0, 0.25) 0 4px 6px -2px;
- }
- #social .button-icon {
- filter: invert(1) brightness(2);
- }
+ --text-secondary: #41454b;
+ --text-tertiary: #a7abb2;
+ --text-data: #8e939a;
+ --surface-muted: #f1f2f4;
+ --row-hover: rgba(24, 25, 28, 0.02);
+ --panel-shadow: 0 1px 2px rgba(24, 25, 28, 0.05), 0 18px 40px -30px rgba(24, 25, 28, 0.28);
+ --tab-shadow: 0 1px 2px rgba(24, 25, 28, 0.07);
}
@theme inline {
@@ -151,11 +140,11 @@ svg.lucide {
/* Menu-item inset, tied to the corner radius: a rounder item eats more
horizontal room at the text's edge, so the padding has to grow with it. */
--spacing-menu-item: calc(var(--radius) * 0.625);
- --color-text-secondary: #41454b; /* → text-text-secondary */
- --color-text-tertiary: #a7abb2; /* → text-text-tertiary */
- --color-text-data: #8e939a; /* → text-text-data */
- --color-surface-muted: #f1f2f4; /* → bg-surface-muted (inline badges) */
- --color-row-hover: rgba(24, 25, 28, 0.02); /* → hover:bg-row-hover */
+ --color-text-secondary: var(--text-secondary); /* → text-text-secondary */
+ --color-text-tertiary: var(--text-tertiary); /* → text-text-tertiary */
+ --color-text-data: var(--text-data); /* → text-text-data */
+ --color-surface-muted: var(--surface-muted); /* → bg-surface-muted (inline badges) */
+ --color-row-hover: var(--row-hover); /* → hover:bg-row-hover */
--color-sidebar-ring: var(--sidebar-ring);
--color-sidebar-border: var(--sidebar-border);
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
@@ -194,24 +183,27 @@ svg.lucide {
--radius-2xl: calc(var(--radius) * 1.8);
--radius-3xl: calc(var(--radius) * 2.2);
--radius-4xl: calc(var(--radius) * 2.6);
- --shadow-panel: 0 1px 2px rgba(24, 25, 28, 0.05), 0 18px 40px -30px rgba(24, 25, 28, 0.28);
- --shadow-tab: 0 1px 2px rgba(24, 25, 28, 0.07); /* → shadow-tab (active tab) */
+ --shadow-panel: var(--panel-shadow);
+ --shadow-tab: var(--tab-shadow); /* → shadow-tab (active tab) */
}
.dark {
- --background: oklch(0.145 0 0);
+ color-scheme: dark;
+ --text: #9ca3af;
+ --bg: #0c0d10;
+ --background: #16171d;
--foreground: oklch(0.985 0 0);
- --card: oklch(0.205 0 0);
+ --card: #16171d;
--card-foreground: oklch(0.985 0 0);
- --popover: oklch(0.205 0 0);
+ --popover: #16171d;
--popover-foreground: oklch(0.985 0 0);
--primary: oklch(0.922 0 0);
--primary-foreground: oklch(0.205 0 0);
- --secondary: oklch(0.269 0 0);
+ --secondary: #1e2027;
--secondary-foreground: oklch(0.985 0 0);
- --muted: oklch(0.269 0 0);
+ --muted: #1e2027;
--muted-foreground: oklch(0.708 0 0);
- --accent: oklch(0.269 0 0);
+ --accent: #1e2027;
--accent-foreground: oklch(0.985 0 0);
--destructive: oklch(0.704 0.191 22.216);
--border: oklch(1 0 0 / 10%);
@@ -222,14 +214,22 @@ svg.lucide {
--chart-3: oklch(0.439 0 0);
--chart-4: oklch(0.371 0 0);
--chart-5: oklch(0.269 0 0);
- --sidebar: oklch(0.205 0 0);
+ --sidebar: rgba(22, 23, 29, 0.62);
--sidebar-foreground: oklch(0.985 0 0);
--sidebar-primary: oklch(0.488 0.243 264.376);
--sidebar-primary-foreground: oklch(0.985 0 0);
- --sidebar-accent: oklch(0.269 0 0);
+ --sidebar-accent: rgba(255, 255, 255, 0.06);
--sidebar-accent-foreground: oklch(0.985 0 0);
- --sidebar-border: oklch(1 0 0 / 10%);
+ --sidebar-border: transparent;
--sidebar-ring: oklch(0.556 0 0);
+
+ --text-secondary: #c3c7cd;
+ --text-tertiary: #868b93;
+ --text-data: #8b9099;
+ --surface-muted: #24262d;
+ --row-hover: rgba(255, 255, 255, 0.04);
+ --panel-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 18px 40px -30px rgba(0, 0, 0, 0.8);
+ --tab-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
@layer base {