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

@@ -11,7 +11,7 @@ export function HostConnectionStatus({ state, compact = false }: {
}) {
const { t } = useTranslation();
const label = t(`connection.${state}`);
return <span role="status" title={label} className="inline-flex shrink-0 items-center gap-1.5 text-xs text-muted-foreground">
return <span role="status" title={compact ? label : undefined} className="inline-flex shrink-0 items-center gap-1.5 text-xs text-muted-foreground">
{state === "connecting" ? <Loader2 aria-hidden className="h-3.5 w-3.5 animate-spin motion-reduce:animate-none" />
: state === "error" ? <CircleAlert aria-hidden className="h-3.5 w-3.5 text-amber-600 dark:text-amber-400" />
: <span aria-hidden className={cn("h-1.5 w-1.5 rounded-full", state === "open" ? "bg-emerald-500" : "bg-muted-foreground/40")} />}
+9 -5
View File
@@ -2,6 +2,7 @@ import { createContext, useContext, useEffect, useRef, useState } from "react";
import { Check, ChevronUp, CircleAlert, Laptop, Loader2, Search, Server, Settings2, X } from "lucide-react";
import { useTranslation } from "react-i18next";
import { Button } from "@/components/ui/button";
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip";
import { ConnectionBadge } from "@/components/ConnectionBadge";
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger } from "@/components/ui/dropdown-menu";
import { useClient } from "@/providers/ClientProvider";
@@ -147,9 +148,9 @@ export function HostSwitcher({ collapsed = false, portalContainer }: { collapsed
const identity = picker.name === picker.hostname ? picker.name : `${picker.name} · ${picker.hostname}`;
const current = `${identity} · ${currentLabel}`;
const detail = pendingName ? `${current} · ${t("remote.preparing", { name: pendingName })}` : current;
const title = picker.error ? `${detail} — ${picker.error}` : detail;
const button = <Button ref={buttonRef} variant="ghost" size="sm" aria-label={t("remote.switchHost")} title={title}
data-host-switcher className={cn("host-no-drag h-8 min-w-0 gap-2 rounded-xl px-2 text-xs font-normal text-sidebar-content/75 hover:bg-sidebar-accent/65 hover:text-sidebar-content",
const hint = picker.error ? `${detail} — ${picker.error}` : detail;
const button = <Button ref={buttonRef} variant="ghost" size="sm" aria-label={t("remote.switchHost")}
data-host-switcher className={cn("host-no-drag touch-target h-8 min-w-0 gap-2 rounded-xl px-2 text-xs font-normal text-sidebar-content/75 hover:text-sidebar-content",
collapsed ? "w-8 justify-center px-0" : "max-w-full flex-1 justify-start")}
onClick={picker.kind === "embedded" ? () => {
const rect = buttonRef.current?.getBoundingClientRect();
@@ -163,9 +164,12 @@ export function HostSwitcher({ collapsed = false, portalContainer }: { collapsed
{!collapsed && <><span className="truncate">{label}</span><ChevronUp className="ml-auto h-3 w-3 shrink-0 opacity-60" /></>}
<span className="sr-only" role="status">{detail}</span>
</Button>;
if (!shell) return button;
const trigger = <TooltipTrigger asChild>{button}</TooltipTrigger>;
// The mobile sidebar already owns the modal lock; a nested lock can outlive it on navigation.
return <DropdownMenu modal={!portalContainer}><DropdownMenuTrigger asChild>{button}</DropdownMenuTrigger><HostMenuContent picker={shell} portalContainer={portalContainer} /></DropdownMenu>;
return <TooltipProvider><Tooltip>
{shell ? <DropdownMenu modal={!portalContainer}><DropdownMenuTrigger asChild>{trigger}</DropdownMenuTrigger><HostMenuContent picker={shell} portalContainer={portalContainer} /></DropdownMenu> : trigger}
<TooltipContent side="top">{hint}</TooltipContent>
</Tooltip></TooltipProvider>;
}
/** Parent-owned menu anchored to the active remote sidebar, never inside its DOM. */
@@ -510,7 +510,7 @@ export function RemoteConnectionsPage({ mainNavigationExpanded = false, hostChro
{busy.startsWith("pick-") && <p role="status" className="text-xs text-muted-foreground">{t("remote.setup.pickingFile")}</p>}
<div className="remote-dialog-actions">
<Button type="button" variant="ghost" onClick={closeEditor}>{t("common.cancel")}</Button>
<Button type="submit" className="min-w-0" title={t(editorLabel)} aria-label={t(editorLabel)} aria-busy={!!busy} disabled={!!busy || !form.host.trim() || (locationStep && !form.config_path.trim())}>
<Button type="submit" className="min-w-0" aria-label={t(editorLabel)} aria-busy={!!busy} disabled={!!busy || !form.host.trim() || (locationStep && !form.config_path.trim())}>
{busy && !busy.startsWith("pick-") && <Loader2 aria-hidden className="mr-2 h-4 w-4 shrink-0 animate-spin motion-reduce:animate-none" />}
<span role={busy && !busy.startsWith("pick-") ? "status" : undefined} className="min-w-0">{t(editorLabel)}</span>
</Button>