diff --git a/PROGRESS.md b/PROGRESS.md index ba5b06c..b88800c 100644 --- a/PROGRESS.md +++ b/PROGRESS.md @@ -21,6 +21,12 @@ ## 已完成关键能力 +### 2026-06-26 / 消息框支持拖拽文件 + 修多次粘贴互相顶掉(bump 0.31.3) + +- 现象:① 消息框只能粘贴文件不能拖拽;② 连粘多个文件,后一个把前一个的 chip 顶掉,只剩一个。 +- 根因:粘贴附件 chip 和状态文字共用 `#chat-hint`,每次粘贴用 `innerHTML =` 整体重建只塞最新一批,且上传进度回调写 `hint.textContent` 也会清掉已有 chip——附件与状态文字抢同一个容器。 +- 修复(`web/static/dev.html` + `web/static/js/chat.js`):① 新增独立 chip 托盘 `#chat-attach`(textarea 与按钮行之间),chip 累积靠 append + 按 `rel` 去重,状态进度只写 `#chat-hint`,从根上解耦;② 给整个 `#chat-form` 加 `dragenter/over/leave/drop`(enter/leave 计数防闪烁,`_dragHasFiles` 只认文件拖拽,微信镜像只读时不接收),复用 `uploadFiles` + 同一托盘;`takePastedRels` / 删除 / 预览三处改查托盘。 + ### 2026-06-26 / 消息目录圆点错位再修(点击竞态 + 触底兜底)(bump 0.31.2) - 现象(0.20.4 后仍残留):① 点圆点,被点的圆点不变红、活跃态跑到途经轮次(尤其点 #1 跳到 #2);② 点最后一个 / 滚到底,倒数第二个变红。 diff --git a/core/__init__.py b/core/__init__.py index 98d588a..7916856 100644 --- a/core/__init__.py +++ b/core/__init__.py @@ -1,3 +1,3 @@ # zcbot 版本号单一事实源:web/app.py 的 FastAPI version、/healthz 返回、前端展示都引这里。 # 改版本只动这一行。 -__version__ = "0.31.2" +__version__ = "0.31.3" diff --git a/web/static/dev.html b/web/static/dev.html index 77a60bf..306713d 100644 --- a/web/static/dev.html +++ b/web/static/dev.html @@ -855,6 +855,12 @@ /* 微信渠道 task 只读镜像:输入框置灰禁手输,引导去微信对话 */ #chat-input.readonly-locked { background: #f0f0f0; color: var(--muted); cursor: not-allowed; } #chat-form .hint { font-size: 11px; color: var(--muted); } + /* 附件托盘:粘贴 / 拖拽的文件 chip 独占一行,累积展示,不与状态文字抢容器 */ + #chat-attach { display: none; flex-wrap: wrap; gap: 4px 0; align-items: center; } + #chat-attach.show { display: flex; } + /* 拖拽文件悬停整个输入区:虚线高亮提示可落点 */ + #chat-form.drag-over { outline: 2px dashed var(--accent); outline-offset: -4px; background: var(--accent-soft); } + #chat-form.drag-over * { pointer-events: none; } /* ───── files ───── */ .crumbs { padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 12px; background: #fafafa; } @@ -1505,7 +1511,8 @@