Avatar initial displays [ when name starts with brackets + Inconsistent avatar color for the same user
Affected module Does it impact the UI, backend or Ingestion Framework?
Describe the bug We’re noticing a couple of UI inconsistencies with avatar rendering for entity owners:
1- Avatar initial displays [ when name starts with brackets: If a user’s display name starts with something like [Role] Firstname Lastname, the circular avatar shows [ as the initial. Clicking on the avatar displays the full name correctly, so it looks like the initial is pulled from the raw first character. → Expected: skip special characters and use the first actual letter of the name 2- Inconsistent avatar color for the same user: In the attached screenshot, I appear in the activity feed with a specific avatar color (e.g. purple), but in the owner section of the same asset, my avatar shows a different color. → This makes it feel like two different users, even though it's the same one. → Expected: avatar color should remain consistent for a given user across all sections
To Reproduce
Screenshots or steps to reproduce
Expected behavior
A clear and concise description of what you expected to happen.
Version:
- OS: [e.g. iOS]
- Python version:
- OpenMetadata version: 1.8.7
- OpenMetadata Ingestion package version: 1.8.7.0
Additional context Add any other context about the problem here.
Hey @chirag-madlani, do you have any insights on these UI bugs?
I can take this
I can take this
@dhruvjsx I am picking this. Let me know if you have worked on it earlier
For the part where special character is appearing in avatar initial.
- For the name suppose [Software Engineer] John Doe. The first initial I am keeping as
Sand notJas the first resolution. - Getting
Jwill be tricky because here we have both opening and closing bracket so we can getJbut in cases where someone has added as just[Software Enginner John Doe, then there is no closing bracket.
@ugouhar Can we ignore spacial chars and try to grab the AlphaNumeric value from the string? if not fallback to first char by default
@chirag-madlani, I am doing the same as you mentioned. Just to clarify, so for [Software Engineer] John Doe what should be the initial in avatar ? S or J ?
Let's just pick the first char S @aimendenche-nw Can you help me with use case for putting role in name? We have the role property, which can be used, no?
If a user’s display name starts with something like [Role] Firstname Lastname, the circular avatar shows [ as the initial. Clicking on the avatar displays the full name correctly, so it looks like the initial is pulled from the raw first character.
Name field should represent name only, to avoid any issues. @ugouhar we need to also check on different color issues
@chirag-madlani sure, yes I will be fixing color issue in the next PR
@chirag-madlani @ugouhar Exactly, yes! For example, in a company with external people, their Outlook names are often formatted like “[Partner] John Doe”. Since we use Azure as SSO, OpenMetadata automatically captures “[Partner]” as part of the name. However, in omd (as you saw in the owners), it either doesn’t capture the first name correctly or it only takes the “[...]”.
Ok then issue mostly on the side of how we are rendering firstName here from Azure. Have you seen this with any other SSO or just the Azure
@chirag-madlani We only use Azure SSO so for others i don't really know how it works!
Ok, will check on that one. And for Azure, it's for external only right
@chirag-madlani the internals don’t have brackets, they all appear as first name last name. It’s only the externals that have brackets.