feat(ui5-avatar-badge): add accessibleName property for custom tooltip#13390
feat(ui5-avatar-badge): add accessibleName property for custom tooltip#13390plamenivanov91 merged 9 commits intomainfrom
Conversation
…p text The badge now supports a new accessibleName property to customize the tooltip text displayed on hover. When not provided, the badge uses a smart fallback: 1. User-provided accessibleName (highest priority) 2. Icon semantic name (e.g., "edit" -> "Edit") 3. i18n "Avatar" text from message bundle (lowest, ensures always defined) This gives developers full control over badge accessibility while maintaining sensible defaults for better user experience and accessibility. - Added public accessibleName property - Integrated i18n bundle support with @i18n decorator for fallback - Updated Icon mode from "Decorative" to "Image" to enable tooltip display - Added comprehensive Cypress tests for default, custom, and invalid icon cases - Updated documentation with accessibleName property explanation - Fixed React sample alignment by wrapping avatars in flex container - Updated HTML and React test pages with accessibility examples
|
🧹 Preview deployment cleaned up: https://pr-13390--ui5-webcomponents.netlify.app |
# Conflicts: # packages/main/src/AvatarBadge.ts
Code reviewFound 2 issues:
webcomponents/packages/main/src/AvatarBadge.ts Lines 130 to 135 in d252cb0
webcomponents/packages/main/src/AvatarBadge.ts Lines 130 to 135 in d252cb0 |
kgogov
left a comment
There was a problem hiding this comment.
A couple of things to address before this is ready to merge — see the comments above.
Use icon accessibility metadata before deriving a label from the icon name. Remove the unreachable Avatar tooltip fallback branch and the unused static i18n bundle wiring.
|
One more thing — the fix commit introduced a subtle gap.
@customElement({
tag: "ui5-icon",
languageAware: true, // Re-render on language change
...
})One line, same decorator, same fix. webcomponents/packages/main/src/AvatarBadge.ts Lines 47 to 53 in 96725e5 |
kgogov
left a comment
There was a problem hiding this comment.
All raised concerns have been addressed — the unreachable fallback branch, the missing accData check, and languageAware: true. The PR looks good.

The badge now supports a new accessibleName property to customize the
tooltip text displayed on hover. When not provided, the badge uses a
fallback strategy:
User-provided accessibleName (highest priority)
Icon accessibility metadata when available
Derived icon name (lowest priority)
This gives developers full control over badge accessibility while
preserving sensible defaults for icons with and without semantic labels.
Added public accessibleName property
Resolved icon accessible names from registered icon accessibility metadata
Updated Icon mode from "Decorative" to "Image" to enable tooltip display
Added Cypress coverage for custom, derived, and invalid icon cases
Updated documentation for accessibleName behavior
Fixed React sample alignment by wrapping avatars in a flex container
Updated HTML and React test pages with accessibility examples