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>