-
Notifications
You must be signed in to change notification settings - Fork 279
feat(ui5-avatar-badge): add new AvatarBadge component #12938
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
kgogov
wants to merge
7
commits into
main
Choose a base branch
from
feat-avatar-badge
base: main
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.
+783
−213
Conversation
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
Collaborator
|
🚀 Deployed on https://pr-12938--ui5-webcomponents-preview.netlify.app |
nnaydenow
reviewed
Jan 20, 2026
nnaydenow
reviewed
Jan 20, 2026
10de6f2 to
5a17c0b
Compare
f98089e to
28a0e03
Compare
Add `ui5-avatar-badge` component for visual affordance on avatars. The badge displays icons with different value states to indicate status or notifications. Key features: - Five value states (None, Positive, Critical, Negative, Information) - RTL support with CSS logical properties - Works in badge slot of `ui5-avatar` Updated Avatar component to reference `ui5-avatar-badge` in badge slot documentation. Documentation structured following Button/ButtonBadge pattern with dedicated AvatarBadge page marked as new component. Fixes internal issue with avatar badge implementation. Jira: BGSOFUIPIRIN-6975 Fixes #12396
- Move default styles to :host selector - Remove redundant @SInCE tags from properties - Remove CSS header comment - Move icon styles to end of file for better organization
- Migrate disabled interaction test from ui5-tag to ui5-avatar-badge - Fix typo in test ID (diabled -> disabled) - Add comprehensive badge tests: - Badge rendering with icons - All five value states - Badge size for each avatar size (XS, S, M, L, XL) - Badge icon size for each avatar size - Add required icon imports (accept, message-error, information, ai)
Badge now validates icon on render and hides itself when icon is empty or not found in the icon registry.
Add test to verify AvatarBadge correctly hides itself when provided
with empty, missing, or non-existent icon names, and shows when valid.
Test covers:
- Empty icon string ("")
- Non-existent icon name ("non-existent-icon-xyz")
- No icon property set
- Valid icon ("accept") as reference
Uses direct DOM manipulation (document.createElement) instead of
cy.mount() because the Cypress UI5 plugin validates that mounted
components have shadow DOM content. Invalid badges intentionally
render empty shadow DOM (by design), which causes the plugin's
validation to fail. Direct DOM manipulation bypasses this limitation
while still allowing us to test the component behavior correctly.
Elements are cleaned up after test to prevent DOM pollution.
28a0e03 to
8854891
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Overview
Add
ui5-avatar-badgecomponent for visual affordance on avatars.The badge displays icons with different value states to indicate status or notifications.
Features
None(default),Positive,Critical,Negative,Information@ui5/webcomponents-iconsbadgeslot ofui5-avatarChanges
Usage
Related Issues
Jira: BGSOFUIPIRIN-6975
Fixes #12396