fix(studio): use explicit Cancel for model load toast (#4377)

This commit is contained in:
Lee Jackson 2026-03-18 05:39:51 +00:00 committed by GitHub
commit 9232126734
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4,7 +4,6 @@
import { Progress } from "@/components/ui/progress";
import { Spinner } from "@/components/ui/spinner";
import { Button } from "@/components/ui/button";
import { XIcon } from "lucide-react";
type ModelLoadDescriptionProps = {
title?: string | null;
@ -28,11 +27,11 @@ export function ModelLoadDescription({
const hasProgress = typeof progressPercent === "number";
return (
<div className="flex min-h-12 w-full items-stretch gap-2">
<div className="relative flex min-h-12 w-full items-stretch gap-2">
<div className="flex h-full shrink-0 items-center self-center">
<Spinner className="size-4 text-foreground" />
</div>
<div className="min-w-0 flex-1">
<div className="min-w-0 flex-1 pr-5">
{title ? <p className="text-foreground leading-5 font-semibold">{title}</p> : null}
{hasProgress ? (
<div className="w-full pt-1">
@ -49,13 +48,13 @@ export function ModelLoadDescription({
{onStop ? (
<Button
type="button"
size="icon-sm"
size="xs"
variant="ghost"
aria-label="Stop model loading"
className="h-auto w-10 self-stretch shrink-0 rounded-xl text-muted-foreground hover:bg-destructive/10 hover:text-destructive focus-visible:text-destructive"
className="h-auto self-stretch shrink-0 !rounded-none !border-0 bg-transparent px-1 text-[10px] text-muted-foreground hover:bg-transparent hover:text-destructive focus-visible:text-destructive"
onClick={onStop}
>
<XIcon className="size-3.5" />
Cancel
</Button>
) : null}
</div>