From e7a86fb00c9ce38bd6f81e8ecb8c66cefa3e1ad2 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Fri, 26 Jun 2026 12:26:44 +0800 Subject: [PATCH] =?UTF-8?q?fix(web):=20=E4=BF=AE=E5=A4=8D=E5=8D=A1?= =?UTF-8?q?=E7=89=87=E2=9A=99=E7=82=B9=E5=87=BB=E6=97=A0=E5=8F=8D=E5=BA=94?= =?UTF-8?q?(export=20openWechatModal)+=20=E5=8D=A1=E7=89=87=E5=9C=86?= =?UTF-8?q?=E8=A7=92=E8=B0=83=E5=B0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - openWechatModal 原是 wechat.js 私有函数,chat.js 访问不到 → 点击⚙无反应。 export 出来并在 chat.js import,事件绑定直接调用(去掉 typeof 兜底)。 - 卡片圆角 8px → 4px(用户嫌太圆);cc-icon/cc-action 圆角同步调小。 Co-Authored-By: Claude Opus 4.8 (1M context) --- web/static/dev.html | 6 +++--- web/static/js/chat.js | 10 ++++------ web/static/js/wechat.js | 2 +- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/web/static/dev.html b/web/static/dev.html index b1c4a30..031fa8c 100644 --- a/web/static/dev.html +++ b/web/static/dev.html @@ -564,11 +564,11 @@ #channel-cards { padding: 6px 12px 2px; display: flex; gap: 6px; } #channel-cards:empty { display: none; } .channel-card { flex: 1; min-width: 0; display: flex; align-items: center; gap: 7px; padding: 7px 9px; - border-radius: 8px; border: 1px solid rgba(7,193,96,.35); background: rgba(7,193,96,.06); cursor: pointer; } + border-radius: 4px; border: 1px solid rgba(7,193,96,.35); background: rgba(7,193,96,.06); cursor: pointer; } .channel-card:hover { background: rgba(7,193,96,.12); } .channel-card.active { border-color: #07C160; background: var(--accent-soft); } .channel-card.cc-placeholder { border-style: dashed; border-color: rgba(7,193,96,.5); } - .channel-card .cc-icon { width: 18px; height: 18px; border-radius: 5px; background: #07C160; color: #fff; + .channel-card .cc-icon { width: 18px; height: 18px; border-radius: 4px; background: #07C160; color: #fff; display: inline-flex; align-items: center; justify-content: center; flex: none; } .channel-card .cc-icon svg { width: 12px; height: 12px; fill: currentColor; display: block; } .channel-card .cc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; } @@ -577,7 +577,7 @@ .channel-card .cc-meta { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .channel-card .cc-action { width: 28px; height: 28px; flex: none; display: inline-flex; align-items: center; - justify-content: center; border-radius: 6px; color: var(--muted); font-size: 14px; cursor: pointer; } + justify-content: center; border-radius: 4px; color: var(--muted); font-size: 14px; cursor: pointer; } .channel-card .cc-action:hover { background: rgba(7,193,96,.12); color: #07C160; } .empty { padding: 24px; color: var(--muted); text-align: center; font-size: 13px; } diff --git a/web/static/js/chat.js b/web/static/js/chat.js index aac2f0e..d28c158 100644 --- a/web/static/js/chat.js +++ b/web/static/js/chat.js @@ -22,6 +22,7 @@ const CHANNEL_BADGE = { }; function channelCfg(ch) { return CHANNEL_BADGE[ch] || null; } import { logout } from "./auth.js"; +import { openWechatModal } from "./wechat.js"; import { openFilePreview, openPasteFilePreview, closePreviewIfShowing } from "./preview.js"; import { loadFiles, scheduleFilesRefresh, uploadFiles, formatUploadProgress } from "./files.js"; import { toolActivityLabel, _workingDirName, extractMediaBanner, extractArtifactRels, renderArtifactBarHtml, upgradeMediaArtifacts, ARTIFACT_PRODUCING_TOOLS, _flushMediaArtifactCache } from "./media.js"; @@ -249,15 +250,12 @@ export async function loadChannelCards() { box.querySelectorAll(".channel-card").forEach((el) => { const action = el.dataset.action; if (action === "bind" || action === "manage") { - el.onclick = () => { - if (typeof openWechatModal === "function") openWechatModal(); - }; + el.onclick = () => openWechatModal(); } else if (action === "select") { el.onclick = (e) => { - const actionBtn = e.target.closest(".cc-action"); - if (actionBtn) { + if (e.target.closest(".cc-action")) { e.stopPropagation(); // ⚙ 点开弹框,不触发 selectTask - if (typeof openWechatModal === "function") openWechatModal(); + openWechatModal(); } else { selectTask(el.dataset.tid); } diff --git a/web/static/js/wechat.js b/web/static/js/wechat.js index 1c9c2fd..6e81fe4 100644 --- a/web/static/js/wechat.js +++ b/web/static/js/wechat.js @@ -34,7 +34,7 @@ async function refresh() { } } -function openWechatModal() { +export function openWechatModal() { $("wechat-modal").classList.add("show"); $("wx-qrbox").hidden = true; refresh();