diff --git a/docs/BUG_HISTORY.md b/docs/BUG_HISTORY.md index 5956fde5..857203d8 100644 --- a/docs/BUG_HISTORY.md +++ b/docs/BUG_HISTORY.md @@ -4649,4 +4649,20 @@ - 防复发:创建会话 schema 必须保留 `id`;出生资料 `select` 不得用 `.join(",")` 得到非字面量字符串。staging push 的 validate 不跑 `next build`,类型回归只在 publish Docker 暴露。 - 相关记录:BUG-261、BUG-308 - 复发自:无 +- 修复版本:`d7887b03` + +## BUG-310 | 生时纠正宫位表贴着头像左缘,没有和 Agent 正文对齐 + +- 状态:resolved +- 首次发现:2026-08-19 +- 最近更新:2026-08-19 +- 影响面:生时纠正对话里的 `RectificationHouseTableView`、候选时间卡、已采用时间说明 +- 用户现象:Agent 正文和赞踩操作栏缩在头像右侧,本命宫位标题和表格贴着对话左缘,和头像齐平。 +- 触发条件:校正对话出现本命宫位表。 +- 根因:宫位表是 `.message-list` 里消息行的兄弟节点,不走 `.message-assistant` 的头像 + `gap` 列,也没有补上同一条起始线。 +- 修复:`.message-list` 定义 `--assistant-content-inset: calc(32px + var(--space-3))`,宫位表用 `padding-inline-start`,候选卡和已采用说明用同一 inset 的 `margin-inline-start`。 +- 验证:`frontend/tests/rectification-agentic-entry.test.ts` 锁定 inset 等于头像宽加 assistant gap。 +- 防复发:宫位表和后续结果块不得再与头像左缘齐平;起始线必须来自头像尺寸加 `.message-assistant` 的 gap,不能另写一个魔法像素。 +- 相关记录:BUG-307 +- 复发自:BUG-307(表作为消息兄弟落地,未接入 assistant 列) - 修复版本:待提交 diff --git a/frontend/src/app/globals.css b/frontend/src/app/globals.css index d89aeef2..6ab215d6 100644 --- a/frontend/src/app/globals.css +++ b/frontend/src/app/globals.css @@ -678,7 +678,12 @@ button:disabled { cursor: default; opacity: .45; } .rectification-entry-error { grid-column: 1 / -1; margin: 0; } .starter-loading { color: var(--color-ink-secondary); margin-left: 0; padding: var(--space-5); border-radius: var(--radius-lg); background: var(--color-canvas-muted); font-size: 14px; } .starter-note { margin: 10px 0 0; color: var(--color-ink-secondary); line-height: 1.5; grid-column: 1 / -1; font-size: 13px; } -.message-list { margin: 0 auto; width: min(900px, 100%); padding: var(--space-8) var(--space-8) var(--space-16); } +.message-list { + --assistant-content-inset: calc(32px + var(--space-3)); + margin: 0 auto; + width: min(900px, 100%); + padding: var(--space-8) var(--space-8) var(--space-16); +} .message { display: flex; animation: message-enter 160ms var(--ease-out) both; padding: var(--space-2) 0; } .agent-avatar { width: 32px; height: 32px; display: block; flex: 0 0 32px; margin-top: var(--space-2); border-radius: 50%; background: var(--color-canvas) url("/jyotish-logo.png") center / contain no-repeat; box-shadow: 0 0 0 1px oklch(0 0 0 / .1); } .message-content { min-width: 0; max-width: min(80%, 680px); } @@ -1845,7 +1850,9 @@ input:not([type="radio"]):not([type="checkbox"]):not([class^="ant-"]):not([class .rectification-candidates { display: grid; gap: 14px; + width: calc(100% - var(--assistant-content-inset)); margin: 8px 0 16px; + margin-inline-start: var(--assistant-content-inset); padding: 18px; border: 1px solid var(--color-border); border-radius: var(--radius-lg); @@ -1898,11 +1905,18 @@ input:not([type="radio"]):not([type="checkbox"]):not([class^="ant-"]):not([class font-weight: 650; } .rectification-candidate-action { align-self: end; color: var(--color-action); font-size: 13px; font-weight: 650; } -.rectification-saved { margin: 8px 0 16px; color: var(--color-ink); font-size: var(--type-body-sm); } +.rectification-saved { + width: calc(100% - var(--assistant-content-inset)); + margin: 8px 0 16px; + margin-inline-start: var(--assistant-content-inset); + color: var(--color-ink); + font-size: var(--type-body-sm); +} .rectification-house-table { display: grid; gap: var(--space-3); margin: 8px 0 16px; + padding-inline-start: var(--assistant-content-inset); } .rectification-house-table__heading { display: grid; gap: 5px; } .rectification-house-table__heading strong { diff --git a/frontend/tests/rectification-agentic-entry.test.ts b/frontend/tests/rectification-agentic-entry.test.ts index 2af35635..1ed80bb2 100644 --- a/frontend/tests/rectification-agentic-entry.test.ts +++ b/frontend/tests/rectification-agentic-entry.test.ts @@ -316,6 +316,10 @@ test("candidate state renders from the snapshot API and never from sentinels", ( assert.match(chat, /正在采用…/); assert.match(chat, /RectificationHouseTableView/); assert.match(styles, /\.rectification-house-table \{/); + assert.match(styles, /--assistant-content-inset:\s*calc\(32px \+ var\(--space-3\)\)/); + assert.match(styles, /\.rectification-house-table \{[^}]*padding-inline-start:\s*var\(--assistant-content-inset\)/); + assert.match(styles, /\.agent-avatar \{[^}]*width:\s*32px/); + assert.match(styles, /\.message-assistant \{[^}]*gap:\s*var\(--space-3\)/); });