Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review. Walkthrough通知项现在会向列表报告悬停状态。列表按当前悬停项的 key 处理退出和卸载事件,并在列表离开时清除悬停跟踪。新增测试覆盖悬停状态和通知自动关闭计时行为。 Changes堆叠通知悬停状态
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~12 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested reviewers: Merge Risk: ⚪ Minimal · up to Removing a hovered notice clears its list hover state and resumes the remaining notices’ timers; the reviewed changes show no unresolved merge-blocking risk. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change is confined to notification hover and dismissal behavior; no security-sensitive access path was identified. Tests cover the principal removal and hover-transfer cases, but animated exits and replacement of a notice with the same key remain unverified. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 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 |
|
React Doctor found 1 new issue in 1 file · 1 warning · score 70 / 100 (Needs work) · 1 fixed · vs 1 warning
Reviewed by React Doctor for commit |
❌ Deploy failed
📋 Build log (last lines)🤖 Powered by surge-preview |
|||||||||
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #414 +/- ##
==========================================
+ Coverage 99.20% 99.23% +0.03%
==========================================
Files 12 12
Lines 376 394 +18
Branches 102 105 +3
==========================================
+ Hits 373 391 +18
Misses 3 3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
看看这个case算不算问题:打开 5 条通知,悬停展开后关闭倒数第二条,鼠标保持不动。此时下面还有一条通知会补到原来的位置,按理说鼠标仍在通知区域内;这里卸载时直接清掉 listHovering,会不会先触发收起并恢复计时,导致剩余通知自动关闭?是否应该继续保持暂停。 |
|
咋,不要了吗? |

问题与修复
移除正在悬停的通知时,React 可能不会触发 mouseleave,导致列表持续展开且剩余通知无法自动关闭。
由
Notification.tsx卡片组件自身用useRef记录悬停状态,通过onHover(boolean)上报,卸载时仅对仍悬停的卡片上报清理,并按 key 避免旧卡片清掉新卡片的悬停状态。保留列表原有的移入、移出处理,维持卡片间隙的悬停行为。这是 #413 的另一种修复方案:通过卡片卸载清理状态,无需文档级 mousemove 监听。若移除后鼠标落在另一张卡片上,暂停状态依赖该卡片的后续 mouseenter。
Fixes ant-design/ant-design#59412
验证
Summary by CodeRabbit