fix(think): hide retained content when collapsed - #2026
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThink 组件新增 ChangesThink 内容可见性
Estimated code review effort: 1 (简单) | ~5 分钟 Merge Risk: ⚪ Minimal · up to This localized change hides retained Think content after collapse while preserving it in the DOM, with a regression test covering the behavior. No actionable merge-blocking risk remains beyond normal checks and review. Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
nrps9909
left a comment
There was a problem hiding this comment.
Reviewed exact head 6db80a3 against base 25aad7b.
The leavedClassName is attached to the CSSMotion wrapper after the collapse transition, and the new selector is correctly scoped beneath the Think root. It hides the retained wrapper only after leave without changing removeOnLeave behavior.
Validation performed:
- Removed the new display rule locally: the submitted retained-content regression failed with computed display block instead of none.
- Restored exact head: the complete Think suite passes 11/11 tests and 2/2 snapshots.
- A temporary complementary collapse-to-expand probe verified that the same retained wrapper loses the hidden class and returns to computed display block when reopened, so the rule does not strand content invisibly.
- packages/x TypeScript noEmit passed.
- Biome passed both changed files.
- git diff --check passed.
- Live PR head rechecked before review and still matches the tested SHA; current remote checks are green.
AI assistance disclosure: Codex was used to inspect the exact motion and style paths, run the red/green and reopen probes, execute static checks, and draft this review. I verified the reported commands and outcomes.
🤔 这个变动的性质是?
🔗 相关 Issue
Fixes #2025
💡 需求背景和解决方案
destroyOnHidden={false}时,Think 折叠后会保留内容节点并添加ant-think-content-hidden,但缺少对应的隐藏样式,导致内容仍然可见。为离场后的内容包装节点补充
display: none,并增加回归测试,验证节点仍保留在 DOM 中但不可见。📝 更新日志
destroyOnHiddenisfalse.destroyOnHidden为false时折叠后内容仍然可见的问题。Summary by CodeRabbit
Bug 修复
测试
none。