-
Notifications
You must be signed in to change notification settings - Fork 459
[dev-v5] Add the PresenceBadge #4461
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
base: dev-v5
Are you sure you want to change the base?
Conversation
…m/microsoft/fluentui-blazor into users/vnbaaij/dev-v5/appbar-part1
- Fix test verified files
- Refine show empy logic - Redo & add tests (replace verify with asserts)
- Fix fixed item detection in ts
…nbaaij/dev-v5/appbar-part1
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
…/dev-v5/add-presence-badge
|
✅ All tests passed successfully Details on your Workflow / Core Tests page. |
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 introduces the new FluentPresenceBadge component for displaying user presence status indicators (available, away, busy, etc.) and integrates it with the FluentAvatar component. It includes comprehensive test coverage, documentation, and localization support.
Changes:
- Added new
FluentPresenceBadgecomponent with support for various presence statuses and "Out of Office" states - Enhanced
FluentAvatarto acceptChildContentfor embedding badges - Added localization resources for presence status strings and new core icons for presence indicators
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 17 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Core/Enums/PresenceStatus.cs | New enum defining presence status values |
| src/Core/Components/Badge/FluentPresenceBadge.razor | Razor markup for the presence badge component |
| src/Core/Components/Badge/FluentPresenceBadge.razor.cs | Component logic including icon selection, color mapping, and parameter validation |
| src/Core/Components/Badge/FluentPresenceBadge.razor.css | Styling for presence badge appearance |
| src/Core/Components/Badge/FluentBadge.razor.cs | Made GetIconColor virtual to allow overriding in derived classes |
| src/Core/Components/Avatar/FluentAvatar.razor | Added ChildContent support and removed slot attribute from markup |
| src/Core/Components/Avatar/FluentAvatar.razor.cs | Added ChildContent parameter and fixed size calculation |
| src/Core/Components/Base/FluentSlot.cs | Added Badge slot constant and fixed DialogTitle formatting |
| src/Core/Components/Icons/CoreIcons.cs | Added presence-related icons (Available, Away, Blocked, Dnd, Offline, Oof, Tentative, Unknown, Busy) |
| src/Core/Localization/LanguageResource.resx | Added localization strings for all presence statuses |
| examples/Demo/FluentUI.Demo.Client/Documentation/Components/Badges/PresenceBadge/* | Documentation and examples for FluentPresenceBadge usage |
| examples/Demo/FluentUI.Demo.Client/Documentation/Components/Badges/BadgesOverview.md | Updated to include PresenceBadge component |
| examples/Demo/FluentUI.Demo.Client/Documentation/Components/AppBar/FluentAppBar.md | Minor documentation formatting update |
| tests/Core/Components/Badge/FluentPresenceBadgeTests.razor | Comprehensive test suite for the new component |
| tests/Core/Components/Avatar/FluentAvatarTests.FluentAvatar_Slot.verified.razor.html | Updated verified output reflecting removal of slot attribute |
| tests/Core/Components/List/FluentOptionTests.FluentOption_StartSlot.verified.razor.html | Updated verified output showing ChildContent rendering |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...mo/FluentUI.Demo.Client/Documentation/Components/Badges/PresenceBadge/FluentPresenceBadge.md
Outdated
Show resolved
Hide resolved
...mo/FluentUI.Demo.Client/Documentation/Components/Badges/PresenceBadge/FluentPresenceBadge.md
Outdated
Show resolved
Hide resolved
Summary - Unit Tests Code CoverageSummary
CoverageMicrosoft.FluentUI.AspNetCore.Components - 98.8%
|
|
@vnbaaij not sure but isn't the Avatar component supposed to display the initials as well? |
|
And what does it say just below the sample 😉 |
|
forget it. Was hard day today 🤣 |
tests/Core/Components/List/FluentOptionTests.FluentOption_StartSlot.verified.razor.html
Show resolved
Hide resolved
tests/Core/Components/Avatar/FluentAvatarTests.FluentAvatar_Icon_WithSize.verified.razor.html
Show resolved
Hide resolved
tests/Core/Components/Avatar/FluentAvatarTests.FluentAvatar_Slot.verified.razor.html
Show resolved
Hide resolved
- Inherit from FluentComponentBase. - Fix Avatar display initials issue


Adds
This pull request introduces the new
FluentPresenceBadgecomponent, a specialized badge for displaying user presence status (such as available, away, busy, etc.), and integrates it into the documentation and demo. It also makes supporting changes to theFluentAvatarcomponent to allow presence badges to be rendered as children. Additionally, the documentation for badges is updated to reflect the new component and usage.Presence Badge Component Addition:
FluentPresenceBadgecomponent, which extendsFluentBadgeto visually represent presence statuses with appropriate icons, colors, and accessibility labels. It supports various sizes and an "Out of Office" state, and restricts unsupported parameters to maintain consistency. (src/Core/Components/Badge/FluentPresenceBadge.razor[1]src/Core/Components/Badge/FluentPresenceBadge.razor.cs[2]FluentPresenceBadge, including example usages, API details, and localization support for status strings. (examples/Demo/FluentUI.Demo.Client/Documentation/Components/Badges/PresenceBadge/FluentPresenceBadge.mdexamples/Demo/FluentUI.Demo.Client/Documentation/Components/Badges/PresenceBadge/FluentPresenceBadge.mdR1-R77)Demo and Documentation Updates:
FluentPresenceBadge, demonstrating default usage, different sizes, all status types, "Out of Office" states, and integration withFluentAvatar. (examples/Demo/FluentUI.Demo.Client/Documentation/Components/Badges/PresenceBadge/Examples/PresenceBadgeDefault.razor[1]PresenceBadgeOnAvatar.razor[2]PresenceBadgeOnAvatarOOO.razor[3]PresenceBadgeSize.razor[4]PresenceBadgeStatus.razor[5]PresenceBadgeStatusOOO.razor[6]PresenceBadgeas an implemented component and added a link to its documentation page. (BadgesOverview.md[1] [2]Avatar Component Enhancements:
FluentAvatarto acceptChildContent, enabling badges (likeFluentPresenceBadge) to be rendered inside avatars for richer user profile displays. (src/Core/Components/Avatar/FluentAvatar.razor[1]src/Core/Components/Avatar/FluentAvatar.razor.cs[2]src/Core/Components/Avatar/FluentAvatar.razor.cssrc/Core/Components/Avatar/FluentAvatar.razor.csL141-R147)General Improvements:
BadgesOverview.md[1]FluentAppBar.md[2]src/Core/Components/Badge/FluentBadge.razor.cssrc/Core/Components/Badge/FluentBadge.razor.csL137-R137)