From 38bf13c93daafd3407082c4d9e9cc607c76dca1e Mon Sep 17 00:00:00 2001 From: weichen Date: Mon, 5 Oct 2026 03:54:31 +0000 Subject: [PATCH 1/9] Record the task card for feature-docx-paper-preview --- .task/feature-docx-paper-preview.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .task/feature-docx-paper-preview.md diff --git a/.task/feature-docx-paper-preview.md b/.task/feature-docx-paper-preview.md new file mode 100644 index 00000000..f2d7d031 --- /dev/null +++ b/.task/feature-docx-paper-preview.md @@ -0,0 +1,25 @@ +# feature/docx-paper-preview 任务卡 + +任务主记录:;状态:进行中;owner:weichen + +## 基线与授权 + +- 权威仓:ssh://git@git-ssh.u1680832.nyat.app:31411/weichen/Agent-System-Dev.git;目标分支:main;R0(initial_base_sha)= eaae87e635ce31570159637cfe400f099b4daf5b +- 工作区:/home/weichen/projects/Agent-System-Dev-wt-feature-docx-paper-preview(worktree);分支:feature/docx-paper-preview +- 授权与交付终点:<本次允许的动作与终点;未授权事项写明> + +## 目标与非目标 + +<预期结果、受影响入口/模块/契约;明确不做什么。> + +## 同步记录 + +| 节点 | sync_base_sha | tested_head_sha | checked_at | +|---|---|---|---| +| 启动 | eaae87e635ce31570159637cfe400f099b4daf5b | eaae87e635ce31570159637cfe400f099b4daf5b | 2026-10-05T03:54:31Z | + +## 结果与验证(完成后填写) + +- 结果: +- 验证: +- 影响与剩余项: From b4390ef31335551a42d2441f61429a69744abf47 Mon Sep 17 00:00:00 2001 From: weichen Date: Mon, 5 Oct 2026 03:59:17 +0000 Subject: [PATCH 2/9] Preview docx on fixed paper instead of the theme background Why: The preview painted docx pages with the theme background, so black document text was unreadable in dark mode and the page overflowed the narrow column. Evidence: UI vitest 84 passed and tsc clean at b14c9c0; frontend vitest 81 passed and tsc -b clean at cf6f24e. Impact: DESIGN.md documents --paper and --paper-ink. Gitlinks pick up the UI and frontend paper-preview commits. Mammoth and fake-docx text fallbacks stay theme-styled. Refs: feature/docx-paper-preview Co-authored-by: Cursor --- .task/feature-docx-paper-preview.md | 14 ++++++++------ DESIGN.md | 11 +++++++++++ modules/frontend | 2 +- modules/ui | 2 +- 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/.task/feature-docx-paper-preview.md b/.task/feature-docx-paper-preview.md index f2d7d031..0868e38c 100644 --- a/.task/feature-docx-paper-preview.md +++ b/.task/feature-docx-paper-preview.md @@ -1,16 +1,18 @@ # feature/docx-paper-preview 任务卡 -任务主记录:;状态:进行中;owner:weichen +任务主记录:;状态:进行中;owner:weichen ## 基线与授权 - 权威仓:ssh://git@git-ssh.u1680832.nyat.app:31411/weichen/Agent-System-Dev.git;目标分支:main;R0(initial_base_sha)= eaae87e635ce31570159637cfe400f099b4daf5b - 工作区:/home/weichen/projects/Agent-System-Dev-wt-feature-docx-paper-preview(worktree);分支:feature/docx-paper-preview -- 授权与交付终点:<本次允许的动作与终点;未授权事项写明> +- 授权与交付终点:实现 docx 纸面原貌预览(令牌、样式、栏宽缩放、测试、浏览器核对、子仓与 Dev PR)。合入 main 与 task-finish 等所有者合入后执行。不改写历史、不改分支保护、不发布版本。 ## 目标与非目标 -<预期结果、受影响入口/模块/契约;明确不做什么。> +- 目标:docx 预览固定白纸黑字,保留文档自带样式,窄预览栏整页等比缩小,全屏栏宽足够时保持 100%。 +- 受影响:`DESIGN.md`;UI 仓 tokens/ui.css/FilePreview;Frontend 仓 styles.css、previewsetup、previewfit。 +- 非目标:mammoth 与伪 docx 文本回退仍走主题化 `.doc-viewer`;不改 `renderAsync` 的分页选项;不改 xlsx/pptx 的解析路径。 ## 同步记录 @@ -20,6 +22,6 @@ ## 结果与验证(完成后填写) -- 结果: -- 验证: -- 影响与剩余项: +- 结果:UI `b14c9c0` 增加 `--paper` / `--paper-ink` 并允许预览加载器返回清理函数;Frontend `cf6f24e` 把 docx 页画到纸面令牌上并按栏宽缩放。 +- 验证:UI `npx vitest run` 84 通过、`npx tsc --noEmit` 通过;Frontend `npm test` 81 通过、`npx tsc -b` 通过。浏览器三主题与 `make test` 待补。 +- 影响与剩余项:深色主题下 docx 正文恢复可读。合入前需 task-sync、组合测试与浏览器核对。 diff --git a/DESIGN.md b/DESIGN.md index 75655853..19637ce9 100644 --- a/DESIGN.md +++ b/DESIGN.md @@ -75,6 +75,17 @@ Agent-System-Dev 是桌面优先、Web 兼容的 AI 工作台。界面应**冷 | `--accent` | `#165f49` | 交互强调(翠绿) | | `--primary` / `--primary-foreground` | `#082d4f` / `#f3f8f5` | 主按钮 | +### 2.6 文档纸面(主题不变量) + +Office 分页预览是**内容**,不是界面。纸面与默认墨色固定,三套主题同值: + +| 令牌 | 值 | 用途 | +|---|---|---| +| `--paper` | `#ffffff` | docx 页、幻灯片等文档纸面 | +| `--paper-ink` | `#000000` | 纸面上没有自带颜色的文字的默认墨色 | + +规则:保留文档自己的字号、颜色、表格和图片样式。禁止用 `--bg` / `--text` 等主题令牌覆盖这些内联样式。界面只负责纸面周围的底座(`--bg-inset`)和按栏宽等比缩放。 + ## 3. 字号标尺(唯一字号体系) 全局唯一可调变量 `--ui-font-size`(默认 14px),派生: diff --git a/modules/frontend b/modules/frontend index eb6502f0..cf6f24e5 160000 --- a/modules/frontend +++ b/modules/frontend @@ -1 +1 @@ -Subproject commit eb6502f0effd0d02d8a131930fbe60e61d651657 +Subproject commit cf6f24e58317922cbbd9c60be4a019929f7adb15 diff --git a/modules/ui b/modules/ui index 6b2589c1..b14c9c0e 160000 --- a/modules/ui +++ b/modules/ui @@ -1 +1 @@ -Subproject commit 6b2589c19873719c1c203ef7feb542b20a56799a +Subproject commit b14c9c0e0d744af1b8997b03bcd91701a67822bf From f36bac04c801a1f2dd8b8604b4d12c34dfe27f34 Mon Sep 17 00:00:00 2001 From: weichen Date: Mon, 5 Oct 2026 03:59:50 +0000 Subject: [PATCH 3/9] Point the frontend gitlink at the paper-preview tip Why: The frontend branch gained two follow-up commits that stop a typecheck artifact from dirtying the submodule. Evidence: modules/frontend HEAD is 9badbb1 and git status in that repo is clean. Impact: The Dev branch records the frontend tip that includes page scaling and the tsbuildinfo ignore. No other gitlinks move. Refs: feature/docx-paper-preview Co-authored-by: Cursor --- modules/frontend | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/frontend b/modules/frontend index cf6f24e5..9badbb1f 160000 --- a/modules/frontend +++ b/modules/frontend @@ -1 +1 @@ -Subproject commit cf6f24e58317922cbbd9c60be4a019929f7adb15 +Subproject commit 9badbb1f85f4af4464561ba5fb311297847e972e From 06d2dd9d32576b6fb91b7582b508c47414a27ef1 Mon Sep 17 00:00:00 2001 From: weichen Date: Mon, 5 Oct 2026 04:00:00 +0000 Subject: [PATCH 4/9] Record the frontend tip on the task card Why: The card still named the frontend commit from before the tsbuildinfo follow-ups. Evidence: modules/frontend HEAD is 9badbb1. Impact: Task record only. No code or gitlink change. Refs: feature/docx-paper-preview Co-authored-by: Cursor --- .task/feature-docx-paper-preview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.task/feature-docx-paper-preview.md b/.task/feature-docx-paper-preview.md index 0868e38c..e33477fe 100644 --- a/.task/feature-docx-paper-preview.md +++ b/.task/feature-docx-paper-preview.md @@ -22,6 +22,6 @@ ## 结果与验证(完成后填写) -- 结果:UI `b14c9c0` 增加 `--paper` / `--paper-ink` 并允许预览加载器返回清理函数;Frontend `cf6f24e` 把 docx 页画到纸面令牌上并按栏宽缩放。 +- 结果:UI `b14c9c0` 增加 `--paper` / `--paper-ink` 并允许预览加载器返回清理函数;Frontend `9badbb1` 把 docx 页画到纸面令牌上并按栏宽缩放。 - 验证:UI `npx vitest run` 84 通过、`npx tsc --noEmit` 通过;Frontend `npm test` 81 通过、`npx tsc -b` 通过。浏览器三主题与 `make test` 待补。 - 影响与剩余项:深色主题下 docx 正文恢复可读。合入前需 task-sync、组合测试与浏览器核对。 From 10eaaeb8dc4f0e869847d3874a90793be3dfedf9 Mon Sep 17 00:00:00 2001 From: weichen Date: Mon, 5 Oct 2026 04:03:55 +0000 Subject: [PATCH 5/9] Record paper-preview verification on the task card Why: The card still said browser checks and the combined test were pending after both had passed. Evidence: make test exited 0 in this worktree. The harness measured white paper, black ink, preserved document colors, scale 0.496 at 420px, and transform none at 998px. Impact: Task record only. No code or gitlink change. Refs: feature/docx-paper-preview Co-authored-by: Cursor --- .task/feature-docx-paper-preview.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.task/feature-docx-paper-preview.md b/.task/feature-docx-paper-preview.md index e33477fe..c80010ba 100644 --- a/.task/feature-docx-paper-preview.md +++ b/.task/feature-docx-paper-preview.md @@ -23,5 +23,5 @@ ## 结果与验证(完成后填写) - 结果:UI `b14c9c0` 增加 `--paper` / `--paper-ink` 并允许预览加载器返回清理函数;Frontend `9badbb1` 把 docx 页画到纸面令牌上并按栏宽缩放。 -- 验证:UI `npx vitest run` 84 通过、`npx tsc --noEmit` 通过;Frontend `npm test` 81 通过、`npx tsc -b` 通过。浏览器三主题与 `make test` 待补。 -- 影响与剩余项:深色主题下 docx 正文恢复可读。合入前需 task-sync、组合测试与浏览器核对。 +- 验证:UI `npx vitest run` 84 通过、`npx tsc --noEmit` 通过;Frontend `npm test` 81 通过、`npx tsc -b` 通过。`make test` 于 2026-10-05 在本 worktree 通过(boundaries、pins、libs、core、backend、frontend 81、ui 84、agent-command)。浏览器核对页:深色窄栏 420px 纸面 `rgb(255,255,255)`、默认墨色 `rgb(0,0,0)`、标题保留文档蓝 `rgb(31,78,121)`、红句保留 `rgb(192,0,0)`,缩放 `matrix(0.496222)`(页宽 794);浅色主题纸面与墨色不变;墨绿主题底座 `rgb(224,224,219)`、纸面仍白;栏宽 998px 时 `transform=none`(100%)。 +- 影响与剩余项:深色主题下 docx 正文恢复可读。mammoth 与伪 docx 文本回退仍走主题化排版。合入权在所有者,合入后才能 task-finish。 From be844bedd2ac1f66d1cf14777f3fb209cdc36659 Mon Sep 17 00:00:00 2001 From: weichen Date: Mon, 5 Oct 2026 04:03:56 +0000 Subject: [PATCH 6/9] Record the sync checkpoint --- .task/feature-docx-paper-preview.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.task/feature-docx-paper-preview.md b/.task/feature-docx-paper-preview.md index c80010ba..9e233df0 100644 --- a/.task/feature-docx-paper-preview.md +++ b/.task/feature-docx-paper-preview.md @@ -25,3 +25,4 @@ - 结果:UI `b14c9c0` 增加 `--paper` / `--paper-ink` 并允许预览加载器返回清理函数;Frontend `9badbb1` 把 docx 页画到纸面令牌上并按栏宽缩放。 - 验证:UI `npx vitest run` 84 通过、`npx tsc --noEmit` 通过;Frontend `npm test` 81 通过、`npx tsc -b` 通过。`make test` 于 2026-10-05 在本 worktree 通过(boundaries、pins、libs、core、backend、frontend 81、ui 84、agent-command)。浏览器核对页:深色窄栏 420px 纸面 `rgb(255,255,255)`、默认墨色 `rgb(0,0,0)`、标题保留文档蓝 `rgb(31,78,121)`、红句保留 `rgb(192,0,0)`,缩放 `matrix(0.496222)`(页宽 794);浅色主题纸面与墨色不变;墨绿主题底座 `rgb(224,224,219)`、纸面仍白;栏宽 998px 时 `transform=none`(100%)。 - 影响与剩余项:深色主题下 docx 正文恢复可读。mammoth 与伪 docx 文本回退仍走主题化排版。合入权在所有者,合入后才能 task-finish。 +| 同步前验收 | eaae87e635ce31570159637cfe400f099b4daf5b | 10eaaeb8dc4f0e869847d3874a90793be3dfedf9 | 2026-10-05T04:03:56Z | From f2c40412470af9752b5d56724f4e7b631f92fab2 Mon Sep 17 00:00:00 2001 From: weichen Date: Mon, 5 Oct 2026 04:04:47 +0000 Subject: [PATCH 7/9] Record the paper-preview pull requests on the task card Why: The task card is the main record and still had a placeholder where the pull request link belongs. Evidence: Dev pull request 196, UI pull request 35, frontend pull request 44. Impact: Task record only. No code or gitlink change. Refs: feature/docx-paper-preview Co-authored-by: Cursor --- .task/feature-docx-paper-preview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.task/feature-docx-paper-preview.md b/.task/feature-docx-paper-preview.md index 9e233df0..10876649 100644 --- a/.task/feature-docx-paper-preview.md +++ b/.task/feature-docx-paper-preview.md @@ -1,6 +1,6 @@ # feature/docx-paper-preview 任务卡 -任务主记录:;状态:进行中;owner:weichen +任务主记录:https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Dev/pulls/196 ;状态:进行中;owner:weichen ## 基线与授权 From e6852872fe8587b4402eefb5ac509e29415d1abc Mon Sep 17 00:00:00 2001 From: weichen Date: Mon, 5 Oct 2026 04:04:56 +0000 Subject: [PATCH 8/9] Link the submodule pull requests from the task card Why: The card named the UI and frontend commits but not the pull requests that carry them. Evidence: UI pull request 35 and frontend pull request 44 are open. Impact: Task record only. No code or gitlink change. Refs: feature/docx-paper-preview Co-authored-by: Cursor --- .task/feature-docx-paper-preview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.task/feature-docx-paper-preview.md b/.task/feature-docx-paper-preview.md index 10876649..57a35ab1 100644 --- a/.task/feature-docx-paper-preview.md +++ b/.task/feature-docx-paper-preview.md @@ -22,7 +22,7 @@ ## 结果与验证(完成后填写) -- 结果:UI `b14c9c0` 增加 `--paper` / `--paper-ink` 并允许预览加载器返回清理函数;Frontend `9badbb1` 把 docx 页画到纸面令牌上并按栏宽缩放。 +- 结果:UI `b14c9c0`(https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-UI/pulls/35)增加 `--paper` / `--paper-ink` 并允许预览加载器返回清理函数;Frontend `9badbb1`(https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Frontend/pulls/44)把 docx 页画到纸面令牌上并按栏宽缩放。 - 验证:UI `npx vitest run` 84 通过、`npx tsc --noEmit` 通过;Frontend `npm test` 81 通过、`npx tsc -b` 通过。`make test` 于 2026-10-05 在本 worktree 通过(boundaries、pins、libs、core、backend、frontend 81、ui 84、agent-command)。浏览器核对页:深色窄栏 420px 纸面 `rgb(255,255,255)`、默认墨色 `rgb(0,0,0)`、标题保留文档蓝 `rgb(31,78,121)`、红句保留 `rgb(192,0,0)`,缩放 `matrix(0.496222)`(页宽 794);浅色主题纸面与墨色不变;墨绿主题底座 `rgb(224,224,219)`、纸面仍白;栏宽 998px 时 `transform=none`(100%)。 - 影响与剩余项:深色主题下 docx 正文恢复可读。mammoth 与伪 docx 文本回退仍走主题化排版。合入权在所有者,合入后才能 task-finish。 | 同步前验收 | eaae87e635ce31570159637cfe400f099b4daf5b | 10eaaeb8dc4f0e869847d3874a90793be3dfedf9 | 2026-10-05T04:03:56Z | From 2723c73baef8748232d77c3c8ab9d49164a9374d Mon Sep 17 00:00:00 2001 From: weichen Date: Mon, 5 Oct 2026 04:05:14 +0000 Subject: [PATCH 9/9] Put the sync checkpoint back in the task table Why: task-sync appends the checkpoint after the results section, so the row rendered as a loose line. Evidence: the checkpoint values are unchanged and now sit under the sync table header. Impact: Task record formatting only. Refs: feature/docx-paper-preview Co-authored-by: Cursor --- .task/feature-docx-paper-preview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.task/feature-docx-paper-preview.md b/.task/feature-docx-paper-preview.md index 57a35ab1..65699add 100644 --- a/.task/feature-docx-paper-preview.md +++ b/.task/feature-docx-paper-preview.md @@ -19,10 +19,10 @@ | 节点 | sync_base_sha | tested_head_sha | checked_at | |---|---|---|---| | 启动 | eaae87e635ce31570159637cfe400f099b4daf5b | eaae87e635ce31570159637cfe400f099b4daf5b | 2026-10-05T03:54:31Z | +| 同步前验收 | eaae87e635ce31570159637cfe400f099b4daf5b | 10eaaeb8dc4f0e869847d3874a90793be3dfedf9 | 2026-10-05T04:03:56Z | ## 结果与验证(完成后填写) - 结果:UI `b14c9c0`(https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-UI/pulls/35)增加 `--paper` / `--paper-ink` 并允许预览加载器返回清理函数;Frontend `9badbb1`(https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-Frontend/pulls/44)把 docx 页画到纸面令牌上并按栏宽缩放。 - 验证:UI `npx vitest run` 84 通过、`npx tsc --noEmit` 通过;Frontend `npm test` 81 通过、`npx tsc -b` 通过。`make test` 于 2026-10-05 在本 worktree 通过(boundaries、pins、libs、core、backend、frontend 81、ui 84、agent-command)。浏览器核对页:深色窄栏 420px 纸面 `rgb(255,255,255)`、默认墨色 `rgb(0,0,0)`、标题保留文档蓝 `rgb(31,78,121)`、红句保留 `rgb(192,0,0)`,缩放 `matrix(0.496222)`(页宽 794);浅色主题纸面与墨色不变;墨绿主题底座 `rgb(224,224,219)`、纸面仍白;栏宽 998px 时 `transform=none`(100%)。 - 影响与剩余项:深色主题下 docx 正文恢复可读。mammoth 与伪 docx 文本回退仍走主题化排版。合入权在所有者,合入后才能 task-finish。 -| 同步前验收 | eaae87e635ce31570159637cfe400f099b4daf5b | 10eaaeb8dc4f0e869847d3874a90793be3dfedf9 | 2026-10-05T04:03:56Z |