diff --git a/docs/BUG_HISTORY.md b/docs/BUG_HISTORY.md index 8f5564880..6c39a03b8 100644 --- a/docs/BUG_HISTORY.md +++ b/docs/BUG_HISTORY.md @@ -31549,3 +31549,24 @@ - 防复发:问答页的新动效只能用 BUG-2327 的令牌,守卫测试钉住。 - 关联记录:BUG-2327(全站动效语言)、BUG-2308、BUG-2320、BUG-2305、BUG-2323、BUG-2277。 - 修复版本:分支 `claude/motion-chat-2328`(未推送)。 + +## BUG-2329 | 星盘页与问答星盘面板:换盘型时星体原地重画、选中块跳变、检视卡和展开内容硬切,动效时长各写各的 + +- 状态:fixed-pending-verify(BUG-2327 动效语言第 2 步,B 区:星盘页 + 问答星盘面板内部)。 +- 首次发现 / 最近更新:2026-11-24 / 2026-11-24。 +- 现象:换盘型(D1→D9 等)时九曜直接在新宫格里重画,看不出谁从哪里去了哪里;北/南切换硬切;分段标签(盘型条、北/南、盘面数据九个页签和子页签、大运体系等)选中底块直接跳;盘面检视换选中对象时内容硬切;「看…」展开、小运、出生说明、其他命名格局直接出现;骨架换成真盘没有过渡;宫格底色 .15s、星体 .2s、展开箭头 .15s ease-out、西洋盘重画 0.8s、出生星空按钮 120ms、星历日历选中 120ms ease 等写死值。 +- 触发条件:星盘页和问答页右侧星盘面板的所有上述状态变化。 +- 根因:星体画在各宫的墨迹组里、位置写在文字 x/y 上,换宫就是卸载再挂载,无法过渡;各处动效在 BUG-2327 之前手写。 +- 修复: + - `chart-board-svg.tsx`:九曜移到独立一层,按星体 key 保持同一元素,用 `transform: translate()` 摆放;`.chart-board-body` 过渡 `transform` standard / `--ease-out`,中途再切会从当前位置接着走(可打断)。宫内标签按「星座 / 宫号」做 key,变了的才以 quick 淡入;被淡化宫里的星体改用 `.is-house-faded`(与原先嵌套透明度一致,叠加 is-dim 仍为 .07)。 + - `chart-board-card.tsx`:盘体按北/南 key,北↔南为整盘 standard 淡入;骨架→真盘同一淡入;标题(BUG-2273 的上升说明)各段按内容 key,quick 淡入。 + - `components/ui/tabs.tsx`:TabsList 新增可选 `indicator`(仅 default 变体),用 Base UI 的 Tabs.Indicator 画一块选中底,只过渡 `translate`(quick / `--ease-out`),宽度直接取新标签的(不动画布局属性);不加该参数的列表外观不变。星盘区 13 个分段列表启用(星盘页「印度盘/西洋盘」下划线标签不变)。 + - `chart-inspector.tsx`:检视卡正文按选中对象 key,standard 原地淡入,卡片尺寸不变。 + - `chart-board.css`:宫格底色/描边、墨迹透明度、星体颜色 → quick / `--ease-standard`;关系线、点位标记、高亮框、六力小标签 quick 淡入;展开箭头 quick / `--ease-standard`;展开内容(深度解读、小运、出生说明、其他命名格局)从开关处下落 4px + 淡入 standard,收起立即;瑜伽卡选中底色 quick,关系小图 quick 淡入。 + - `globals.css` 末尾 `/* BUG-2329 motion — chart */`:滑动选中底;西洋盘/旧印度盘重画 0.8s → emphasis、淡入 .15s → quick;星历日历选中格与主题箭头 → quick / `--ease-standard`。`birth-sky-converge.css` 按钮 120ms → instant。 + - 所有新动效在减弱动效时为 0 或 none。 + - 原值 / 新值 / 原因:`chart-board-20261027.test.tsx` 北盘星体位置断言原读文字 x/y,新读 `transform: translate(x, y)`(字画在 0,0);原因:星体要用同一元素平移到新宫格。 +- 验证:新增 `frontend/tests/motion-chart-2329.test.tsx`(6 条:只用档位、只动透明度/位移/颜色、星体独立层用 transform 平移、减弱动效关闭、`indicator` 只渲染一块底且默认不变、星盘区分段列表都启用)。无头 Chrome(CDP,本机无 Playwright)+ 构建出的 CSS + 真实 D1/D9/D10/D3 北盘标记:宽屏 1280 换盘型 8 次、每 100ms 连续换、7 张盘页面滚动 3 秒均 p50/p95 16.7ms、无超过 20ms 的帧;手机 390 + CPU 4 倍降速:换盘型 p95 16.7ms 无掉帧,连续每 100ms 换 3 帧 33ms,滚动无掉帧(机器高负载时测得的掉帧在减弱动效对照组同样出现,属本机负载)。截图确认浅色/深色下星体落位正确。tsc、eslint 0 错误;前端全量 28 条失败均为本机缺 PostgreSQL / Python 依赖 / staging 环境;built CSS 检查通过。 +- 防复发:星盘区新动效只用 `--motion-*` / `--ease-*`,由 `motion-chart-2329.test.tsx` 拦写死时长、关键字缓动和布局属性过渡。 +- 关联记录:BUG-2327(动效语言)、BUG-2273(盘面标题)、BUG-1520(骨架占位不跳)。 +- 修复版本:分支 `claude/motion-chart-2329`(未推送)。 diff --git a/frontend/src/app/globals.css b/frontend/src/app/globals.css index e93ec908b..82fc8075b 100644 --- a/frontend/src/app/globals.css +++ b/frontend/src/app/globals.css @@ -9083,3 +9083,48 @@ button.report-ask-excerpt-toggle { height: 32px; padding: 0; color: var(--color- .jump-to-latest, .chat-chart-split { animation: none; } } + +/* BUG-2329 motion — chart */ +/* Segmented tabs with `indicator`: one selected pill that slides from the old tab to the new + one (quick, ease-out — a repeated action), instead of the background jumping. The pill is + the list's only moving element and is absolutely positioned, so nothing else reflows. Only + its position animates (width is a layout property, so it never animates); its width + takes the new tab's at once. Interruptible: a new pick mid-slide continues from where it is. */ +[data-slot="tabs-list"][data-indicator] { position: relative; isolation: isolate; } +[data-slot="tabs-list"][data-indicator] > [data-slot="tabs-trigger"] { position: relative; z-index: 1; } +[data-slot="tabs-list"][data-indicator] > [data-slot="tabs-trigger"][data-active] { background-color: transparent; box-shadow: none; } +.tabs-indicator { + position: absolute; + z-index: 0; + top: var(--active-tab-top); + left: 0; + width: var(--active-tab-width); + height: var(--active-tab-height); + translate: var(--active-tab-left) 0; + border-radius: var(--radius-md); + background: var(--color-background); + box-shadow: 0 1px 3px rgb(0 0 0 / .08), 0 1px 2px -1px rgb(0 0 0 / .08); + pointer-events: none; + transition: translate var(--motion-quick) var(--ease-out); +} +.chart-data-tabs .tabs-indicator, +.chart-dasha-switch .tabs-indicator { border-radius: 999px; } +@media (prefers-reduced-motion: reduce) { + .tabs-indicator { transition: none; } +} +/* The western wheel (and the legacy vedic stage) redraw on a person change: the 0.8s line + draw becomes emphasis, the swap fade quick, on the shared curves. Reduced motion: tokens are 0. */ +.chart-page-vedic-stage.is-redrawing .personal-report-chart-cell, +.chart-page-western-wheel.is-redrawing .chart-page-western-ring, +.chart-page-western-wheel.is-redrawing .chart-page-western-spoke, +.chart-page-western-wheel.is-redrawing .chart-page-western-house { animation-duration: var(--motion-emphasis); animation-timing-function: var(--ease-out); } +.chart-page-vedic-stage.is-fading .chart-page-vedic-plot, +.chart-page-western-wheel.is-fading { animation-duration: var(--motion-quick); animation-timing-function: var(--ease-out); } +/* Ephemeris calendar: moving the selected day is a repeated action — the outline moves on the + quick token; the day-theme chevron turns on quick / ease-standard. */ +.ephemeris-month-cell { transition: background-color var(--motion-quick) var(--ease-standard), border-color var(--motion-quick) var(--ease-standard); } +.ephemeris-day-theme-chevron { transition: transform var(--motion-quick) var(--ease-standard); } +@media (prefers-reduced-motion: reduce) { + .ephemeris-month-cell, + .ephemeris-day-theme-chevron { transition: none; } +} diff --git a/frontend/src/components/birth-sky/birth-sky-converge.css b/frontend/src/components/birth-sky/birth-sky-converge.css index 0d638f618..b5c61cb66 100644 --- a/frontend/src/components/birth-sky/birth-sky-converge.css +++ b/frontend/src/components/birth-sky/birth-sky-converge.css @@ -59,7 +59,7 @@ font: inherit; font-size: var(--type-body-sm); cursor: pointer; - transition: background-color 120ms ease-out, transform 120ms ease-out; + transition: background-color var(--motion-instant) var(--ease-standard), transform var(--motion-instant) var(--ease-standard); } .birth-sky-control:hover { background: color-mix(in srgb, #f2f0ea 10%, transparent); } .birth-sky-control:active { transform: scale(.96); } diff --git a/frontend/src/components/chart-board/chart-board-card.tsx b/frontend/src/components/chart-board/chart-board-card.tsx index dd53ba0ef..64a90ebab 100644 --- a/frontend/src/components/chart-board/chart-board-card.tsx +++ b/frontend/src/components/chart-board/chart-board-card.tsx @@ -242,9 +242,9 @@ export function ChartBoardCard({ {/* No model yet: the caption keeps its place, so nothing in the row moves (BUG-1520). */} {style === "north" && caption ? (
- {caption.kicker} - {caption.title} - {caption.detail ? {caption.detail} : null} + {caption.kicker} + {caption.title} + {caption.detail ? {caption.detail} : null} {"chips" in caption && caption.chips?.length ? ( {caption.chips.map((chip) => {chip})} @@ -269,7 +269,7 @@ export function ChartBoardCard({ ) : null} value && onStyle(value as ChartBoardStyle)}> - + 北 南 @@ -283,6 +283,9 @@ export function ChartBoardCard({ data-onboarding-draw={compact ? undefined : "vedic"} > 0 ? cy + 16 @@ -325,8 +324,8 @@ export function ChartBoardSvg({ {cell.shape.kind === "rect" ? ( <> - {`${SIGN_GLYPH[cell.sign] ?? ""} ${signName}`} - + {`${SIGN_GLYPH[cell.sign] ?? ""} ${signName}`} + {shownHouse(cell.house)} {note ? ( @@ -342,8 +341,8 @@ export function ChartBoardSvg({ ) : ( <> - {`${SIGN_GLYPH[cell.sign] ?? ""} ${signName}`} - + {`${SIGN_GLYPH[cell.sign] ?? ""} ${signName}`} + {isAsc ? `上升 ${shownHouse(cell.house)}` : shownHouse(cell.house)} {note ? ( @@ -356,7 +355,19 @@ export function ChartBoardSvg({ ) : null} )} - {house.bodies.map((body, index) => { + + ); + })} + {/* BUG-2329: bodies live in one layer keyed by planet, placed by a transform, so a chart-type + or person switch moves each planet from its old cell to its new one instead of + redrawing it in place. Interruptible: a new switch mid-move continues from where it is. */} + + {cells.map((cell) => { + const house = model.houses[cell.house - 1]!; + const faded = hasSelection ? !relations.lit.has(cell.house) : focusFades(focus, cell.house); + const signName = signZh(SIGN_ORDER[cell.sign] ?? ""); + const layout = layouts.get(cell.house)!; + return house.bodies.map((body, index) => { const point = layout.points[index]!; const selected = selectedKey === body.key; const dim = (dimmedBodies?.has(body.key) ?? false) || (!selected && (focus?.dimmed.has(body.key) ?? false)); @@ -368,7 +379,8 @@ export function ChartBoardSvg({ return ( activateOnKey(event, select)} > - + {PLANET_GLYPH_ZH[body.key]} - + {`${Math.floor(body.degree)}°${body.retrograde && !node ? " R" : ""}`} {mark?.pill ? ( - - {mark.text} + + {mark.text} ) : mark ? ( - {mark.text} + {mark.text} ) : null} ); - })} - - ); - })} + }); + })} + {focusHub ? (