From 6088ea4629ee3560f96e6116f74a5235664d8963 Mon Sep 17 00:00:00 2001 From: thzxx Date: Fri, 3 Apr 2026 11:46:29 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=87=8D=E6=96=B0=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E9=80=89=E6=8B=A9=E6=A0=8F=E4=B8=8E=20Think?= =?UTF-8?q?=20=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 模型选择栏: - 去掉原生 select 样式,自定义 appearance:none + 箭头图标 - 模型列表显示参数大小 (如 qwen2.5 · 7B) - 选中模型后展示能力标签 (🧠 Think / 👁️ Vision) Think 模式: - 从模型栏移至输入区域,紧邻发送按钮 - 使用灯泡图标按钮替代原来的 toggle 开关 - 默认 disabled,切换模型时调用 /api/show 检测 capabilities - capabilities 包含 'thinking' 时才启用,否则禁用并灰显 - 模型能力结果缓存,避免重复请求 --- css/style.css | 96 +++++++++++++++++++++++++++-- index.html | 26 +++++--- js/components/model-bar.js | 123 ++++++++++++++++++++++++++++++++----- 3 files changed, 217 insertions(+), 28 deletions(-) diff --git a/css/style.css b/css/style.css index d1b8404..32c961a 100644 --- a/css/style.css +++ b/css/style.css @@ -248,24 +248,34 @@ body::before { .model-bar { display: flex; align-items: center; - gap: 8px; - padding: 6px 16px; + gap: 10px; + padding: 8px 16px; background: var(--bg-secondary); border-bottom: 1px solid var(--border-glass); flex-shrink: 0; } -.model-select { +.model-select-wrap { + position: relative; flex: 1; - padding: 6px 12px; + display: flex; + align-items: center; +} + +.model-select { + width: 100%; + padding: 7px 32px 7px 12px; background: var(--bg-glass-light); border: 1px solid var(--border-glass); border-radius: var(--radius-sm); color: var(--text-primary); font-size: 13px; + font-family: var(--font-sans); outline: none; cursor: pointer; transition: var(--transition); + appearance: none; + -webkit-appearance: none; } .model-select:focus { @@ -276,6 +286,84 @@ body::before { .model-select option { background: var(--bg-secondary); color: var(--text-primary); + padding: 6px; +} + +.model-select-arrow { + position: absolute; + right: 8px; + top: 50%; + transform: translateY(-50%); + pointer-events: none; + color: var(--text-muted); + display: flex; +} + +.model-select-arrow svg { + width: 14px; + height: 14px; +} + +.model-info-badge { + font-size: 11px; + color: var(--text-muted); + white-space: nowrap; + padding: 2px 8px; + background: var(--bg-glass-light); + border-radius: 10px; + border: 1px solid var(--border-glass); + display: none; +} + +/* ── Think 按钮(输入栏内) ── */ +.think-toggle { + display: flex; + align-items: center; + cursor: pointer; + flex-shrink: 0; + user-select: none; +} + +.think-toggle input { display: none; } + +.think-btn { + width: 38px; + height: 38px; + border-radius: var(--radius-md); + background: var(--bg-glass-light); + border: 1px solid var(--border-glass); + display: flex; + align-items: center; + justify-content: center; + transition: var(--transition); + color: var(--text-muted); +} + +.think-btn svg { + width: 18px; + height: 18px; +} + +.think-toggle:not(.unavailable):hover .think-btn { + border-color: var(--accent-purple); + color: var(--accent-purple); + background: rgba(123, 47, 247, 0.08); +} + +.think-toggle input:checked + .think-btn { + background: rgba(123, 47, 247, 0.15); + border-color: var(--accent-purple); + color: var(--accent-purple); + box-shadow: 0 0 10px rgba(123, 47, 247, 0.25); +} + +.think-toggle.unavailable .think-btn { + opacity: 0.3; + cursor: not-allowed; +} + +.think-toggle.unavailable .think-btn svg { + stroke: var(--text-muted); } /* ── 开关控件 ── */ diff --git a/index.html b/index.html index ab7e297..bd1cf2d 100644 --- a/index.html +++ b/index.html @@ -47,14 +47,15 @@
- - +
+ + + + +
+
@@ -94,6 +95,15 @@ +