-
Notifications
You must be signed in to change notification settings - Fork 285
fix(noticebar): the speed and duration attributes behave incorrectly in vertical mode #3252
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
Open
mingquan5830
wants to merge
5
commits into
jdf2e:feat_v3.x
Choose a base branch
from
mingquan5830:fix/noticebar-duration
base: feat_v3.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+189
−44
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
ce7517f
fix(noticebar): first item is not visible when scrolling vertically
mingquan5830 0dacc66
fix(noticebar): children cannot update responsively in vertical mode
mingquan5830 4e9a61d
fix: the speed and duration attributes behave incorrectly in vertical…
mingquan5830 6834887
Merge branch 'feat_v3.x' into fix/noticebar-duration
mingquan5830 34ea61f
Merge branch 'feat_v3.x' into fix/noticebar-duration
mingquan5830 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
💡 Verification agent
🧩 Analysis chain
Web 版本实现与 Taro 版本保持一致
scrollAnimationTimeMs的计算逻辑与 Taro 版本完全一致,确保了跨平台行为的统一性。静态分析显示第211-212行未被测试覆盖。这些行处理了动画时间为0时的回退逻辑,建议补充相关测试用例。
运行以下脚本检查现有测试是否覆盖了边界情况:
🏁 Script executed:
Length of output: 432
请补充测试以覆盖「动画时间为0时的回退逻辑」
静态分析和现有测试结果显示,以下分支尚无覆盖:
speed或height为0时,scrollAnimationTimeMs应直接返回0height/speed/4计算后小于1s(触发toFixed(1)四舍五入),且结果为0时,应进入不带/4因子的回退计算分支建议在
src/packages/noticebar/__test__/noticebar.spec.tsx中新增至少三个测试用例,分别验证上述场景:speed={0}或height={0}speed和height组合使得height/speed/4 < 1且四舍五入后等于0/4因子与不带因子的计算结果是否符合预期(回退分支)🧰 Tools
🪛 GitHub Check: codecov/patch
[warning] 211-212: src/packages/noticebar/noticebar.tsx#L211-L212
Added lines #L211 - L212 were not covered by tests
🤖 Prompt for AI Agents