From 495b72c5c3125e8a2216c1ff1da080123c956fa3 Mon Sep 17 00:00:00 2001 From: kicer Date: Thu, 3 Sep 2026 22:24:01 +0800 Subject: [PATCH] =?UTF-8?q?ui(drawer):=20=E5=88=A0=E9=99=A4=20modal=20?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E4=BC=9A=E8=AF=9D=E6=A0=87=E9=A2=98;?= =?UTF-8?q?=E4=BE=A7=E8=BE=B9=E6=A0=8F=E8=A1=8C=E5=A2=9E=E5=8A=A0=E9=BC=A0?= =?UTF-8?q?=E6=A0=87=E6=82=AC=E5=81=9C=E9=AB=98=E4=BA=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/server/public/css/style.css | 7 +++++-- app/server/public/index.html | 14 +++++++++++--- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/app/server/public/css/style.css b/app/server/public/css/style.css index fde6ab0..3e66737 100644 --- a/app/server/public/css/style.css +++ b/app/server/public/css/style.css @@ -475,10 +475,13 @@ footer { flex: none; padding: 8px 12px calc(10px + env(safe-area-inset-bottom, 0 z-index: 2; } @media (hover: hover) and (pointer: fine) { - .conv-wrap:hover .conv-del { display: flex; } - .conv-del:hover { color: #c0392b; background: #fdf3f2; border-color: #eac2bd; } + .conv-wrap:hover .conv-item:not(.active) { background: #f5f6f8; } + .conv-wrap:hover .conv-del { display: flex; } + .conv-del:hover { color: #c0392b; background: #fdf3f2; border-color: #eac2bd; } } .drawer-empty { padding: 24px 10px; font-size: 13px; color: var(--gray-light); text-align: center; } +/* 删除会话 modal 副标题:会话 ID 等二级说明,字号小、灰色 */ +.confirm-sub { font-size: 12px; color: var(--gray); margin-top: 6px; } /* 底部用户区 */ .drawer-user { diff --git a/app/server/public/index.html b/app/server/public/index.html index 6214452..27c658b 100644 --- a/app/server/public/index.html +++ b/app/server/public/index.html @@ -711,8 +711,13 @@ // ---------- 会话打开 / 新建 / 状态栏(抽屉行 × 调 deleteSession; 默认含任务目录) ---------- async function deleteSession(id) { if (!id) return; - if (!await confirmModal('删除会话', '确定删除会话 ' + id + ' ?', '删除', true, - { checkbox: { label: '同时删除任务文件夹', default: true } })) return; + // 从已加载列表查出会话标题,让 modal 能显示「标题 + ID」方便核对 + const s = (state.sessions || []).find(x => x.id === id); + const title = s ? (s.title || s.id) : id; + const body = '确定删除会话 「' + esc(title) + '」 吗?删除后无法恢复。' + + '
会话 ID:' + esc(id) + '
'; + if (!await confirmModal('删除会话', body, '删除', true, + { checkbox: { label: '同时删除任务文件夹', default: true }, bodyHtml: true })) return; const delDir = state._confirmChecked ? 'true' : 'false'; try { await req('DELETE', '/api/sessions/' + id + '?delete_dir=' + delDir); @@ -1663,7 +1668,10 @@ return new Promise(resolve => { _dlgResolve = resolve; $('confirm-title').textContent = title || '请确认'; - $('confirm-text').textContent = text || ''; + // bodyHtml: 需要加粗/加附加说明时传 HTML 字符串;缺省仍走 textContent 防 XSS + const body = $('confirm-text'); + if (opts && opts.bodyHtml) body.innerHTML = text || ''; + else body.textContent = text || ''; const ok = $('confirm-ok-btn'); ok.textContent = okText || '确定'; ok.style.background = danger ? 'linear-gradient(135deg,#a3352a,#d2483c)' : '';