feat(webui): unify icons and refine interaction feedback (#6074)

* feat(webui): unify product icons and refine interaction feedback

* test(webui): align layout and tooltip expectations with icon refresh

* test(webui): verify temporary chat uses shared icon controls

* fix(webui): toggle workspace access directly and restore send arrow

* fix(webui): keep the send control circular

* fix(webui): clear workspace toggle background on pointer leave

* test(webui): isolate GitHub navigation in star prompt tests

* test(webui): prevent external default navigation during star link clicks
This commit is contained in:
chengyongru authored and GitHub committed 2026-10-06 00:46:38 +08:00
1 parent 9dc0abae4f
commit 63bdd40280
59 files changed
+615 -505

No files matched your search

@@ -1,21 +1,16 @@
import {
OverviewIcon,
AboutIcon,
RestartIcon,
CapabilitiesIcon,
AppearanceIcon,
SystemIcon,
AdvancedIcon,
ModelsIcon,
} from "@/components/icons/product-icons";
import { useContext, useRef, useState } from "react";
import { HostNavigationContext, HostSwitcher } from "@/components/remote/HostSwitcher";
import {
Activity,
Info,
Check,
ChevronDown,
ChevronLeft,
LogOut,
Loader2,
RotateCcw,
Blocks,
Palette,
Server,
ShieldCheck,
SlidersHorizontal,
type LucideIcon,
} from "lucide-react";
import { Check, ChevronDown, ChevronLeft, LogOut, Loader2, type LucideIcon } from "lucide-react";
import { useTranslation } from "react-i18next";
import {
@@ -35,13 +30,13 @@ import { useMediaQuery } from "@/hooks/useMediaQuery";
import { cn } from "@/lib/utils";
const SETTINGS_NAV_ITEMS: Array<{ key: SettingsSectionKey; icon: LucideIcon; fallback: string }> = [
{ key: "overview", icon: Activity, fallback: "Overview" },
{ key: "appearance", icon: Palette, fallback: "Appearance" },
{ key: "models", icon: SlidersHorizontal, fallback: "Models" },
{ key: "capabilities", icon: Blocks, fallback: "Capabilities" },
{ key: "runtime", icon: Server, fallback: "System" },
{ key: "advanced", icon: ShieldCheck, fallback: "Advanced" },
{ key: "about", icon: Info, fallback: "About" },
{ key: "overview", icon: OverviewIcon, fallback: "Overview" },
{ key: "appearance", icon: AppearanceIcon, fallback: "Appearance" },
{ key: "models", icon: ModelsIcon, fallback: "Models" },
{ key: "capabilities", icon: CapabilitiesIcon, fallback: "Capabilities" },
{ key: "runtime", icon: SystemIcon, fallback: "System" },
{ key: "advanced", icon: AdvancedIcon, fallback: "Advanced" },
{ key: "about", icon: AboutIcon, fallback: "About" },
];
export function standaloneSectionTitle(section: SettingsSectionKey): string {
@@ -107,7 +102,7 @@ export function SettingsSidebar(props: SettingsSidebarProps) {
onClick={onBackToChat}
aria-label={t("settings.backToChat")}
className={cn(
"touch-target mb-2 inline-flex h-9 w-9 items-center justify-center rounded-full text-[13px] leading-5 font-normal text-sidebar-content transition-colors settings-hover hover:text-foreground lg:mb-3",
"touch-target mb-2 inline-flex h-9 w-9 items-center justify-center rounded-xl text-[13px] leading-5 font-normal text-sidebar-content transition-colors duration-150 motion-reduce:transition-none focus-visible:outline focus-visible:outline-1 focus-visible:outline-offset-2 focus-visible:outline-ring hover:text-foreground lg:mb-3",
hostChromeInset && "-ml-1",
)}
>
@@ -171,7 +166,7 @@ export function SettingsSidebar(props: SettingsSidebarProps) {
: "text-sidebar-content hover:text-foreground")}
>
{isRestarting ? <Loader2 className="h-4 w-4 animate-spin" aria-hidden />
: <RotateCcw className="h-4 w-4" aria-hidden />}
: <RestartIcon className="h-4 w-4" aria-hidden />}
<span>{restartLabel}</span>
</Button>
</div>
@@ -217,7 +212,7 @@ function MobileSettingsNavigation({
? "text-orange-600 hover:text-orange-700 dark:text-orange-400 dark:hover:text-orange-300"
: "text-muted-foreground hover:text-foreground";
const restartIcon = isRestarting ? <Loader2 className="h-4 w-4 animate-spin" aria-hidden />
: <RotateCcw className="h-4 w-4" aria-hidden />;
: <RestartIcon className="h-4 w-4" aria-hidden />;
const restartAction = onRestart ? (
<Button type="button" variant="ghost" disabled={isRestarting}
onClick={restart}
@@ -233,9 +228,9 @@ function MobileSettingsNavigation({
hostChromeInset ? "pt-10" : "pt-[env(safe-area-inset-top)]")}
>
<div className="grid h-14 grid-cols-[2.75rem_minmax(0,1fr)_2.75rem] items-center px-3">
<Button type="button" variant="ghost" onClick={onBackToChat}
<Button size="icon" type="button" variant="ghost" onClick={onBackToChat}
aria-label={t("settings.backToChat")}
className="h-11 w-11 rounded-full p-0 text-sidebar-content"
className="h-11 w-11 rounded-xl p-0 text-sidebar-content"
>
<ChevronLeft className="h-5 w-5" aria-hidden />
</Button>
@@ -651,7 +651,7 @@ function RequirementsSection({
})}
title={option.label}
onClick={() => void copyCommand(option.command)}
className="flex h-9 w-9 shrink-0 items-center justify-center rounded-control text-muted-foreground transition-colors settings-hover hover:text-foreground sm:h-7 sm:w-7"
className="flex h-9 w-9 shrink-0 items-center justify-center rounded-control text-muted-foreground transition-colors hover:text-foreground sm:h-7 sm:w-7"
>
{copiedCommand === option.command ? (
<Check className="h-3.5 w-3.5 text-emerald-600" aria-hidden />
@@ -519,7 +519,7 @@ function MarketplaceSkillRow({
provider: providerLabel(skill.provider),
defaultValue: "Open {{name}} on {{provider}}",
})}
className="inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-muted-foreground transition-colors settings-hover hover:text-foreground"
className="inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-muted-foreground transition-colors hover:text-foreground"
>
<ExternalLink className="h-3.5 w-3.5" aria-hidden />
</a>
@@ -554,7 +554,7 @@ function MarketplaceSkillRow({
disabled={installed || installBusy || !skill.install_supported}
onClick={() => onSelect(skill)}
className={cn(
"h-9 w-9 shrink-0 rounded-full bg-muted/70 text-muted-foreground transition-[opacity,color,background-color,transform] hover:scale-[1.03] hover:bg-foreground hover:text-background focus-visible:bg-foreground focus-visible:text-background focus-visible:opacity-100 sm:opacity-[0.55] sm:group-hover:opacity-100",
"h-9 w-9 shrink-0 rounded-full bg-muted/70 text-muted-foreground transition-[opacity,color] hover:text-foreground focus-visible:bg-foreground focus-visible:text-background focus-visible:opacity-100 sm:opacity-[0.55] sm:group-hover:opacity-100",
installed &&
"bg-emerald-500/10 text-emerald-700 disabled:opacity-100 dark:text-emerald-300",
)}
@@ -198,7 +198,7 @@ export function WebSettings({
aria-label={
keyVisible ? t("settings.byok.hideApiKey") : t("settings.byok.showApiKey")
}
className="absolute right-1 top-1/2 h-7 w-7 -translate-y-1/2 rounded-full text-muted-foreground settings-hover hover:text-foreground"
className="absolute right-1 top-1/2 h-7 w-7 -translate-y-1/2 rounded-full text-muted-foreground hover:text-foreground"
>
{keyVisible ? (
<EyeOff className="h-3.5 w-3.5" aria-hidden />
@@ -218,7 +218,7 @@ export function WebSettings({
size="icon"
onClick={onToggleKeyEditing}
aria-label={t("settings.actions.edit")}
className="absolute right-1 top-1/2 h-7 w-7 -translate-y-1/2 rounded-full text-muted-foreground settings-hover hover:text-foreground"
className="absolute right-1 top-1/2 h-7 w-7 -translate-y-1/2 rounded-full text-muted-foreground hover:text-foreground"
>
<Pencil className="h-3.5 w-3.5" aria-hidden />
</Button>
@@ -98,7 +98,7 @@ export function ChannelCatalogRow({
{!feature.installed ? (
<Button ref={installButtonRef} type="button" variant="outline" size="icon"
className={cn(
"h-[22px] w-[38px] min-w-0 shrink-0 rounded-full border-border/70 bg-background p-0 shadow-sm settings-hover active:scale-[0.96]",
"h-[22px] w-[38px] min-w-0 shrink-0 rounded-full border-border/70 bg-background p-0",
installHint && "border-[#2997FF]/60 bg-[#2997FF]/10 text-[#087FE7] ring-2 ring-[#2997FF]/25 ring-offset-2",
)}
disabled={actionsDisabled || anyActionBusy || !feature.install_supported}
@@ -27,7 +27,7 @@ export function ChannelHelpMenu({ feature, chatAppsDocsUrl }: {
<TooltipTrigger asChild>
<DropdownMenuTrigger asChild>
<button type="button" aria-label={label}
className="grid h-8 w-8 place-items-center rounded-full text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring">
className="grid h-8 w-8 place-items-center rounded-full text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring">
<CircleHelp className="h-4 w-4" aria-hidden />
</button>
</DropdownMenuTrigger>
@@ -240,7 +240,7 @@ export function CredentialForm({
}
onClick={() => onToggleSecret(field.key)}
disabled={disabled}
className="absolute right-0 top-1/2 grid h-10 w-10 -translate-y-1/2 place-items-center rounded-full text-muted-foreground hover:bg-background hover:text-foreground sm:right-1 sm:h-8 sm:w-8"
className="absolute right-0 top-1/2 grid h-10 w-10 -translate-y-1/2 place-items-center rounded-full text-muted-foreground hover:text-foreground sm:right-1 sm:h-8 sm:w-8"
>
{visible ? (
<EyeOff className="h-3.5 w-3.5" aria-hidden />
@@ -992,7 +992,7 @@ export function ProvidersSettings({
? t("settings.byok.hideApiKey")
: t("settings.byok.showApiKey")
}
className="absolute right-1 top-1/2 h-7 w-7 -translate-y-1/2 rounded-full text-muted-foreground settings-hover hover:text-foreground"
className="absolute right-1 top-1/2 h-7 w-7 -translate-y-1/2 rounded-full text-muted-foreground hover:text-foreground"
>
{keyVisible ? (
<EyeOff className="h-3.5 w-3.5" aria-hidden />
@@ -1012,7 +1012,7 @@ export function ProvidersSettings({
size="icon"
onClick={() => onToggleProviderKeyEditing(provider.name)}
aria-label={t("settings.actions.edit")}
className="absolute right-1 top-1/2 h-7 w-7 -translate-y-1/2 rounded-full text-muted-foreground settings-hover hover:text-foreground"
className="absolute right-1 top-1/2 h-7 w-7 -translate-y-1/2 rounded-full text-muted-foreground hover:text-foreground"
>
<Pencil className="h-3.5 w-3.5" aria-hidden />
</Button>
@@ -1168,7 +1168,7 @@ export function ProvidersSettings({
? t("settings.byok.hideApiKey")
: t("settings.byok.showApiKey")
}
className="absolute right-1 top-1/2 h-7 w-7 -translate-y-1/2 rounded-full text-muted-foreground settings-hover hover:text-foreground"
className="absolute right-1 top-1/2 h-7 w-7 -translate-y-1/2 rounded-full text-muted-foreground hover:text-foreground"
>
{customProviderKeyVisible ? (
<EyeOff className="h-3.5 w-3.5" aria-hidden />
@@ -1,17 +1,19 @@
import {
ModelsIcon,
WebSearchIcon,
ImageGenerationIcon,
VoiceIcon,
} from "@/components/icons/product-icons";
import { useState, type Dispatch, type SetStateAction } from "react";
import {
ArrowUpCircle,
Bot,
BookOpen,
MessageCircle,
Check,
ChevronRight,
ExternalLink,
Globe2,
Github,
ImageIcon,
Loader2,
Mic,
type LucideIcon,
} from "lucide-react";
import { useTranslation } from "react-i18next";
@@ -90,7 +92,7 @@ export function OverviewSettings({
<SettingsSectionTitle>{tx("settings.sections.ai", "AI")}</SettingsSectionTitle>
<SettingsGroup>
<OverviewListRow
icon={Bot}
icon={ModelsIcon}
valueLogoProvider={activeProvider}
title={tx("settings.overview.model", "Current model")}
value={activeModelValue}
@@ -105,7 +107,7 @@ export function OverviewSettings({
<SettingsSectionTitle>{tx("settings.sections.capabilities", "Capabilities")}</SettingsSectionTitle>
<SettingsGroup>
<OverviewListRow
icon={Globe2}
icon={WebSearchIcon}
valueLogoProvider={settings.web_search.provider}
title={tx("settings.overview.webSearch", "Web search")}
value={webStatus}
@@ -113,7 +115,7 @@ export function OverviewSettings({
onClick={() => onSelectSection("browser")}
/>
<OverviewListRow
icon={ImageIcon}
icon={ImageGenerationIcon}
valueLogoProvider={settings.image_generation.provider}
title={tx("settings.overview.imageGeneration", "Image generation")}
value={imageStatus}
@@ -121,7 +123,7 @@ export function OverviewSettings({
onClick={() => onSelectSection("image")}
/>
<OverviewListRow
icon={Mic}
icon={VoiceIcon}
valueLogoProvider={transcription.provider}
title={tx("settings.overview.voiceInput", "Voice input")}
value={voiceStatus}
@@ -413,7 +415,7 @@ function OverviewRowIcon({
icon: LucideIcon;
}) {
return (
<span className="grid h-9 w-9 shrink-0 place-items-center rounded-control bg-muted text-foreground/82 transition-colors group-hover:bg-muted/80 dark:bg-muted/70">
<span className="grid h-9 w-9 shrink-0 place-items-center rounded-control bg-muted text-foreground/82 transition-colors dark:bg-muted/70">
<Icon className="h-4 w-4" aria-hidden />
</span>
);
@@ -145,8 +145,8 @@ export function DismissibleStatusMessage({
className={cn(
"flex h-8 w-8 shrink-0 items-center justify-center rounded-full transition-colors",
isError
? "text-destructive/70 hover:bg-destructive/10 hover:text-destructive"
: "text-muted-foreground/70 settings-hover hover:text-foreground",
? "text-destructive/70 hover:text-destructive"
: "text-muted-foreground/70 hover:text-foreground",
)}
>
<X className="h-3.5 w-3.5" aria-hidden />
@@ -43,7 +43,7 @@ export function SettingsTextEditor({ id, title, description, value, placeholder,
}}>
<TooltipProvider><Tooltip>
<TooltipTrigger asChild><DialogTrigger asChild>
<Button id={id} type="button" variant="ghost" disabled={disabled} aria-label={title}
<Button size="icon" id={id} type="button" variant="ghost" disabled={disabled} aria-label={title}
className="ml-auto flex h-9 w-9 shrink-0 rounded-full p-0 text-muted-foreground">
<SquarePen className="h-4 w-4" aria-hidden />
</Button>
@@ -1,3 +1,9 @@
import {
ImportIcon,
UpdateIcon,
McpIcon,
AppActionsIcon,
} from "@/components/icons/product-icons";
import {
forwardRef,
useEffect,
@@ -14,16 +20,12 @@ import {
ChevronDown,
ChevronRight,
Clipboard,
Database,
ExternalLink,
Loader2,
PauseCircle,
PlayCircle,
Plus,
RotateCcw,
Search,
Server,
SlidersHorizontal,
TriangleAlert,
Trash2,
} from "lucide-react";
@@ -440,7 +442,7 @@ function CliAppsCatalogRow({
disabled={busy}
tone="installed"
>
<Check className="h-4 w-4" aria-hidden />
<AppActionsIcon className="h-4 w-4" aria-hidden />
</AppsActionButton>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
@@ -449,7 +451,7 @@ function CliAppsCatalogRow({
{tx("settings.cliApps.test", "Test CLI")}
</DropdownMenuItem>
<DropdownMenuItem disabled={busy} onClick={() => onAction("update", app.name)}>
<RotateCcw aria-hidden />
<UpdateIcon aria-hidden />
{tx("settings.cliApps.update", "Update CLI")}
</DropdownMenuItem>
<DropdownMenuItem
@@ -674,7 +676,7 @@ function McpAppsCatalogRow({
disabled={anotherOAuthBusy}
onClick={() => openManagement("connection")}
>
<SlidersHorizontal className="h-4 w-4" aria-hidden />
<AppActionsIcon className="h-4 w-4" aria-hidden />
</AppsActionButton>
) : readyInstalled ? (
toggleable ? (
@@ -687,7 +689,7 @@ function McpAppsCatalogRow({
disabled={busy}
tone="installed"
>
<Check className="h-4 w-4" aria-hidden />
<AppActionsIcon className="h-4 w-4" aria-hidden />
</AppsActionButton>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
@@ -712,7 +714,7 @@ function McpAppsCatalogRow({
tone={runtimeConnected ? "installed" : "default"}
onClick={() => openManagement("overview")}
>
<Check className="h-4 w-4" aria-hidden />
<AppActionsIcon className="h-4 w-4" aria-hidden />
</AppsActionButton>
)
) : preset.enabled === false ? (
@@ -927,18 +929,18 @@ const AppsActionButton = forwardRef<HTMLButtonElement, AppsActionButtonProps>(
ref={ref}
type="button"
size={visibleLabel ? "sm" : "icon"}
variant="ghost"
variant={visibleLabel ? "ghost" : "icon"}
aria-label={ariaLabel}
title={ariaLabel}
title={visibleLabel ? undefined : ariaLabel}
disabled={disabled || busy}
className={cn(
"rounded-full text-muted-foreground transition-colors",
visibleLabel
? "h-8 w-auto gap-1.5 px-3 text-[12px] font-semibold"
: "h-9 w-9",
tone === "installed" && "bg-transparent settings-hover hover:text-foreground",
tone === "danger" && "bg-transparent hover:bg-destructive/10 hover:text-destructive",
tone === "default" && "bg-muted/70 settings-hover hover:text-foreground",
tone === "installed" && "bg-transparent hover:text-foreground",
tone === "danger" && "bg-transparent hover:text-destructive",
tone === "default" && "bg-muted/70 hover:text-foreground",
className,
)}
>
@@ -1038,7 +1040,7 @@ function McpCustomServerPanel({
<div className="flex flex-col gap-3 px-3 py-3 sm:flex-row sm:items-center sm:justify-between">
<div className="flex min-w-0 items-center gap-3">
<span className="grid h-9 w-9 shrink-0 place-items-center rounded-control bg-muted text-muted-foreground">
<Server className="h-4 w-4" aria-hidden />
<McpIcon className="h-4 w-4" aria-hidden />
</span>
<div className="min-w-0">
<h3 className="text-[13px] font-semibold leading-5 text-foreground">
@@ -1060,7 +1062,7 @@ function McpCustomServerPanel({
onClick={() => setActiveMode((mode) => (mode === "custom" ? null : "custom"))}
className="h-8 rounded-full px-3 text-[12px] font-semibold"
>
<Server className="mr-1.5 h-3.5 w-3.5" aria-hidden />
<McpIcon className="mr-1.5 h-3.5 w-3.5" aria-hidden />
{tx("settings.mcp.customAction", "Custom")}
</Button>
<Button
@@ -1070,7 +1072,7 @@ function McpCustomServerPanel({
onClick={() => setActiveMode((mode) => (mode === "import" ? null : "import"))}
className="h-8 rounded-full px-3 text-[12px] font-semibold"
>
<Database className="mr-1.5 h-3.5 w-3.5" aria-hidden />
<ImportIcon className="mr-1.5 h-3.5 w-3.5" aria-hidden />
{tx("settings.mcp.importAction", "Import")}
</Button>
</div>
@@ -1275,7 +1277,7 @@ function McpCustomServerPanel({
disabled={!configImport.trim() || importBusy}
className="h-9 shrink-0 rounded-full px-4 text-[12.5px] font-semibold"
>
{importBusy ? <Loader2 className="mr-1.5 h-3.5 w-3.5 animate-spin" aria-hidden /> : <Database className="mr-1.5 h-3.5 w-3.5" aria-hidden />}
{importBusy ? <Loader2 className="mr-1.5 h-3.5 w-3.5 animate-spin" aria-hidden /> : <ImportIcon className="mr-1.5 h-3.5 w-3.5" aria-hidden />}
{tx("settings.mcp.importConfig", "Import")}
</Button>
</div>
@@ -187,7 +187,7 @@ export function AutomationsSettings({
const filters = visibleJobs.length ? (
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button variant="ghost" size="sm" aria-label={filterLabel} title={filterLabel}
<Button variant="ghost" size="sm" aria-label={filterLabel} title={filter === "all" ? filterLabel : undefined}
className={cn("h-8 text-[12px]", filter === "all" ? "w-8 p-0 text-muted-foreground" : "gap-1.5 bg-background text-foreground")}>
<ListFilter className="h-4 w-4" strokeWidth={1.5} aria-hidden />
{filter !== "all" ? filterLabel : null}
@@ -168,7 +168,7 @@ export function ChannelsSettings({
<div className="relative">
<div className="absolute end-6 top-6 z-10 flex h-10 items-center gap-1">
{selectedChannel ? <ChannelHelpMenu feature={selectedChannel} chatAppsDocsUrl={chatAppsDocsUrl} /> : null}
<DialogClose className="grid h-8 w-8 place-items-center rounded-full text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring">
<DialogClose className="grid h-8 w-8 place-items-center rounded-full text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring">
<X className="h-4 w-4" aria-hidden />
<span className="sr-only">{t("common.close")}</span>
</DialogClose>
@@ -1,15 +1,8 @@
import { useEffect, useMemo, useRef, useState, type ReactNode } from "react";
import {
Check,
ExternalLink,
Loader2,
RotateCcw,
Search,
Server,
SlidersHorizontal,
Trash2,
X,
} from "lucide-react";
AppActionsIcon,
} from "@/components/icons/product-icons";
import { useEffect, useMemo, useRef, useState, type ReactNode } from "react";
import { Check, ExternalLink, Loader2, RotateCcw, Search, Server, Trash2, X } from "lucide-react";
import { useTranslation } from "react-i18next";
import { Button } from "@/components/ui/button";
@@ -383,7 +376,7 @@ function ToolsPanel({
{testBusy ? (
<Loader2 className="h-4 w-4 animate-spin motion-reduce:animate-none" aria-hidden />
) : (
<SlidersHorizontal className="h-4 w-4" aria-hidden />
<AppActionsIcon className="h-4 w-4" aria-hidden />
)}
</div>
<p