From d3e64c8a2f1483deee45c2811be173935f375308 Mon Sep 17 00:00:00 2001 From: kicer Date: Thu, 10 Sep 2026 09:00:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=A4=E4=BA=92=EF=BC=9A=E6=81=A2=E5=A4=8D?= =?UTF-8?q?=20up-card=20=E5=8F=B3=E4=B8=8A=E8=A7=92=20=C3=97=E2=80=94?= =?UTF-8?q?=E2=80=94=E7=82=B9=E6=8E=89=E5=8D=A1=E7=89=87=E5=8D=B3=E5=8F=91?= =?UTF-8?q?=E9=80=81=E6=97=B6=E4=B8=8D=E5=86=8D=E6=8B=BC=E8=AF=A5=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=91=8A=E7=9F=A5=E8=A1=8C=EF=BC=88=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=E6=96=87=E4=BB=B6=E4=B8=8D=E5=8A=A8=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ×在上传完成/失败后显示(上传中隐藏);点掉从 DOM 移除,send() 按现存 data-done 卡片实时收集,天然排除 - 恢复 .up-x 样式;.up-info 加右内边距避免文件名省略号被 × 压住 --- app/server/public/css/style.css | 13 +++++++++++-- app/server/public/index.html | 26 ++++++++++++++++++-------- 2 files changed, 29 insertions(+), 10 deletions(-) diff --git a/app/server/public/css/style.css b/app/server/public/css/style.css index a7af891..ebd4075 100644 --- a/app/server/public/css/style.css +++ b/app/server/public/css/style.css @@ -299,14 +299,23 @@ footer { flex: none; padding: 8px 12px calc(10px + env(safe-area-inset-bottom, 0 position: relative; flex: 0 0 auto; display: flex; align-items: center; gap: 8px; width: 158px; max-width: 56vw; - background: var(--surface); border: 1px solid #e3e6ee; border-radius: 10px; + background: var(--surface); border: 1px solid #e3e6ee; border-radius: 16px; padding: 10px 11px; overflow: hidden; } .up-ico { color: var(--gray); display: flex; flex: none; } .up-ico .ic { width: 18px; height: 18px; } -.up-info { flex: 1; min-width: 0; } +.up-info { flex: 1; min-width: 0; padding-right: 14px; } /* 给右上 × 让位,避免压住文件名省略号 */ .up-name { font-size: 12px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .up-meta { font-size: 10.5px; color: var(--gray); margin-top: 3px; } +/* 卡片右上 ×:上传完成/失败后可见,点掉=发送时不再告知该文件(不删任务目录里的文件) */ +.up-x { + position: absolute; right: 5px; top: 5px; z-index: 2; + width: 16px; height: 16px; border-radius: 50%; border: none; cursor: pointer; padding: 0; + background: rgba(0, 0, 0, .06); color: var(--gray); + display: flex; align-items: center; justify-content: center; +} +.up-x:hover { background: rgba(0, 0, 0, .12); color: var(--ink); } +.up-x .ic { width: 10px; height: 10px; stroke-width: 2.4; } .up-mask { position: absolute; inset: 0; z-index: 1; background: rgba(255, 255, 255, .78); diff --git a/app/server/public/index.html b/app/server/public/index.html index 1b1037b..f701e12 100644 --- a/app/server/public/index.html +++ b/app/server/public/index.html @@ -2477,14 +2477,22 @@ '
' + '
' + esc(file.name) + '
' + '
' + uploadTypeLabel(file.name) + ' · ' + fmtSize(file.size) + '
' + - '
' + - '
0%
'; - const mask = card.querySelector('.up-mask'); - const pctEl = card.querySelector('.up-pct'); - // 无单卡删除入口:发送消息或切换会话时整体清空(clearUploadCards) - // 倒序:最后上传的排最前;新卡入位后横向滚回左端保证可见 - row.prepend(card); - row.scrollTo({ left: 0, behavior: 'smooth' }); + '' + + '' + + '
0%
'; + const mask = card.querySelector('.up-mask'); + const pctEl = card.querySelector('.up-pct'); + const closeBtn = card.querySelector('.up-x'); + // ×掉卡片 = 从 DOM 移除;send() 按现存 data-done 卡片实时拼告知行,自然不再包含该文件(文件本身仍在任务目录) + closeBtn.addEventListener('click', () => { + card.remove(); + if (!row.children.length) row.classList.add('hidden'); + }); + // 倒序:最后上传的排最前;新卡入位后横向滚回左端保证可见 + row.prepend(card); + row.scrollTo({ left: 0, behavior: 'smooth' }); return { setPct(p) { const v = Math.max(0, Math.min(100, Math.round(p))); @@ -2495,10 +2503,12 @@ mask.remove(); card.classList.add('done'); card.dataset.done = '1'; // 仅成功上传的卡片参与发送时的告知行 + closeBtn.classList.remove('hidden'); }, fail() { card.classList.add('err'); mask.innerHTML = '上传失败'; + closeBtn.classList.remove('hidden'); }, }; }