fix(webui): name the gateway sandbox launcher in setup guidance

This commit is contained in:
Xubin Ren committed 2026-11-08 14:29:46 +08:00
1 parent f5e5bd6ea0
commit 44d567e37c
31 files changed
+230 -86

No files matched your search

@@ -2,26 +2,31 @@ import { ArrowRight, ShieldAlert, X } from "lucide-react";
import { useTranslation } from "react-i18next";
import { Button } from "@/components/ui/button";
import { sandboxLauncherDisplay } from "@/lib/sandbox-display";
import type { SandboxCheck } from "@/lib/types";
export type SandboxIssue = "missing" | "path" | "permissions" | "startup";
/** A command needs attention; the conversation itself is still usable. */
export function SandboxNotice({ issue, onOpenSettings, onDismiss }: {
export function SandboxNotice({ issue, backend, onOpenSettings, onDismiss }: {
issue: SandboxIssue;
backend?: SandboxCheck["supported_backend"];
onOpenSettings: () => void;
onDismiss: () => void;
}) {
const { t } = useTranslation();
const launcher = sandboxLauncherDisplay(backend);
const configurePath = launcher && (issue === "missing" || issue === "path");
return <div role="status" aria-live="polite" aria-atomic="true"
className="thread-composer-notice mb-2 flex items-start gap-3 rounded-control border border-border/60 bg-muted/40 px-3 py-3 text-caption text-foreground animate-in fade-in-0 slide-in-from-bottom-1 motion-reduce:animate-none">
<ShieldAlert className="mt-0.5 h-4 w-4 shrink-0 text-muted-foreground" aria-hidden />
<div className="flex min-w-0 flex-1 flex-wrap items-center gap-x-4 gap-y-2">
<div className="min-w-0 flex-1 basis-64 leading-5">
<p className="font-medium">{t("settings.sandbox.notice.title")}</p>
<p className="mt-0.5 break-words text-muted-foreground">{t(`settings.sandbox.notice.${issue}`)}</p>
<p className="mt-0.5 break-words text-muted-foreground">{t(`settings.sandbox.notice.${issue}`, { launcher: launcher?.name ?? t("settings.sandbox.launcher") })}</p>
</div>
<Button variant="outline" size="sm" className="shrink-0 gap-1.5 rounded-full" onClick={onOpenSettings}>
{t("settings.sandbox.notice.openSettings")}<ArrowRight className="h-3.5 w-3.5" aria-hidden />
<Button variant="outline" size="sm" className="h-auto min-h-8 max-w-full shrink-0 gap-1.5 whitespace-normal rounded-full py-1.5 text-left" onClick={onOpenSettings}>
{configurePath ? t("settings.sandbox.notice.configurePath", { launcher: launcher.executable }) : t("settings.sandbox.notice.openSettings")}<ArrowRight className="h-3.5 w-3.5 shrink-0" aria-hidden />
</Button>
</div>
<Button variant="ghost" size="icon" className="h-6 w-6 shrink-0 rounded-full text-muted-foreground"
@@ -1360,6 +1360,7 @@ export function ThreadShell({
) : null}
{sandboxNotice.issue && onOpenSandboxSettings && !streamError && !recoveryState ? (
<SandboxNotice issue={sandboxNotice.issue} onDismiss={sandboxNotice.dismiss}
backend={settingsSnapshot?.advanced.exec_sandbox_status?.supported_backend}
onOpenSettings={() => onOpenSandboxSettings(
sandboxNotice.issue === "missing" || sandboxNotice.issue === "path" ? "sandbox-launcher" : "sandbox",
)} />