fix(聊天页面): 思考模式开关仅在非Codex模型时显示

- 添加模型类型判断逻辑
- Codex 模型不支持思考模式,隐藏开关按钮
- 优化用户体验,避免无效操作
This commit is contained in:
gaoziman 2025-12-24 00:09:05 +08:00
parent ec4f5f2dba
commit bd09e67988

View File

@ -479,20 +479,22 @@ export default function ChatPage({ params }: PageProps) {
)} )}
</div> </div>
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
{/* 思考模式开关 */} {/* 思考模式开关 - 只在非 Codex 模型时显示 */}
<button {!selectedModelId.toLowerCase().includes('codex') && (
onClick={handleThinkingToggle} <button
className={cn( onClick={handleThinkingToggle}
'flex items-center gap-2 px-3 py-1.5 text-sm rounded-lg transition-colors', className={cn(
enableThinking 'flex items-center gap-2 px-3 py-1.5 text-sm rounded-lg transition-colors',
? 'bg-[var(--color-primary-light)] text-[var(--color-primary)]' enableThinking
: 'text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-hover)]' ? 'bg-[var(--color-primary-light)] text-[var(--color-primary)]'
)} : 'text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-hover)]'
title={enableThinking ? '关闭思考模式' : '开启思考模式'} )}
> title={enableThinking ? '关闭思考模式' : '开启思考模式'}
<Clock size={16} /> >
<span></span> <Clock size={16} />
</button> <span></span>
</button>
)}
<button <button
className="flex items-center gap-2 px-3 py-1.5 text-sm text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-hover)] rounded-lg transition-colors" className="flex items-center gap-2 px-3 py-1.5 text-sm text-[var(--color-text-secondary)] hover:bg-[var(--color-bg-hover)] rounded-lg transition-colors"