-
-
Notifications
You must be signed in to change notification settings - Fork 243
perf: fix Maximum update depth exceeded caused by inkStyle shaking #820
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
""" Walkthrough本次变更主要优化了 Changes
Suggested reviewers
Poem
Tip ⚡💬 Agentic Chat (Pro Plan, General Availability)
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #820 +/- ##
==========================================
+ Coverage 98.96% 98.97% +0.01%
==========================================
Files 18 18
Lines 772 781 +9
Branches 224 234 +10
==========================================
+ Hits 764 773 +9
Misses 8 8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/hooks/useIndicator.ts(1 hunks)tests/index.test.tsx(4 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
tests/index.test.tsx (2)
tests/common/util.tsx (2)
getTabs(113-147)waitFakeTimer(164-177)docs/examples/indicator.tsx (1)
Tabs(24-57)
🔇 Additional comments (3)
tests/index.test.tsx (3)
615-628: 完善了指示器小数值处理和防抖动的测试用例这些测试用例很好地覆盖了指示器组件在处理小数值和防抖动方面的行为:
- 测试小数值的处理(例如
origin - 0.5)确保小数宽度能正确应用- 测试防抖动功能验证了微小差异(0.1 与 0.2)不会导致不必要的样式更新
这些测试对应了
useIndicator.ts中的优化改动,确保修复能正确工作。
671-681: 添加了指示器动态对齐切换的测试这个测试很好地验证了当
align属性从 'start' 动态变更为 'center' 时,指示器位置能够正确更新。使用rerenderStart进行动态渲染测试是一个很好的方法。
717-741: 完善了垂直布局和 RTL 模式下的指示器测试这些测试用例很好地覆盖了边界场景:
- 测试在垂直布局(
tabPosition="left")下动态切换 align 属性的行为- 测试 RTL(右到左)模式下指示器的样式表现
验证 transform 样式包含
translateY(-50%)确保了 RTL 模式下垂直居中能正确工作。
#818
Summary by CodeRabbit