-
-
Notifications
You must be signed in to change notification settings - Fork 319
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
fix: scroll loop in 19 #903
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 eslint
src/PickerPanel/TimePanel/TimePanelBody/TimeColumn.tsxOops! Something went wrong! :( ESLint: 8.57.1 Error: Cannot read config file: /.eslintrc.js
概述代码走查本次更改主要涉及两个文件: 变更
序列图sequenceDiagram
participant TimeColumn
participant flattenUnits
TimeColumn->>flattenUnits: 传入单位数组
flattenUnits-->>TimeColumn: 返回字符串表示
Note over TimeColumn,flattenUnits: 改进依赖项处理
可能相关的 PR
诗歌
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 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 #903 +/- ##
=======================================
Coverage 95.47% 95.47%
=======================================
Files 64 64
Lines 2738 2740 +2
Branches 742 742
=======================================
+ Hits 2614 2616 +2
Misses 121 121
Partials 3 3 ☔ View full report in Codecov by Sentry. |
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: 0
🧹 Nitpick comments (1)
tests/picker.spec.tsx (1)
1085-1091
: 测试用例实现得当,但可以进一步优化测试用例很好地验证了
disabledTime
的功能,但建议添加以下改进:
- 为
getDisabledTimeFn
添加类型注解- 为测试用例添加更多边界条件
建议按如下方式重构:
-const getDisabledTimeFn = - (num = 10) => - () => ({ +const getDisabledTimeFn = + (num = 10): (() => { + disabledHours: () => number[]; + disabledMinutes: () => number[]; + disabledSeconds: () => number[]; + }) => () => ({ disabledHours: () => [num], disabledMinutes: () => [num], disabledSeconds: () => [num], });Also applies to: 1093-1099, 1102-1128
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/PickerPanel/TimePanel/TimePanelBody/TimeColumn.tsx
(2 hunks)tests/picker.spec.tsx
(2 hunks)
🔇 Additional comments (2)
src/PickerPanel/TimePanel/TimePanelBody/TimeColumn.tsx (2)
26-29
: 新增的 flattenUnits 函数实现合理该函数通过自定义序列化方式避免了 JSON.stringify 的循环引用问题,实现简洁有效。
62-62
: 依赖数组的更新提高了可靠性使用
flattenUnits
替代原有的数组比较方式,能更准确地追踪 units 的变化。不过建议添加单元测试来验证这个改动的有效性。
Summary by CodeRabbit
重构
测试
这些更改提升了组件的内部处理能力和测试覆盖率,同时保持了用户体验的一致性。