-
-
Notifications
You must be signed in to change notification settings - Fork 363
feat(Tab): add IsLoopSwitchTabItem parameter controll switch tab item behavior #5844
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
Reviewer's Guide by SourceryThis pull request introduces the Sequence diagram for ClickPrevTab with IsLoopSwitchTabItem = falsesequenceDiagram
participant Tab
Tab->>Tab: index--
alt index < 0
Tab->>Tab: IsLoopSwitchTabItem == false
Tab-->>Tab: return
else index >= 0
Tab->>Tab: ClickTabToNavigation == false
Tab->>Tab: TabItems[index].SetActive(false)
end
Sequence diagram for ClickNextTab with IsLoopSwitchTabItem = falsesequenceDiagram
participant Tab
Tab->>Tab: index++
alt index + 1 > TabItems.Count
Tab->>Tab: IsLoopSwitchTabItem == false
Tab-->>Tab: return
else index + 1 <= TabItems.Count
Tab->>Tab: ClickTabToNavigation == false
Tab->>Tab: item.SetActive(false)
end
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Copilot reviewed 2 out of 5 changed files in this pull request and generated no comments.
Files not reviewed (3)
- src/BootstrapBlazor.Server/Locales/en-US.json: Language not supported
- src/BootstrapBlazor.Server/Locales/zh-CN.json: Language not supported
- src/BootstrapBlazor/BootstrapBlazor.csproj: Language not supported
Comments suppressed due to low confidence (2)
src/BootstrapBlazor/Components/Tab/Tab.razor.cs:143
- [nitpick] Consider updating the XML summary comment for 'IsLoopSwitchTabItem' to more clearly state its purpose, e.g. 'Gets or sets whether tab switching should loop when navigating beyond the first or last tab.'
/// Gets or sets whether auto reset tab item index. Default is true.
src/BootstrapBlazor/Components/Tab/Tab.razor.cs:700
- [nitpick] Consider refactoring the index boundary check to 'if (index >= TabItems.Count)' for clarity and to maintain consistency with the range check in ClickPrevTab.
if (index + 1 > TabItems.Count)
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.
Hey @ArgoZhang - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider adding a sample to demonstrate the new
IsLoopSwitchTabItemfunctionality. - Good job on including localization for the new parameter.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟡 Complexity: 1 issue found
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5844 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 660 660
Lines 30125 30136 +11
Branches 4255 4257 +2
=========================================
+ Hits 30125 30136 +11 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
… behavior (#5844) * feat: 增加 IsAutoLoopTabItem 参数 * doc: 更新文档 * chore: bump version 9.5.8-beta01 * test: 增加单元测试
Link issues
fixes #5839
Summary By Copilot
This pull request introduces a new feature to the
Tabcomponent, enabling or disabling the looping behavior when switching between tabs. It also includes updates to localization files, documentation, and the project version.Feature Enhancements:
IsLoopSwitchTabItemParameter toTabComponent:IsLoopSwitchTabItemto control whether tabs loop when switching. Defaults totrue.ClickPrevTabandClickNextTabmethods to respect theIsLoopSwitchTabItemsetting, preventing looping when set tofalse. [1] [2]Localization Updates:
en-US.json):IsLoopSwitchTabItemfeature in the tabs documentation.TabAttIsLoopSwitchTabItem.zh-CN.json):IsLoopSwitchTabItemfeature in the tabs documentation.TabAttIsLoopSwitchTabItem.Documentation and Metadata:
IsLoopSwitchTabItemto the attributes list inTabs.razor.cs.9.5.8-beta01inBootstrapBlazor.csproj.Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Add a new parameter to control tab switching behavior, allowing users to disable tab looping
New Features:
IsLoopSwitchTabItemparameter to control whether tabs can loop when reaching the first or last tabEnhancements:
Documentation:
IsLoopSwitchTabItemparameter in attribute descriptions