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,4 +1,4 @@
import type { CSSProperties, ReactNode } from "react";
import { useRef, useState, type CSSProperties, type ReactNode } from "react";
import type { LucideIcon } from "lucide-react";
import { StreamingLabelSheen } from "@/components/MessageBubble";
@@ -40,8 +40,11 @@ export function ActivityStep({
markerClassName,
style,
}: ActivityStepProps) {
const lineRef = useRef<HTMLDivElement>(null);
const [hintOpen, setHintOpen] = useState(false);
const line = (
<div
ref={lineRef}
data-testid="activity-line"
tabIndex={typeof label === "string" ? 0 : undefined}
className="flex min-w-0 items-center gap-1.5 overflow-hidden whitespace-nowrap"
@@ -50,7 +53,7 @@ export function ActivityStep({
active={active && animateLabel}
className={cn(
"min-w-0 flex-1 truncate font-medium",
tone === "error" ? "text-destructive/78" : "text-muted-foreground/85",
tone === "error" ? "text-destructive/[0.78]" : "text-muted-foreground",
labelClassName,
)}
>
@@ -80,15 +83,12 @@ export function ActivityStep({
{marker ?? (
<span
className={cn(
"grid h-3.5 w-3.5 place-items-center rounded-full border bg-background transition-colors",
tone === "active" && "border-muted-foreground/28 text-muted-foreground/72",
tone === "success" && "border-emerald-500/28 text-emerald-500/78",
tone === "error" && "border-destructive/30 text-destructive/78",
tone === "neutral" && "border-muted-foreground/18 text-muted-foreground/50",
"grid h-3.5 w-3.5 place-items-center transition-colors",
tone === "error" ? "text-destructive/[0.78]" : "text-muted-foreground",
markerClassName,
)}
>
{Icon ? <Icon className="h-2.5 w-2.5" strokeWidth={2.15} /> : null}
{Icon ? <Icon className="h-3.5 w-3.5" strokeWidth={1.75} /> : null}
</span>
)}
</span>
@@ -96,7 +96,11 @@ export function ActivityStep({
<div className={cn("min-w-0", contentClassName)}>
{typeof label === "string" ? (
<TooltipProvider>
<Tooltip>
<Tooltip open={hintOpen} onOpenChange={(open) => {
const truncated = Array.from(lineRef.current?.querySelectorAll<HTMLElement>(".truncate") ?? [])
.some((element) => element.scrollWidth > element.clientWidth);
setHintOpen(open && (truncated || tooltipContent !== undefined && tooltipContent !== label));
}}>
<TooltipTrigger asChild>{line}</TooltipTrigger>
<TooltipContent side="top" className="max-w-[min(32rem,calc(100vw-2rem))] whitespace-pre-wrap break-words">
{tooltipContent ?? label}