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

+6 -2
View File
@@ -241,17 +241,21 @@ function RecoveryPreview() {
function SandboxPreview() {
const { t } = useGalleryTranslation();
const [backend, setBackend] = useState<"bwrap" | "seatbelt" | null>("bwrap");
const gateway = backend === "bwrap" ? "Linux / fnOS" : backend === "seatbelt" ? "macOS" : t("previews.sandbox.unknownGateway");
const [issue, setIssue] = useState<SandboxIssue>("missing");
const [dismissed, setDismissed] = useState(false);
const [opened, setOpened] = useState(false);
return <div className="space-y-4">
<StatePicker label={t("previews.sandbox.gateway")} value={gateway} options={["Linux / fnOS", "macOS", t("previews.sandbox.unknownGateway")]}
onChange={(value) => setBackend(value === "Linux / fnOS" ? "bwrap" : value === "macOS" ? "seatbelt" : null)} />
<div className="flex flex-wrap gap-2">
{(["missing", "permissions", "startup"] as const).map((value) => <Button key={value}
variant={issue === value ? "secondary" : "outline"} size="sm" className="rounded-full"
onClick={() => { setIssue(value); setDismissed(false); setOpened(false); }}>{t(`previews.sandbox.${value}`)}</Button>)}
</div>
<div className="thread-composer-stack">
{!dismissed ? <SandboxNotice issue={issue} onDismiss={() => setDismissed(true)} onOpenSettings={() => setOpened(true)} /> : null}
{!dismissed ? <SandboxNotice issue={issue} backend={backend} onDismiss={() => setDismissed(true)} onOpenSettings={() => setOpened(true)} /> : null}
<ThreadComposer workspaceControlsHidden onSend={() => false} onStop={() => {}} />
</div>
<Button variant="outline" size="sm" onClick={() => setDismissed(false)}>{t("previews.fallback.showAgain")}</Button>
@@ -374,7 +378,7 @@ export const conversationExamples: ComponentExample[] = [
code: '<ModelFallbackNotice model="gpt-4.1" onDismiss={dismiss} onOpenSettings={openModelSettings} />' },
{ title: "previews.sandbox.title", files: ["thread/SandboxNotice"], Preview: SandboxPreview,
description: "previews.sandbox.description", options: "previews.sandbox.options",
code: '<SandboxNotice issue="missing" onDismiss={dismiss} onOpenSettings={openSandboxSettings} />' },
code: '<SandboxNotice issue="missing" backend="bwrap" onDismiss={dismiss} onOpenSettings={openSandboxSettings} />' },
{ title: "previews.compaction.title", files: ["thread/ContextCompactionNotice"], Preview: CompactionPreview,
description: "previews.compaction.description", options: "previews.compaction.options",
code: '<ContextCompactionNotice compaction={{ id: "compaction-1", phase: "succeeded", announce: true }} />' },
@@ -180,6 +180,8 @@
"hint": "Select a recovery state, then try continuing or dismissing."
},
"sandbox": {
"gateway": "Example gateway",
"unknownGateway": "Not specified",
"title": "Command notice",
"description": "Use the production notice to compare missing components, unprotected installations, and startup failures.",
"options": "The notice does not take focus or retry commands. Change its state, dismiss it, and keep typing.",
@@ -180,6 +180,8 @@
"hint": "Elige un estado de recuperación y prueba a continuar o cerrar."
},
"sandbox": {
"gateway": "Pasarela de ejemplo",
"unknownGateway": "Sin especificar",
"title": "Aviso de comandos",
"description": "Compara componentes ausentes, instalaciones sin protección y errores de inicio con el componente real.",
"options": "El aviso no toma el foco ni reintenta comandos. Cambia el estado, ciérralo y sigue escribiendo.",
@@ -180,6 +180,8 @@
"hint": "Sélectionnez un état de reprise, puis essayez de continuer ou de fermer."
},
"sandbox": {
"gateway": "Passerelle d’exemple",
"unknownGateway": "Non précisée",
"title": "Avis de commande",
"description": "Comparez les composants manquants, les installations non protégées et les échecs de démarrage avec le composant réel.",
"options": "L’avis ne prend pas le focus et ne relance aucune commande. Changez son état, fermez-le et continuez à saisir.",
@@ -180,6 +180,8 @@
"hint": "Pilih status pemulihan, lalu coba lanjutkan atau tutup."
},
"sandbox": {
"gateway": "Contoh gateway",
"unknownGateway": "Tidak ditentukan",
"title": "Pemberitahuan perintah",
"description": "Bandingkan komponen yang hilang, pemasangan tidak terlindungi, dan kegagalan awal dengan komponen produksi.",
"options": "Pemberitahuan tidak mengambil fokus atau mengulang perintah. Ubah status, tutup, lalu lanjutkan mengetik.",
@@ -180,6 +180,8 @@
"hint": "復旧状態を選び、続行または閉じる操作を試してください。"
},
"sandbox": {
"gateway": "サンプルのゲートウェイ",
"unknownGateway": "未指定",
"title": "コマンドの通知",
"description": "実際のコンポーネントで、コンポーネントの欠落、保護されていないインストール、起動失敗を比較します。",
"options": "通知はフォーカスを奪わず、コマンドを再実行しません。状態を切り替え、閉じて入力を続けられます。",
@@ -180,6 +180,8 @@
"hint": "복구 상태를 선택한 후 계속하거나 닫아 보세요."
},
"sandbox": {
"gateway": "예시 게이트웨이",
"unknownGateway": "지정되지 않음",
"title": "명령 알림",
"description": "실제 구성 요소로 누락된 구성 요소, 보호되지 않은 설치 위치, 시작 실패를 비교합니다.",
"options": "알림은 포커스를 가져오거나 명령을 재시도하지 않습니다. 상태를 바꾸고 닫은 후 계속 입력할 수 있습니다.",
@@ -180,6 +180,8 @@
"hint": "Selecione um estado de recuperação e teste continuar ou fechar."
},
"sandbox": {
"gateway": "Gateway de exemplo",
"unknownGateway": "Não especificado",
"title": "Aviso de comandos",
"description": "Compare componentes ausentes, instalações desprotegidas e falhas de inicialização com o componente real.",
"options": "O aviso não toma o foco nem repete comandos. Mude o estado, feche-o e continue digitando.",
@@ -180,6 +180,8 @@
"hint": "Chọn trạng thái khôi phục, rồi thử tiếp tục hoặc đóng."
},
"sandbox": {
"gateway": "Gateway minh họa",
"unknownGateway": "Chưa chỉ định",
"title": "Thông báo lệnh",
"description": "So sánh thành phần bị thiếu, vị trí cài đặt không được bảo vệ và lỗi khởi động bằng thành phần thực tế.",
"options": "Thông báo không chiếm tiêu điểm hay tự chạy lại lệnh. Đổi trạng thái, đóng thông báo rồi tiếp tục nhập.",
@@ -180,6 +180,8 @@
"hint": "选择恢复状态,再试用继续或关闭。"
},
"sandbox": {
"gateway": "示例网关系统",
"unknownGateway": "未指定",
"title": "命令提示",
"description": "使用正式提示组件,体验缺失组件、安装位置受限和启动异常三种状态。",
"options": "提示不抢焦点,也不自动重试命令。可切换状态、关闭提示并继续输入。",
@@ -180,6 +180,8 @@
"hint": "選擇復原狀態,再試用繼續或關閉。"
},
"sandbox": {
"gateway": "範例閘道系統",
"unknownGateway": "未指定",
"title": "指令提示",
"description": "使用正式提示元件,體驗缺少元件、安裝位置受限與啟動異常三種狀態。",
"options": "提示不會搶焦點,也不會自動重試指令。可切換狀態、關閉提示並繼續輸入。",