test: header title assertions follow the shortened rectification title (BUG-1536)
Independent Staging Quality Gate / validate-frontend (push) Successful in 6m23s
Independent Staging Quality Gate / validate-python (push) Successful in 6m44s
Independent Staging Quality Gate / publish (push) Successful in 3m20s

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbBXoyn7Hj3LCW3BUs5bZ8
This commit is contained in:
2026-11-03 23:26:30 +08:00
co-authored by Claude Opus 5.5
parent c1b828fce2
commit 3ec682763d
3 changed files with 8 additions and 4 deletions
+1
View File
@@ -21138,6 +21138,7 @@
3. 侧栏:`.sidebar` 用 `overflow: hidden`,hidden 的盒子仍可被焦点移动或滚动到可见位置的调用横向滚动,整列(含 logo)会被推到左边界外。截图的样子与此一致,但具体是哪一步触发的没有复现,属推断。
- 修复:生时校正列表改用会话栏宽度 `min(760px + 2 × gutter, 100%)` 和 gutter 内边距;时间条内边距改为 `max(gutter, (100% − 760px) / 2)`,与正文同列,背景和底线仍铺满;输入框区域用同一 gutter、输入框 `min(760px, 100%)`;生时校正正文行高 1.75、段距 `space-4`。`.sidebar` 改为 `overflow: clip`(不可被滚动,其余表现不变)。产品追加(2026-11-03):顶栏标题「生时校正 · 04:45–05:15」与正下方时间条重复,顶栏只显示「生时校正」(`session-title.ts` `chatHeaderTitle`,只处理进行中的「HH:MM–HH:MM」形状;库里的标题和侧栏行不变,侧栏仍靠时间窗区分多次校正;已采用的「生时校正 · 04:58」照旧显示)。
- 验证:新增 `frontend/tests/rectification-reading-column-20261103.test.ts`(列表 / 时间条 / 输入框同一会话栏、正文行高与段距、侧栏 clip、顶栏去掉时间窗而其他标题不变);`rectification-timeline-20260909.test.ts`、`rectification-mobile-timeline-readout-20260917.test.tsx` 中写死旧内边距的断言按「原值 / 新值 / 原因」改写。`tests/rectification-*`、`chat-answer-detail`、`*sidebar*`、`*conversation*` 等 2076 条通过。`next build --webpack` 后(注意:第一次构建复用了 webpack 缓存里的旧 CSS,删 `.next` 重建才生效),用构建出的 CSS 渲染与生时校正对话同结构的静态页,1440 / 1000 宽深色截图:时间条、正文、输入框左右边对齐,1440 宽每行约 37 个汉字。未在登录后的真页面上截图。
- 补充:顶栏去时间窗第一次推送(`c1b828fc`)门禁 run 2116 前端失败 7 条:`new-chat-from-people-lifecycle.test.tsx` 6 条断言顶栏仍是完整标题、`sidebar-contract.test.ts` 1 条锁着旧的 `<strong>` 写法——本地只跑了相关切片,没跑全量。已按新行为改写这 7 条;本地全量 `npm test` 剩余 28 条失败均为本机缺 PostgreSQL / swisseph / compose 等环境项,CI 那 7 条不再出现。
- 防复发:上面的测试。规则:生时校正与普通对话共用同一条阅读栏 token,不要再给它单独写 `width: 100%`;需要裁切而不是滚动的容器用 `overflow: clip`。本地截图验证 CSS 前先删 `.next`,否则可能看到旧样式。
- 关联记录:BUG-918(时间条手机读数)、BUG-1535(同一分支)。
- 复发自:无
@@ -349,7 +349,7 @@ async function openDocument(tab: Tab, href: string, options: { mobile?: boolean
async function openRectificationThenGoTo(tab: Tab, api: Api, secondaryLabel: string, options: { mobile?: boolean } = {}) {
const doc = await openDocument(tab, `/?c=${RECT}`, options);
await doc.settle(() => doc.view().rectificationSurface, "the rectification session to open");
assert.equal(doc.view().title, "生时校正 · 04:45–05:15");
assert.equal(doc.view().title, "生时校正"); // BUG-1536: the header drops the window the range bar shows
assert.equal(api.opens(), 1);
await doc.followLink(secondaryLabel);
return doc;
@@ -373,7 +373,7 @@ for (const page of [
try {
doc = await openDocument(tab, `/?c=${RECT}`, { mobile: page.mobile });
await doc.settle(() => doc!.view().rectificationSurface, "the rectification session to open");
assert.equal(doc.view().title, "生时校正 · 04:45–05:15");
assert.equal(doc.view().title, "生时校正"); // BUG-1536: the header drops the window the range bar shows
assert.equal(api.opens(), 1);
if (page.mobile) await doc.openDrawer();
await doc.followLink(page.label);
@@ -642,7 +642,7 @@ test("a refresh inside a rectification conversation stays in it (its ?c= is in t
doc = undefined;
doc = await openDocument(tab, address);
await doc.settle(() => doc!.view().rectificationSurface, "the rectification session after refresh");
assert.equal(doc.view().title, "生时校正 · 04:45–05:15");
assert.equal(doc.view().title, "生时校正"); // BUG-1536: the header drops the window the range bar shows
assert.equal(doc.view().url, `/?c=${RECT}`);
assert.equal(api.opens(), 2);
assert.deepEqual(doc.errors, []);
+4 -1
View File
@@ -491,7 +491,10 @@ test("keeps the chat title in the flexible left-aligned header column", () => {
assert.match(cssBlock(".chat-header"), /grid-template-columns:\s*auto\s+minmax\(0,\s*1fr\)\s+auto/);
assert.match(cssBlock(".chat-header"), /text-align:\s*left/);
assert.doesNotMatch(cssBlock(".chat-header"), /justify-content:\s*space-between/);
assert.match(header, /<strong>\{activeSession\?\.title \|\| "新对话"\}<\/strong>/);
// 原值:<strong>{activeSession?.title || "新对话"}</strong>
// 新值:标题经 chatHeaderTitle 处理,进行中的生时校正去掉时间窗
// 原因:BUG-1536 顶栏标题与时间条重复
assert.match(header, /<strong>\{activeSession\?\.title \? chatHeaderTitle\(activeSession\.title, activeSession\.sessionType\) : "新对话"\}<\/strong>/);
assert.doesNotMatch(header, /status-loading|基于星盘证据回答|回答一般占星知识|正在校正出生时间/);
});