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:
1 parent
9dc0abae4f
commit
63bdd40280
59 files changed
+615
-505
No files matched your search
@@ -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. */
|
||||
|
||||
Reference in new issue
Block a user