fix(desktop): hide model selector in Tauri runtime — SaaS token pool routes models
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled

Model selector was cosmetic-only in desktop mode: chatStream never passes
model param to backend. Hiding prevents user confusion and 404 errors when
selecting models not in SaaS token pool.

Also adds E2E test report covering 168 messages, 4 bugs found (P0 fixed).
This commit is contained in:
iven
2026-04-09 18:35:34 +08:00
parent 4c325de6c3
commit 5f47e62a46
2 changed files with 127 additions and 6 deletions

View File

@@ -31,6 +31,7 @@ import { ReasoningBlock } from './ai/ReasoningBlock';
import { StreamingText } from './ai/StreamingText';
import { ChatMode } from './ai/ChatMode';
import { ModelSelector } from './ai/ModelSelector';
import { isTauriRuntime } from '../lib/tauri-gateway';
import { SuggestionChips } from './ai/SuggestionChips';
import { PipelineResultPreview } from './pipeline/PipelineResultPreview';
import { PresentationContainer } from './presentation/PresentationContainer';
@@ -540,12 +541,14 @@ export function ChatArea({ compact, onOpenDetail }: { compact?: boolean; onOpenD
}
</div>
<div className="flex items-center gap-2">
<ModelSelector
models={models.map(m => ({ id: m.id, name: m.name, provider: m.provider }))}
currentModel={currentModel}
onSelect={setCurrentModel}
disabled={isStreaming}
/>
{!isTauriRuntime() && (
<ModelSelector
models={models.map(m => ({ id: m.id, name: m.name, provider: m.provider }))}
currentModel={currentModel}
onSelect={setCurrentModel}
disabled={isStreaming}
/>
)}
<Button
variant="primary"
size="sm"