Conversation
Reviewer's GuideThis pull request introduces an 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.
Pull Request Overview
This PR enhances the Logout component by introducing a customizable AvatarRadius parameter to allow users to specify the avatar's border radius, updating both the component code and its styling.
- Added the AvatarRadius parameter and built an AvatarStyleString property in Logout.razor.cs.
- Updated Logout.razor to apply the dynamic border radius via the style attribute on the avatar image.
- Added a unit test in LogoutTest.cs to validate that the new parameter correctly controls the CSS variable.
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| test/UnitTest/Components/LogoutTest.cs | Added a unit test to verify the AvatarRadius style is applied. |
| src/BootstrapBlazor/Components/Logout/Logout.razor.cs | Introduced the AvatarRadius parameter and refactored Localizer usage. |
| src/BootstrapBlazor/Components/Logout/Logout.razor | Updated the image tag to apply the dynamic style for the avatar. |
Files not reviewed (1)
- src/BootstrapBlazor/Components/Logout/Logout.razor.scss: Language not supported
Comments suppressed due to low confidence (1)
test/UnitTest/Components/LogoutTest.cs:109
- [nitpick] Consider adding a test case for when AvatarRadius is null to verify that no additional style is applied.
}
There was a problem hiding this comment.
We encountered an error and are unable to review this PR. We have been notified and are working to fix it.
You can try again by commenting this pull request with @sourcery-ai review, or contact us for help.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5969 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 670 670
Lines 30602 30606 +4
Branches 4352 4352
=========================================
+ Hits 30602 30606 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Link issues
fixes #5968
Summary By Copilot
This pull request introduces enhancements to the
Logoutcomponent in theBootstrapBlazorlibrary, focusing on improving customization options and refactoring the code for better maintainability. The most important changes include adding support for customizable avatar border radius, updating styles and markup to reflect this new feature, and adding unit tests to validate the changes.Enhancements to the
Logoutcomponent:AvatarRadiusparameter to allow customization of the avatar's border radius. This is reflected in theLogout.razor.csfile, where a new private propertyAvatarStyleStringwas introduced to dynamically build the CSS style string based on the parameter value. (src/BootstrapBlazor/Components/Logout/Logout.razor.cs, src/BootstrapBlazor/Components/Logout/Logout.razor.csL73-R85)Logout.razorfile to apply theAvatarStyleStringto the avatar image'sstyleattribute, enabling the new border-radius customization. (src/BootstrapBlazor/Components/Logout/Logout.razor, src/BootstrapBlazor/Components/Logout/Logout.razorL24-R24)Styling updates:
--bb-logout-user-avatar-border-radiuswith a default value of0. This variable is now used to control the avatar's border radius. (src/BootstrapBlazor/Components/Logout/Logout.razor.scss, src/BootstrapBlazor/Components/Logout/Logout.razor.scssR73)Unit tests:
AvatarRadius_Okto verify that theAvatarRadiusparameter correctly applies the expected CSS style to the component's markup. (test/UnitTest/Components/LogoutTest.cs, test/UnitTest/Components/LogoutTest.csR99-R109)Code refactoring:
Localizerproperty from theLogoutcomponent and reintroduced theLogoutClassStringproperty, simplifying the component's structure and improving maintainability. (src/BootstrapBlazor/Components/Logout/Logout.razor.cs, [1] [2]Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Add customizable avatar border radius to the Logout component
New Features:
Enhancements:
Tests: