-
Notifications
You must be signed in to change notification settings - Fork 459
[dev-v5][CounterBadge] Change Count type to int #4465
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
- Allow specifying OverflowCount in example - Update some test
|
✅ All tests passed successfully Details on your Workflow / Core Tests page. |
Summary - Unit Tests Code CoverageSummary
CoverageMicrosoft.FluentUI.AspNetCore.Components - 98.8%
|
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.
Pull request overview
This pull request updates the FluentCounterBadge component to change the Count parameter type from ushort? to int?, making it consistent with the existing OverflowCount parameter type and supporting a wider range of values.
Changes:
- Changed the
Countparameter type fromushort?toint?in FluentCounterBadge component - Updated demo component to support overflow count input and use
int.TryParseinstead ofUInt16.TryParse - Updated tests to validate the new
inttype and added verification for count attribute rendering with overflow
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| src/Core/Components/Badge/FluentCounterBadge.razor.cs | Changed Count parameter from ushort? to int? to support wider range of values and consistency with OverflowCount |
| examples/Demo/FluentUI.Demo.Client/Documentation/Components/Badges/CounterBadge/Examples/CounterBadgeAttached.razor.cs | Added overflowcount variable to support overflow count demonstration |
| examples/Demo/FluentUI.Demo.Client/Documentation/Components/Badges/CounterBadge/Examples/CounterBadgeAttached.razor | Updated parsing logic from UInt16.TryParse to int.TryParse and added overflow count input field |
| tests/Core/Components/Badge/FluentCounterBadgeTests.razor | Updated Count type assertions, modified CountOutOfRange test logic, added count attribute verification in overflow test, and removed trailing whitespace |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This pull request updates the
FluentCounterBadgecomponent to improve its handling of count values by switching fromushort?toint?for theCountparameter, adds support for an overflow count in the demo, and updates related tests to reflect these changes. The changes enhance flexibility and robustness, especially for larger count values and overflow scenarios.Component enhancements:
Countparameter type inFluentCounterBadgefromushort?toint?to support a wider range of values. (src/Core/Components/Badge/FluentCounterBadge.razor.cssrc/Core/Components/Badge/FluentCounterBadge.razor.csL56-R56)CountandOverflowCountto useintinstead ofushort. (examples/Demo/FluentUI.Demo.Client/Documentation/Components/Badges/CounterBadge/Examples/CounterBadgeAttached.razor[1] [2]Testing improvements:
inttype forCount, including handling values out of range and verifying correct attribute rendering when overflow occurs. (tests/Core/Components/Badge/FluentCounterBadgeTests.razor[1] [2] [3]