Scale docx pages to the preview column #44

Merged
weichen merged 3 commits from feature/docx-paper-preview into main 2026-10-05 04:06:12 +00:00
Owner

Summary

Test plan

  • npm test (81 passed) and npx tsc -b
  • Browser harness: dark 420px page is white, black ink, document blue title and red sentence kept, scale about 0.50; molv chrome changes while the page stays white; 998px column uses transform: none
## Summary - Paint docx pages with `--paper` / `--paper-ink` instead of the theme background, and keep the document's own colors. - Shrink each page to the preview column (`computeFitScale`, never above 100%). A wide or fullscreen column stays at 100%. - Depends on the UI loader dispose hook: https://git-home.u1680832.nyat.app:30319/weichen/Agent-System-UI/pulls/35 ## Test plan - [x] `npm test` (81 passed) and `npx tsc -b` - [x] Browser harness: dark 420px page is white, black ink, document blue title and red sentence kept, scale about 0.50; molv chrome changes while the page stays white; 998px column uses `transform: none`
weichen added 3 commits 2026-10-05 04:04:34 +00:00
Why: An A4 page is wider than the preview column, and the page background followed the app theme, so body text disappeared in dark mode.
Evidence: npm test (17 files, 81 tests) and npx tsc -b passed in modules/frontend.
Impact: Docx pages stay on --paper with their own styles and shrink to fit the column. A column wider than the page, including fullscreen, keeps them at 100%. Before: section background var(--bg) and color var(--text). After: var(--paper) and var(--paper-ink).
Refs: feature/docx-paper-preview
Co-authored-by: Cursor <cursoragent@cursor.com>
Why: tsc -b writes tsconfig.tsbuildinfo into the worktree, which showed up as a dirty submodule during the paper-preview check.
Evidence: git status listed tsconfig.tsbuildinfo as untracked after npx tsc -b.
Impact: The artifact stays local. No runtime or preview behavior changes.
Refs: feature/docx-paper-preview
Co-authored-by: Cursor <cursoragent@cursor.com>
Why: tsconfig.tsbuildinfo is a local tsc cache, and a fresh typecheck rewrites it, which leaves the frontend submodule dirty.
Evidence: git ls-files still listed it after the ignore rule, and git status showed it modified after npx tsc -b.
Impact: The file remains on disk and is now ignored. No source or preview behavior changes.
Refs: feature/docx-paper-preview
Co-authored-by: Cursor <cursoragent@cursor.com>
weichen merged commit 817c43e764 into main 2026-10-05 04:06:12 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: weichen/Agent-System-Frontend#44