fix(knowledge): 阅读页正文列放宽,宽屏上不再留白比字多
CI / backend (push) Canceled after 0s

1440 的屏幕上 40rem 正文只有 640px,两边各空出半屏,用户直接发截图说"留白比内容都多"。
正文列 56rem(约 55 个汉字一行)、卡片 78rem,行宽到头但不用来回扫行。
e2e 的宽度断言跟着改成 720–920px,避免以后再窄回去没人拦。
This commit is contained in:
Steven
2026-11-03 12:23:53 +08:00
parent 35fdea7260
commit da31083df2
4 changed files with 12 additions and 8 deletions
+3 -3
View File
@@ -4,7 +4,7 @@
* 断言的是用户提的那件事,而不是"有个 drawer":
* ① 点卡片后 URL 变成 /w/<ws>/knowledge/<id>,列表页的元素不在了
* ② 正文渲染成样式(h2 存在),不是编辑器
* ③ 正文列的宽度 ≤ 46rem 且在内容区里居中(左右留白差不多)
* ③ 正文列限宽但别太窄(720–920px,约 50 来个汉字一行),且在内容区里居中
* ④ 点「编辑」才出现编辑器(抽屉),保存/取消都收回去
*/
import { chromium } from "playwright-core";
@@ -119,8 +119,8 @@ try {
const rightGap = main.x + main.width - (box.x + box.width);
const width = box.width;
check(
"正文列限宽到可读宽度(≤46rem≈736px)",
width <= 760,
"正文列宽度适合长文(720–920px,宽屏不留大片空白)",
width >= 720 && width <= 920,
`width=${Math.round(width)}`,
);
check(