fix(hub): simplify AI coach header actions
Hide model name labels and style New Chat as a primary button matching Generate Summary. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -2939,7 +2939,6 @@
|
||||
showToast("已添加一行,请填写 URL 后点「保存设置」");
|
||||
};
|
||||
|
||||
let aiMeta = null;
|
||||
let aiSummaryLoading = false;
|
||||
let aiChatLoading = false;
|
||||
let aiChatSessionCache = null;
|
||||
@@ -3129,17 +3128,6 @@
|
||||
if (input) input.disabled = busy;
|
||||
}
|
||||
|
||||
async function loadAiMeta() {
|
||||
const r = await apiFetch("/api/ai/meta");
|
||||
aiMeta = await r.json();
|
||||
const sm = document.getElementById("ai-summary-meta");
|
||||
const cm = document.getElementById("ai-chat-meta");
|
||||
const label = aiMeta && aiMeta.model ? aiMeta.model : "";
|
||||
if (sm) sm.textContent = label;
|
||||
if (cm) cm.textContent = label;
|
||||
return aiMeta;
|
||||
}
|
||||
|
||||
async function loadAiSummary() {
|
||||
const body = document.getElementById("ai-summary-body");
|
||||
try {
|
||||
@@ -3149,10 +3137,6 @@
|
||||
if (latest && latest.content_md) {
|
||||
if (body) setAiSummaryMarkdown(body, latest.content_md, latest.stats_snapshot);
|
||||
renderAiSummaryStats(latest.stats_snapshot);
|
||||
const sm = document.getElementById("ai-summary-meta");
|
||||
if (sm && latest.generated_at) {
|
||||
sm.textContent = `${j.model || ""} · ${latest.generated_at}`;
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
if (body) setAiSummaryPlaceholder(body, `<p class="ai-placeholder">${esc(String(e))}</p>`);
|
||||
@@ -3167,7 +3151,6 @@
|
||||
}
|
||||
|
||||
async function loadAiPage() {
|
||||
await loadAiMeta();
|
||||
await Promise.all([loadAiSummary(), loadAiChatSession()]);
|
||||
}
|
||||
|
||||
|
||||
@@ -214,7 +214,6 @@
|
||||
<div class="ai-panel-head">
|
||||
<h2>今日总结</h2>
|
||||
<div class="ai-panel-actions">
|
||||
<span id="ai-summary-meta" class="toolbar-meta ai-meta-line"></span>
|
||||
<button type="button" id="btn-ai-summary" class="primary">生成今日总结</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -227,8 +226,7 @@
|
||||
<div class="ai-panel-head">
|
||||
<h2 id="ai-chat-title">聊天</h2>
|
||||
<div class="ai-panel-actions">
|
||||
<span id="ai-chat-meta" class="toolbar-meta ai-meta-line"></span>
|
||||
<button type="button" id="btn-ai-chat-new" class="ghost">新开对话</button>
|
||||
<button type="button" id="btn-ai-chat-new" class="primary">新开对话</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="ai-chat-messages" class="ai-panel-scroll ai-chat-messages" aria-live="polite"></div>
|
||||
@@ -288,6 +286,6 @@
|
||||
<script src="https://unpkg.com/lightweight-charts@4.2.0/dist/lightweight-charts.standalone.production.js"></script>
|
||||
<script src="/assets/chart.js?v=20260604-upnl-contracts"></script>
|
||||
<script src="/assets/ai_review_render.js?v=2"></script>
|
||||
<script src="/assets/app.js?v=20260606-hub-ai-sec"></script>
|
||||
<script src="/assets/app.js?v=20260606-hub-ai-ui"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user