From 641a69455d398623e647fa6a3552edb95a7c84c7 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Wed, 12 Aug 2026 10:57:26 +0800 Subject: [PATCH] fix(preview): restore continuous document scrolling --- CHANGELOG.md | 4 ++++ PROGRESS.md | 6 +++++- core/__init__.py | 2 +- tests/frontend_preview.test.mjs | 2 ++ web/static/dev.html | 5 ++++- 5 files changed, 16 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c0f00f8..bd519fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ > 所以不是每个版本号都有条目。条目格式 `## <版本> — <日期>`,新条目加在最上面。 > 工程口径的完整记录见 `PROGRESS.md` / git log。 +## 0.63.11 — 2026-08-12 + +- 修复 PDF 和 PPT 连续预览无法正常滚动的问题,现在可直接上下滚动浏览全部页面。 + ## 0.63.10 — 2026-08-11 - 在文件预览中发送消息后,预览框现在会自动关闭,便于立即查看助手生成的回答。 diff --git a/PROGRESS.md b/PROGRESS.md index dda61ad..a0b00b0 100644 --- a/PROGRESS.md +++ b/PROGRESS.md @@ -2,7 +2,7 @@ > 配合 `DESIGN.md`。本文件只记 phase 状态、决策偏差、文件量、下一步。每条 1-2 句:做了啥 + 关键判断;细节查 `git log` / `git diff` / `DESIGN §7.9`。 -最后更新:2026-08-11(发送消息后自动关闭预览,bump 0.63.10) +最后更新:2026-08-12(PDF/PPT 连续预览滚动布局修复,bump 0.63.11) --- @@ -21,6 +21,10 @@ ## 已完成关键能力 +### 2026-08-12 + +- **08-12 / 0.63.11 / PDF/PPT 连续预览滚动布局修复**:补齐 PDF 预览根容器的纵向 Flex 布局与可收缩高度约束,使内部连续页 viewport 获得实际可用高度和独立滚动区域,不再被外层 `overflow:hidden` 裁断;回归测试同步锁定根容器、viewport 与页列表三层布局契约。Node 前端预览 11 项、JavaScript 语法及 diff 检查通过;无 schema、migration、HTTP API、依赖或运行方式变化,未连接生产 DB。 + ### 2026-08-11 - **08-11 / 0.63.10 / 发送消息后自动关闭文件预览**:消息通过发送前校验并进入发送流程时,统一关闭文件主预览与粘贴附件小预览,避免遮挡已开始生成的助手回答;空消息、附件上传中和只读渠道等未发送场景保持预览不动。Node 前端预览 11 项、JavaScript 语法及 diff 检查通过;无 schema、migration、HTTP API、依赖或运行方式变化,未连接生产 DB。 diff --git a/core/__init__.py b/core/__init__.py index 906d79b..15b442a 100644 --- a/core/__init__.py +++ b/core/__init__.py @@ -1,3 +1,3 @@ # zcbot 版本号单一事实源:web/app.py 的 FastAPI version、/healthz 返回、前端展示都引这里。 # 改版本只动这一行。 -__version__ = "0.63.10" +__version__ = "0.63.11" diff --git a/tests/frontend_preview.test.mjs b/tests/frontend_preview.test.mjs index 026eb1c..ba9897f 100644 --- a/tests/frontend_preview.test.mjs +++ b/tests/frontend_preview.test.mjs @@ -88,6 +88,8 @@ test("PDF previews render a continuously scrollable lazy page list", () => { assert.match(previewJs, /root: viewportHost/); assert.match(previewJs, /viewportHost\.addEventListener\("scroll"/); assert.doesNotMatch(previewJs, /class="small pdf-(?:prev|next)"/); + assert.match(pageHtml, /\.pdf-preview\s*\{[^}]*display:\s*flex[^}]*flex-direction:\s*column[^}]*min-height:\s*0/s); + assert.match(pageHtml, /\.pdf-viewport\s*\{[^}]*flex:\s*1[^}]*min-height:\s*0[^}]*overflow:\s*auto/s); assert.match(pageHtml, /\.pdf-pages-list\s*\{[^}]*flex-direction:\s*column/s); }); diff --git a/web/static/dev.html b/web/static/dev.html index 1094832..5aa6812 100644 --- a/web/static/dev.html +++ b/web/static/dev.html @@ -1373,7 +1373,10 @@ } #file-preview-modal .body iframe.preview-frame { width: 100%; height: 100%; border: 0; } iframe.preview-html-frame { background: #fff; } - .pdf-preview { padding: 0 !important; overflow: hidden !important; background: #eef1f5; } + .pdf-preview { + display: flex; flex-direction: column; min-height: 0; + padding: 0 !important; overflow: hidden !important; background: #eef1f5; + } .pdf-toolbar { min-height: 44px; padding: 6px 10px; display: flex; align-items: center; gap: 7px; background: var(--panel); border-bottom: 1px solid var(--border); flex: 0 0 auto;