feat(webui): add session-scoped reasoning effort (#6441)
* feat(webui): add session-scoped model options Extend the composer preset menu with inherited reasoning effort and Codex Fast mode overrides. Persist choices with ordinary inputs, isolate captured runtimes, and restore browser preferences without changing shared presets. Add regression coverage for pending preset ordering, settings initialization, session and host isolation, queue edits, Codex request mapping, and narrow-screen controls. * feat(webui): refine session model options and add Codex Ultrafast Fit the composer options into a compact single row and preview reasoning effort only during a drag. Add Fast/Ultrafast controls for eligible Codex models, preserve explicit session choices across reloads, and document the speed tiers. * fix(webui): add Codex speed control to the component gallery * fix(webui): preserve saved model options after preset rename Use the session options for display when a browser preference no longer matches the preset. Omit model options from the next message unless the browser has a matching choice, so stale preferences cannot overwrite options the gateway already saved.
This commit is contained in:
1 parent
2b232c9133
commit
0f45d74fec
82 files changed
+2289
-113
No files matched your search
@@ -3,6 +3,7 @@ import { SidebarPanel } from "@/components/ui/sidebar-panel";
|
||||
import { Plus } from "lucide-react";
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { CodexSpeedControl } from "@/components/ui/codex-speed-control";
|
||||
import { Input, SearchInput } from "@/components/ui/input";
|
||||
import { Textarea } from "@/components/ui/textarea";
|
||||
import { ToggleButton } from "@/components/ui/toggle-button";
|
||||
@@ -21,6 +22,7 @@ import { ExpandableText } from "@/components/ui/expandable-text";
|
||||
import { StreamingLabelSheen } from "@/components/ui/streaming-label-sheen";
|
||||
import { LoadingRing } from "@/components/ui/loading-ring";
|
||||
import { ImageViewport } from "@/components/ui/image-viewport";
|
||||
import type { CodexFastMode } from "@/lib/types";
|
||||
import { Sample, type ComponentExample } from "./example";
|
||||
import { useGalleryTranslation } from "./i18n";
|
||||
|
||||
@@ -79,6 +81,11 @@ function Switches() {
|
||||
</div>;
|
||||
}
|
||||
|
||||
function CodexSpeedPreview() {
|
||||
const [value, setValue] = useState<CodexFastMode>(false);
|
||||
return <CodexSpeedControl value={value} onChange={setValue} ultrafastSupported />;
|
||||
}
|
||||
|
||||
function Selects() {
|
||||
const { t } = useGalleryTranslation();
|
||||
const [value, setValue] = useState("default");
|
||||
@@ -279,6 +286,9 @@ export const foundationExamples: ComponentExample[] = [
|
||||
description: "controls.textarea.description", options: "controls.textarea.options", code: '<Textarea aria-label="Notes" value={notes} onChange={event => setNotes(event.target.value)} />' },
|
||||
{ title: "controls.toggle.title", files: ["toggle-button"], Preview: Switches,
|
||||
description: "controls.toggle.description", options: "controls.toggle.options", code: '<ToggleButton checked={enabled} onChange={setEnabled} label="Enable feature" />' },
|
||||
{ title: "controls.codexSpeed.title", files: ["codex-speed-control"], Preview: CodexSpeedPreview,
|
||||
description: "controls.codexSpeed.description", options: "controls.codexSpeed.options",
|
||||
code: 'const [value, setValue] = useState<CodexFastMode>(false);\n<CodexSpeedControl value={value} onChange={setValue} ultrafastSupported />' },
|
||||
{ title: "controls.select.title", files: ["select"], Preview: Selects,
|
||||
description: "controls.select.description", options: "controls.select.options",
|
||||
code: '<Select value={value} onValueChange={setValue}>\n <SelectTrigger aria-label="Model"><SelectValue /></SelectTrigger>\n <SelectContent><SelectItem value="default">Default</SelectItem></SelectContent>\n</Select>' },
|
||||
|
||||
@@ -54,6 +54,11 @@
|
||||
"model": "Example model",
|
||||
"disabledModel": "Disabled model"
|
||||
},
|
||||
"codexSpeed": {
|
||||
"title": "Codex speed",
|
||||
"description": "Choose Fast or Ultrafast. Select the active speed again to turn it off.",
|
||||
"options": "Show Ultrafast for supported models."
|
||||
},
|
||||
"segmented": {
|
||||
"title": "Segmented choices",
|
||||
"description": "A short, always-visible set of choices.",
|
||||
|
||||
@@ -54,6 +54,11 @@
|
||||
"model": "Modelo de ejemplo",
|
||||
"disabledModel": "Selector de modelo desactivado"
|
||||
},
|
||||
"codexSpeed": {
|
||||
"title": "Velocidad de Codex",
|
||||
"description": "Elige Fast o Ultrarrápido. Vuelve a seleccionar el modo activo para desactivarlo.",
|
||||
"options": "Muestra Ultrarrápido en los modelos compatibles."
|
||||
},
|
||||
"segmented": {
|
||||
"title": "Selección segmentada",
|
||||
"description": "Un pequeño conjunto de opciones siempre visibles.",
|
||||
|
||||
@@ -54,6 +54,11 @@
|
||||
"model": "Modèle d’exemple",
|
||||
"disabledModel": "Sélecteur de modèle désactivé"
|
||||
},
|
||||
"codexSpeed": {
|
||||
"title": "Vitesse de Codex",
|
||||
"description": "Choisissez Fast ou Ultrarapide. Sélectionnez de nouveau le mode actif pour le désactiver.",
|
||||
"options": "Affiche Ultrarapide pour les modèles compatibles."
|
||||
},
|
||||
"segmented": {
|
||||
"title": "Choix segmentés",
|
||||
"description": "Un petit ensemble de choix toujours visibles.",
|
||||
|
||||
@@ -54,6 +54,11 @@
|
||||
"model": "Model contoh",
|
||||
"disabledModel": "Pemilih model yang dinonaktifkan"
|
||||
},
|
||||
"codexSpeed": {
|
||||
"title": "Kecepatan Codex",
|
||||
"description": "Pilih Fast atau Ultracepat. Pilih kembali mode yang aktif untuk menonaktifkannya.",
|
||||
"options": "Tampilkan Ultracepat untuk model yang mendukungnya."
|
||||
},
|
||||
"segmented": {
|
||||
"title": "Pilihan bersegmen",
|
||||
"description": "Sekumpulan kecil pilihan yang selalu terlihat.",
|
||||
|
||||
@@ -54,6 +54,11 @@
|
||||
"model": "サンプルのモデル",
|
||||
"disabledModel": "無効化されたモデル選択"
|
||||
},
|
||||
"codexSpeed": {
|
||||
"title": "Codex の速度",
|
||||
"description": "Fast または超高速を選びます。選択中のモードをもう一度選ぶと解除できます。",
|
||||
"options": "対応モデルでは超高速を表示します。"
|
||||
},
|
||||
"segmented": {
|
||||
"title": "セグメント選択",
|
||||
"description": "少数の選択肢を常に表示します。",
|
||||
|
||||
@@ -54,6 +54,11 @@
|
||||
"model": "예제 모델",
|
||||
"disabledModel": "비활성화된 모델 선택"
|
||||
},
|
||||
"codexSpeed": {
|
||||
"title": "Codex 속도",
|
||||
"description": "Fast 또는 초고속을 선택합니다. 선택된 모드를 다시 누르면 해제됩니다.",
|
||||
"options": "지원 모델에 초고속을 표시합니다."
|
||||
},
|
||||
"segmented": {
|
||||
"title": "분할 선택",
|
||||
"description": "적은 수의 선택지를 항상 표시합니다.",
|
||||
|
||||
@@ -54,6 +54,11 @@
|
||||
"model": "Modelo de exemplo",
|
||||
"disabledModel": "Seletor de modelo desativado"
|
||||
},
|
||||
"codexSpeed": {
|
||||
"title": "Velocidade do Codex",
|
||||
"description": "Escolha Fast ou Ultrarrápido. Selecione o modo ativo novamente para desativá-lo.",
|
||||
"options": "Mostra Ultrarrápido nos modelos compatíveis."
|
||||
},
|
||||
"segmented": {
|
||||
"title": "Escolhas segmentadas",
|
||||
"description": "Um pequeno conjunto de escolhas sempre visíveis.",
|
||||
|
||||
@@ -54,6 +54,11 @@
|
||||
"model": "Mô hình ví dụ",
|
||||
"disabledModel": "Bộ chọn mô hình bị vô hiệu hóa"
|
||||
},
|
||||
"codexSpeed": {
|
||||
"title": "Tốc độ Codex",
|
||||
"description": "Chọn Fast hoặc Siêu nhanh. Chọn lại chế độ đang bật để tắt.",
|
||||
"options": "Hiển thị Siêu nhanh cho các mô hình được hỗ trợ."
|
||||
},
|
||||
"segmented": {
|
||||
"title": "Lựa chọn phân đoạn",
|
||||
"description": "Một nhóm ít lựa chọn luôn hiển thị.",
|
||||
|
||||
@@ -54,6 +54,11 @@
|
||||
"model": "示例模型",
|
||||
"disabledModel": "禁用的模型选择器"
|
||||
},
|
||||
"codexSpeed": {
|
||||
"title": "Codex 加速",
|
||||
"description": "选择 Fast 或极速,再点一次当前档位即可关闭。",
|
||||
"options": "仅为支持的模型显示极速档。"
|
||||
},
|
||||
"segmented": {
|
||||
"title": "分段选择",
|
||||
"description": "始终可见的一组简短选项。",
|
||||
|
||||
@@ -54,6 +54,11 @@
|
||||
"model": "範例模型",
|
||||
"disabledModel": "停用的模型選擇器"
|
||||
},
|
||||
"codexSpeed": {
|
||||
"title": "Codex 加速",
|
||||
"description": "選擇 Fast 或極速,再按一次目前的選項即可關閉。",
|
||||
"options": "只為支援的模型顯示極速選項。"
|
||||
},
|
||||
"segmented": {
|
||||
"title": "分段選擇",
|
||||
"description": "一組簡短且持續顯示的選項。",
|
||||
|
||||
Reference in new issue
Block a user