-
Notifications
You must be signed in to change notification settings - Fork 166
[terra-avatar] Allow Fallback to Initials Display #2559
Comments
This may be a blocker to our consuming Terra Avatar in Connect. |
That makes sense to me, but this needs UX input. UX requirements specify that if the photo fails to load, a generic icon is used. If a photo is not provided, initials are used. |
(edit: removed incorrect statements, the fallback is working correctly per the original requirements: .
The option to fallback to initials should be including the prop or not (edit: if requirements are updated)
If you could better explain what you meant by that, since a single User Avatar should only receive one image. And the Facility avatar only has the fallback to the icon, no initials. Do you mean if multiple avatars on a given view all are failing to load (broken service, etc.) that they collectively have a fallback? Or please better explain, Thanks. |
@neilpfeiffer - I meant that if multiple avatars in the same view fail to load, that they all show the same generic icon instead of the User's initials when that data is available. |
Thanks @RLRickard, that's what I assumed you meant, how a field/list of avatars with failures could appear all similar even with the individual colors. Special Implementation note for others implementing Avatar: unless your design team has given you special instructions to have the avatars all have the same color or specific color, it is recommended that the full person's name be provided as the |
Blocking -- awaiting final OCS direction to change the API for the fallback from Image > Initials (> Icon) and then changing the Shared User to a Generic with variants. |
Please escalate the design on this issue. CareAware Connect needs this completed in order to be able to consume Terra-avatar which is required as part of our OCS project. |
Design Update: After some discussion, here is how we need to move forward with avatar: Code Updates: [terra-avatar] src/common/Avatar.module.scss
[terra-avatar] src/variants/Avatar.jsx
Theme Updates: Provider icon will need to be verified in all themes
|
Just Curious to know about design before Implementation. |
We should try to group the release of this with #2026 |
That works for me. Go ahead and ignore the required suggestion. |
@neilpfeiffer and I were discussing, and the initials do need to be required because we're moving the icons into the generic variant of this component. So, the standard avatar is either initials or an overlay image. There is no icon fallback. So, this raises a new question: What should the standard variant do when sending the initials fails? Of course, if there's a complete failure of the service to send data, that's just not going to render anything, but what if the initials are malformed (e.g. > 2 initials)? Does the avatar render as a blank color circle? Or does it not render? The designer in me says that the blank circle at least keeps consistency with any other avatars in a list, but not rendering it would at least make it obvious that something went wrong. Is there a precedent with other components that would guide this decision? |
or when Initials are > 2 can we reduce it 2 by default and render the initials with reduced initials instead of rendering blank circle or adding datatype validation for initials to render nothing on invalid input. |
We just discussed this in leadership sync. Let's check the string and trim to a length of 2. Also, add |
Feature Request
Description
Currently, the image fallback logic of the avatar displays a generic icon. However, this fallback does not differentiate between different 'Avatars' if multiple images fail to load.
If the image fails to load and initials are provided - the avatar should fallback to the initials display instead (or at least be optional).
The text was updated successfully, but these errors were encountered: