-
Notifications
You must be signed in to change notification settings - Fork 7
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 ue/main #615
Fix ue/main #615
Conversation
Walkthrough本次更新包含多个文件的修改,主要集中在版本号的增量、按钮组件的样式更新、Tabs 组件的渲染逻辑改进、表格使用的灵活性增强以及新工具函数的引入。还修复了与 Tabs 组件相关的错误,并更新了相关文档,确保整体性能和可维护性。 Changes
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 as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
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: 1
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (9)
- package.json (1 hunks)
- packages/base/src/date-picker/day.tsx (2 hunks)
- packages/base/src/date-picker/time.tsx (1 hunks)
- packages/base/src/tabs/tabs.tsx (3 hunks)
- packages/hooks/src/components/use-table/use-table-virtual.tsx (1 hunks)
- packages/hooks/src/components/use-table/use-table.type.ts (1 hunks)
- packages/hooks/src/utils/is.ts (1 hunks)
- packages/shineout-style/src/tabs/tabs.ts (1 hunks)
- packages/shineout/src/tabs/doc/changelog.cn.md (1 hunks)
Files skipped from review due to trivial changes (2)
- package.json
- packages/shineout/src/tabs/doc/changelog.cn.md
Additional context used
Biome
packages/hooks/src/utils/is.ts
[error] 89-89: Do not access Object.prototype method 'hasOwnProperty' from target object.
It's recommended using Object.hasOwn() instead of using Object.hasOwnProperty().
See MDN web docs for more details.(lint/suspicious/noPrototypeBuiltins)
Additional comments not posted (9)
packages/base/src/date-picker/time.tsx (1)
150-151
: 按钮组件的属性更新看起来不错!为
Button
组件添加mode='text'
和type="primary"
属性可以增强按钮的样式和交互行为。packages/base/src/tabs/tabs.tsx (2)
11-11
: 导入isNamedComponent
的更改看起来不错!引入
isNamedComponent
函数有助于提高组件渲染逻辑的健壮性。
149-156
: 验证isNamedComponent
的使用确保
isNamedComponent
函数在代码库中正确使用,以避免渲染不符合条件的组件。运行以下脚本以验证
isNamedComponent
的使用:Verification successful
验证通过:
isNamedComponent
函数使用正确在代码库中,
isNamedComponent
函数用于检查组件的displayName
,确保只有符合条件的组件被渲染。此功能在tabs.tsx
文件中的使用符合预期。
packages/base/src/tabs/tabs.tsx
:isNamedComponent
函数用于验证Chlid.type
的displayName
。Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of `isNamedComponent` in the codebase. # Test: Search for the function usage. Expect: Correct usage with displayName checks. rg --type tsx -A 5 $'isNamedComponent'Length of output: 65
Script:
#!/bin/bash # Description: Verify the usage of `isNamedComponent` in the codebase using a general search pattern. # Test: Search for the function usage in .tsx files. Expect: Correct usage with displayName checks. rg 'isNamedComponent' --glob '**/*.tsx' -A 5Length of output: 842
packages/base/src/date-picker/day.tsx (2)
163-164
: 确认Button
组件支持的属性请确保
Button
组件支持mode='text'
和type="primary"
属性。这些属性的添加应该符合设计要求。
175-176
: 确认Button
组件支持的属性请确保
Button
组件支持mode='text'
和type="primary"
属性。这些属性的添加应该符合设计要求。packages/hooks/src/components/use-table/use-table.type.ts (1)
267-267
: 验证width
属性的兼容性请确保代码库中使用
TableColumnItem
接口的其他部分能够处理width
属性为number | string
的情况。检查相关逻辑是否支持这两种类型。packages/hooks/src/components/use-table/use-table-virtual.tsx (2)
23-24
: 检查rowsInView
的逻辑请确保在没有垂直滚动的情况下,
rowsInView
被正确设置为props.data.length
。这段逻辑应该准确识别滚动状态。
25-29
: 验证垂直滚动检测逻辑请确认
withoutVerticalScroll
的计算逻辑准确无误,并且在没有垂直滚动时,rowsInView
被正确调整。packages/shineout-style/src/tabs/tabs.ts (1)
542-542
: 过渡效果更新为更平滑的动画
headerScroll
的过渡效果从ease-out
改为cubic-bezier(.34,.69,.1,1)
,这将使动画更平滑。该更改有助于改善用户体验。
export function isNamedComponent(type: any): type is React.ForwardRefExoticComponent<unknown> { | ||
return (isObject(type) || isFunc(type)) && type.hasOwnProperty('displayName'); | ||
} |
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.
建议使用 Object.hasOwn()
在 isNamedComponent
函数中,建议用 Object.hasOwn(type, 'displayName')
替换 type.hasOwnProperty('displayName')
,以避免直接从对象实例上调用 hasOwnProperty
方法。
应用以下代码修复:
export function isNamedComponent(type: any): type is React.ForwardRefExoticComponent<unknown> {
- return (isObject(type) || isFunc(type)) && type.hasOwnProperty('displayName');
+ return (isObject(type) || isFunc(type)) && Object.hasOwn(type, 'displayName');
}
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
export function isNamedComponent(type: any): type is React.ForwardRefExoticComponent<unknown> { | |
return (isObject(type) || isFunc(type)) && type.hasOwnProperty('displayName'); | |
} | |
export function isNamedComponent(type: any): type is React.ForwardRefExoticComponent<unknown> { | |
return (isObject(type) || isFunc(type)) && Object.hasOwn(type, 'displayName'); | |
} |
Tools
Biome
[error] 89-89: Do not access Object.prototype method 'hasOwnProperty' from target object.
It's recommended using Object.hasOwn() instead of using Object.hasOwnProperty().
See MDN web docs for more details.(lint/suspicious/noPrototypeBuiltins)
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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- packages/shineout/src/tabs/test/tabs.spec.tsx (1 hunks)
Additional comments not posted (1)
packages/shineout/src/tabs/__test__/tabs.spec.tsx (1)
359-359
: 验证预期的更改预期的
.demo
类元素数量从2变为0,表明测试场景或底层实现已更新。请确保此更改与组件的渲染行为或状态管理的预期一致。请确认此更改是否符合预期的组件行为。
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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- packages/shineout/src/tabs/test/tabs.spec.tsx (2 hunks)
Files skipped from review as they are similar to previous changes (1)
- packages/shineout/src/tabs/test/tabs.spec.tsx
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
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (8)
- packages/base/src/table/colgroup.tsx (1 hunks)
- packages/base/src/table/tbody.type.ts (1 hunks)
- packages/base/src/table/tfoot.tsx (2 hunks)
- packages/base/src/table/tfoot.type.ts (1 hunks)
- packages/base/src/table/thead.tsx (2 hunks)
- packages/base/src/table/thead.type.ts (1 hunks)
- packages/base/src/table/tr.tsx (3 hunks)
- packages/shineout/src/table/example/test-001-sort-old.tsx (1 hunks)
Files skipped from review due to trivial changes (1)
- packages/shineout/src/table/example/test-001-sort-old.tsx
Additional comments not posted (12)
packages/base/src/table/tfoot.type.ts (1)
10-10
: 更改已批准,但请验证colgroup
的使用情况。此更改增强了
colgroup
属性的灵活性。请确保代码库中所有对colgroup
的使用都与新类型兼容。代码更改已批准。
运行以下脚本以验证
colgroup
的使用情况:Verification successful
colgroup
属性的类型更改已在代码库中一致应用。在
tfoot.type.ts
、tbody.type.ts
和thead.type.ts
文件中,colgroup
的类型均已更新为(number | string | undefined)[]
,没有发现不兼容的使用情况。Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all usages of `colgroup` match the new type. # Test: Search for the `colgroup` usage. Expect: Only occurrences of the new type. rg --type typescript -A 5 $'colgroup'Length of output: 71
Script:
#!/bin/bash # Description: Verify all usages of `colgroup` match the new type. # Test: Search for the `colgroup` usage in TypeScript files. rg --glob '*.ts' -A 5 'colgroup'Length of output: 969
packages/base/src/table/colgroup.tsx (2)
2-2
: 更改已批准,但请验证colgroup
的使用情况。此更改增强了
colgroup
属性的灵活性。请确保代码库中所有对colgroup
的使用都与新类型兼容。代码更改已批准。
运行以下脚本以验证
colgroup
的使用情况:Verification successful
colgroup
属性的类型更改已在代码库中正确应用。以下文件中使用了新的类型
(number | string | undefined)[]
,并且没有发现不兼容的用法:
packages/base/src/table/tfoot.type.ts
packages/base/src/table/tbody.type.ts
packages/base/src/table/thead.type.ts
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all usages of `colgroup` match the new type. # Test: Search for the `colgroup` usage. Expect: Only occurrences of the new type. rg --type typescript -A 5 $'colgroup'Length of output: 71
Script:
#!/bin/bash # Description: Verify all usages of `colgroup` match the new type. # Correct the search for `colgroup` usage in TypeScript files. rg 'colgroup' --glob '*.ts' -A 5Length of output: 969
3-3
: 更改已批准,但请验证columns
的使用情况。此更改增强了
columns
属性的灵活性。请确保代码库中所有对columns
的使用都与新类型兼容。代码更改已批准。
运行以下脚本以验证
columns
的使用情况:Verification successful
验证完成:
columns
属性的使用兼容新类型在代码库中检查了
columns
的使用情况,确认所有用法都兼容新的类型定义。未发现任何与string
类型不兼容的用法。
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all usages of `columns` match the new type. # Test: Search for the `columns` usage. Expect: Only occurrences of the new type. rg --type typescript -A 5 $'columns'Length of output: 70
Script:
#!/bin/bash # Description: Verify all usages of `columns` match the new type. # Test: Search for the `columns` usage. Expect: Only occurrences of the new type. rg --type ts -A 5 $'columns'Length of output: 294860
packages/base/src/table/thead.type.ts (1)
25-25
: 更改已批准,但请验证colgroup
的使用情况。此更改增强了
colgroup
属性的灵活性。请确保代码库中所有对colgroup
的使用都与新类型兼容。代码更改已批准。
运行以下脚本以验证
colgroup
的使用情况:Verification successful
colgroup
属性的类型更改已验证为兼容。在代码库中对
colgroup
的使用与新类型(number | string | undefined)[]
兼容,没有发现任何问题。所有相关操作均符合预期。
- 相关文件包括:
thead.tsx
、tr.tsx
、tbody.tsx
、tfoot.tsx
、colgroup.tsx
等。Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all usages of `colgroup` match the new type. # Test: Search for the `colgroup` usage. Expect: Only occurrences of the new type. rg --type typescript -A 5 $'colgroup'Length of output: 71
Script:
#!/bin/bash # Description: Verify all usages of `colgroup` match the new type. # Test: Search for the `colgroup` usage in TypeScript files. Expect: Only occurrences of the new type. rg --type ts -A 5 $'colgroup'Length of output: 17010
packages/base/src/table/tbody.type.ts (1)
29-29
: 更改看起来不错,但请验证colgroup
属性的使用情况。将
colgroup
属性的类型扩展为包含字符串增强了其灵活性。请确保代码库中所有使用colgroup
属性的地方都能正确处理新类型。代码更改已批准。
运行以下脚本以验证
colgroup
属性的使用情况:packages/base/src/table/tfoot.tsx (2)
25-25
: 改进了计算的健壮性。
reduce
函数现在显式地将值转换为数字,确保所有值都被视为数字,从而提高了计算的健壮性。代码更改已批准。
37-37
: 改进了计算的健壮性。
reduce
函数现在显式地将值转换为数字,确保所有值都被视为数字,从而提高了计算的健壮性。代码更改已批准。
packages/base/src/table/thead.tsx (2)
123-123
: 改进了计算的健壮性。
reduce
函数现在显式地将值转换为数字,确保所有值都被视为数字,从而提高了计算的健壮性。代码更改已批准。
135-135
: 改进了计算的健壮性。
reduce
函数现在显式地将值转换为数字,确保所有值都被视为数字,从而提高了计算的健壮性。代码更改已批准。
packages/base/src/table/tr.tsx (3)
43-43
: 更改已批准:更新colgroup
属性类型将
colgroup
属性类型更新为(number | string | undefined)[]
增强了灵活性。代码更改已批准。
74-76
: 更改已批准:显式转换为数字在
getFixedStyle
函数中显式将值转换为Number
,确保所有元素都被视为数字,防止类型不匹配的潜在错误。代码更改已批准。
86-88
: 更改已批准:显式转换为数字在
getFixedStyle
函数中显式将值转换为Number
,确保所有元素都被视为数字,防止类型不匹配的潜在错误。代码更改已批准。
Types of changes
Changelog
Table
固定列的阴影有1px的露底问题Tabs
组件下渲染非Tabs.Panel子组件时报错的问题Table
传了virtual但是容器没有定高导致的抖动问题Tabs
组件的Header区域横向滚动的动画Summary by CodeRabbit
新功能
错误修复
Tabs.Panel
子组件时导致的错误。样式
文档