Repository navigation
fix: 1.6.2 切换标签页后对话内容叠在一起 - #14
Merged
Merged
Conversation
…le again The session-switch layout effect also ran on every paused -> visible toggle and cleared the turn height cache before virtualizer.measure(). Rows mounted while the restored scroll was in flight skip tanstack's ref measurement (isScrolling), so long turns painted at the 72px estimate spacing and overlapped until the async ResizeObserver re-render landed. Only clear the cache when the session scope (scrollMemoryKey + sessionKey) changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
用户反馈:切换 workbench 标签页后,对话内容大量叠在一起;内容少时不明显,长会话、正在对话时明显。前两次(jsdom、合成回放 E2E)未能复现,本次用用户真实数据的隔离副本在 dev 版中复现。
Bugfix
ConversationTimeline.tsx会话切换useLayoutEffect依赖paused(=!paneVisible),每次标签页重新可见都清空行高缓存并virtualizer.measure(),所有行回落到 72px 估算;恢复滚动触发 scroll,@tanstack/react-virtual 3.13.23 在 isScrolling 期间不测新挂载行,只能等 ResizeObserver 异步回调。逐帧数据:切回首帧第 0–5 行 translateY 为 0/72/144/…/360,真实高度 940–2510px,最大重叠 1290px,持续约 450ms。把清缓存恢复为每次都清做 A/B,72px 叠行立即复现。scrollMemoryKey、sessionKey)变化时清空;面板隐藏再显示保留真实测高(隐藏时测到的 0 本就不写入缓存)。v4ConversationTimelineScrollMemory.test.ts新增用例:隐藏再显示后estimateSize仍返回真实测高、切会话后回到 72;去掉修复时失败(expected 72 to be 1362)。修复前后(真实数据,6 个长会话:原生 4、Claude Code 1、Codex 1)
验证
pnpm typecheck通过;pnpm lint0 errors;architecture:check --changed0 违规;时间线相关 6 个测试文件 28 例通过。🤖 Generated with Claude Code