Skip to content

Show users by display name in UserPopOverCard by default - #37127

Merged
shah-harshit merged 6 commits into
mainfrom
fix/user-popover-display-name
Nov 17, 2026
Merged

shah-harshit merged 6 commits into
mainfrom
fix/user-popover-display-name

Conversation

@harsh-vador

@harsh-vador harsh-vador commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes #37116

Part of open-metadata/openmetadata-collate#6243 (consistent user display name & hover card). This is the last open piece of that epic: #37773 and Collate #8548 (plus their 2.1 backports #37835 and #8582) moved the plain-text sites onto UserPopOverCard, and this PR makes the card show the display name.

UserPopOverCard rendered displayName ?? userName, and displayName is an optional prop. Every caller that passed only the login showed the raw username (jane.doe) instead of the display name (Jane Doe). Many callers only have a login string (announcement createdBy, document and version updatedBy, app run triggeredBy, bot updatedBy, SCIM createdBy, Data Insight aggregations), so fixing them one by one could not work.

The card now resolves the label itself:

  • Order: a non-empty displayName prop, then the user's display name, then userName.
  • Empty displayName: it falls through (||, not ??). Several callers pass ref.displayName straight through, and an empty string used to render a blank label.
  • How the user is resolved: the card calls useUserProfile when it shows a name (showUserName, no children, not a team). That hook shares the store and in-flight cache with ProfilePicture, so a card that also shows the avatar makes no extra request. A card that hides the avatar (showUserProfile={false}, e.g. DescriptionSourceBadge's "accepted by") resolves too, which reading only the avatar's store entry could not do.
  • Teams: a team card with no displayName shows the team's display name, read through useEntityPopoverData (the hover card's own team query, so hovering reuses it).
  • Avatar-only cards: no lookup.

Also fixed: DescriptionSourceBadge passed the login as displayName (which pinned the login) and '-' as a user name. Both are removed.

User tables are now Name + Email. The Users, Online users, Team users and Persona users tables (commonUserDetailColumns), and the Members › Users, Online users and Team-detail panels, used to show the login in "Username" and the display name in "Name". They now show:

  • Name: the user through UserPopOverCard (display name, falling back to the login).
  • Email: the unique identifier, since display names are not unique (e.g. several "Zed Sort Author" users in the screenshot). It renders getUserIdentifier (UsersPureUtils): the email, or the login when the email is missing or PII-masked for the viewer, so the column stays unique.

This removes the displayName={login} overrides the Username columns needed. Playwright: OnlineUsers and ProfileOnlineUser check the Name and Email headers, PersonaFlow expects the display name, and ProfileTeam finds the member by its login data-testid. getRowByName(login) still matches because the email contains the login.

To stay within the complexity limit and the folder conventions: getUserPopoverPath is in UserPopOverCard.utils.ts, useUserLabel is in src/hooks/user-profile/, and UserPopoverBody / TeamName are small components in UserPopOverCard.tsx.

Taken over from @harsh-vador to close the epic. The original commit is kept; the follow-up commit addresses the review comment (||) and the avatar-less case.

Type of change:

  • Bug fix

High-level design:

N/A — small change.

Tests:

Use cases covered

  • No displayName passed, user loaded → display name shown.
  • displayName prop passed → prop wins. Empty displayName → resolved name.
  • No avatar shown → the card still fetches and shows the display name.
  • Avatar-only card (showUserName false) → no fetch.
  • User has no display name, was deleted (404 placeholder) or isn't loaded yet → login shown.
  • Team → team display name (via the team popover query); no user lookup. Children passed → children rendered.
  • User tables show Name (display name) and Email; no login-only column.

Unit tests

  • Added/updated: useUserLabel.test.ts (new: real store and useUserProfile, only getUserByName mocked; checks the label after the response, one shared request with the avatar lookup, 404 fallback and empty displayName), UserPopOverCard.test.tsx (10 new cases), DescriptionSourceBadge.test.tsx, Users.util.test.tsx, MembersUsersPanel.test.tsx (store mock now provides getState, which useUserProfile reads).
  • Jest across all 28 folders that render UserPopOverCard: 469 suites, 7,759 tests passed.
  • yarn ui-checkstyle:changed clean (no errors, no diff). tsc: no errors in the changed files.

Backend integration tests

  • Not applicable (no backend API changes).

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • Not run locally. Pending (merge queue): Features/OnlineUsers.spec.ts, Pages/AIProfile/ProfileOnlineUser.spec.ts, Pages/AIProfile/ProfileTeam.spec.ts, Pages/AIProfile/ProfileMembers.spec.ts, Features/ContextCenterPermission.spec.ts (its document-updated-by check on main expects the display name and passes only with this PR), Features/Announcements/*, Features/PersonaAIContext.spec.ts, Pages/ProfileTeam.spec.ts, Flow/PersonaFlow.spec.ts.

Manual testing performed

Collate UI dev server (Collate main cade90b7a4 with OSS = this branch merged with main) against a local Collate server, logged in as admin. A user jane.doe with display name "Jane Doe" created an announcement, a Context Center document, a persona AI context version, a notification template and a Recognizer exception. Before = the server's own UI build (predates the epic); after = this branch.

Screenshots

Surface Before After
Announcements settings table: author announcements-table-before announcements-table-after
Context Center documents: updated by documents-before documents-after
Documents: hover card — documents-hover-after
Persona AI context version history persona-versions-before persona-versions-after
Collate notification templates: last edited by templates-before templates-after
Members › Users: Username + Name → Name + Email members-users-before members-users-after
Members › Online users: Username + Name → Name + Email online-users-before online-users-after
Members › Team detail users team-users-before team-users-after
Description "Accepted by" (DescriptionSourceBadge, avatar hidden) accepted-by-before accepted-by-after
Collate Recognizer exceptions: added by (2nd row has no author) recognizer-exceptions-before recognizer-exceptions-after

UI screen recording:

Not applicable: bug fix to an existing component, not a new UI feature.

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR is linked to a GitHub issue via Fixes #<issue-number> above.
  • I have added tests and listed them above.
  • Self-review: e39c29b reviewed against REVIEW.md. Fixed the complexity error and the '-' user in DescriptionSourceBadge. No 🔴 open.
  • Decision check: no durable decision; not applicable.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

No new blocking issue was found in the reviewed changes.

Summary

UserPopOverCard now resolves display names for user and team labels. User tables show Name and Email, with the login used when email is missing or masked.

  • User cards now resolve display names from the profile.
  • User lists now pair display names with an email or login.

Reviews (9) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile

UserPopOverCard rendered `displayName ?? userName`, so every caller that
passed only the login showed the raw username. The card now falls back to
the display name of the user ProfilePicture already loads into the
application store, then to the login. No new requests; teams unchanged.

The two "Username" columns (userCellRenderer, UserNameCell) pass the login
explicitly so they keep showing it next to the "Name" column.

Fixes #37116
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

shah-harshit added a commit that referenced this pull request Nov 16, 2026
…s 2.1

UserPopOverCard on 2.1 renders displayName ?? userName and the row only
passes the login, so the display-name assertion would fail on the
release branch.
shah-harshit added a commit that referenced this pull request Nov 16, 2026
…t 2.1 #37773) (#37835)

* Show users with a hover card where they render as plain text (#37773)

* Show users with a hover card where they render as plain text

Announcements (feed card, settings table), Context Center documents and
persona version history now render the user through UserPopOverCard, so
they get the shared hover card and the display name it resolves. The
owner feed chip and the read-only memory banner fall back to the login
when an owner has no display name instead of rendering blank or the raw
login. Clicking the user in a document row no longer opens the preview.

* Let UserPopOverCard resolve display names for owners and feedback authors

CreateMemoryModal, KnowledgeCard and FeedbackApprovalTask passed
getEntityName(ref) as displayName. getEntityName falls back to the login,
so the prop always won and UserPopOverCard never looked up the display
name for a reference without one. Pass the reference's own displayName
instead. FeedbackApprovalTask also no longer renders a '-' user (and a
lookup for it) when createdBy has no name.

Also shortens an over-long eslint-disable comment in DocumentsView.test.

(cherry picked from commit a9852c3)

* Assert the login in the document updated-by check until #37127 reaches 2.1

UserPopOverCard on 2.1 renders displayName ?? userName and the row only
passes the login, so the display-name assertion would fail on the
release branch.

* Fall back to the login when an owner or submitter display name is empty

2.1's UserPopOverCard renders displayName ?? userName, so an empty
displayName left the name blank. Pass undefined instead in KnowledgeCard,
the memory owner chip and FeedbackApprovalTask. The KnowledgeCard owner
chip moves into its own component to stay within the complexity limit.
…atar

- An empty displayName falls back to the resolved name instead of rendering blank.
- The card fetches the user through useUserProfile when it shows a name, so call sites
  that hide the avatar (DescriptionSourceBadge) resolve too; the avatar shares the cache.
- DescriptionSourceBadge no longer passes the login as displayName or '-' as a user.
- Split the popover body and link path out to keep the card under the complexity limit.
@shah-harshit shah-harshit added the safe to test Add this label to run secure Github workflows on PRs label Nov 17, 2026
@shah-harshit shah-harshit self-assigned this Nov 17, 2026
@shah-harshit shah-harshit changed the title Fixes #37116: show users by display name in UserPopOverCard by default Show users by display name in UserPopOverCard by default Nov 17, 2026
@shah-harshit
shah-harshit marked this pull request as ready for review November 17, 2026 05:58
@shah-harshit
shah-harshit requested a review from a team as a code owner November 17, 2026 05:58
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

@shah-harshit shah-harshit added the skip-pr-checks Bypass PR metadata validation check label Nov 17, 2026
…t the real lookup

- getUserPopoverPath moves to UserPopOverCard.utils.ts and useUserLabel to
  src/hooks/user-profile/, per the folder conventions.
- A team card with no displayName shows the team's display name, read through
  the popover's own team query so hovering reuses it.
- useUserLabel.test uses the real store and useUserProfile with only
  getUserByName mocked: it checks the label after the response, the shared
  single request with the avatar lookup, the 404 fallback and empty displayName.
- Explain at the two Username-column call sites why they pass the login.
@shah-harshit
shah-harshit enabled auto-merge (squash) November 17, 2026 06:27
The user tables (Users, Online users, Team users, Persona users and the
Members panels) showed the login in a Username column and the display name
in a Name column. They now show one Name column through UserPopOverCard
(display name, falling back to the login) and an Email column, which keeps
a unique identifier visible when two users share a display name. This also
removes the displayName={login} overrides the Username columns needed.
@greptile-apps

greptile-apps Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Comments Outside Diff

These findings could not be posted inline.

  • P2 Deleted users lose display names openmetadata-ui/src/main/resources/ui/src/utils/Users.util.tsx:39 ▶

    The tables now discard the row's known displayName. With “Show deleted” enabled and no cached profile, useUserProfile requests the user without include=deleted, gets a 404, and caches a login-only placeholder. The separate name column is also gone, so these rows permanently show logins instead of the display names returned by the list.

    Pass displayName={user.displayName} here and displayName={record.displayName} in UserNameCell, keeping the lookup as a fallback.

… card

- The Email columns (Users, Online users, Team users, Persona users and the
  Members panels) render getUserIdentifier: the email, or the login when the
  email is missing or PII-masked, so the column stays a unique identifier for
  non-admin viewers instead of repeating the mask on every row.
- The userCellRenderer test renders the real UserPopOverCard with only
  getUserByName mocked and asserts the name shown.
…lay-name

# Conflicts:
#	openmetadata-ui/src/main/resources/ui/src/components/common/PopOverCard/UserPopOverCard.test.tsx
#	openmetadata-ui/src/main/resources/ui/src/components/common/PopOverCard/UserPopOverCard.tsx
@gitar-bot

gitar-bot Bot commented Nov 17, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 🟡 Medium risk 1 closed / 1 findings

Resolving display names in user cards and replacing Username with Name/Email changes user-facing identification; lookup errors could show a misleading fallback label.

Makes UserPopOverCard resolve and show the user's display name (or team display name) when no displayName prop is passed, including when the avatar is hidden, and switches user tables to Name and Email columns. Resolved this session: the Email column now shows the login when the email is PII-masked instead of rendering the mask placeholder. No issues found.

✅ 1 closed
✅ Bug: Email column renders the PII-mask placeholder instead of hiding it

📄 openmetadata-ui/src/main/resources/ui/src/utils/Users.util.tsx:81-85 📄 openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/Profile/tabs/members/MembersUsersPanel.tsx:316-322 📄 openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/Profile/tabs/members/MembersOnlineUsersPanel.tsx:219-226 📄 openmetadata-ui/src/main/resources/ui/src/components/discovery/personal-space/Profile/tabs/members/MembersTeamDetail.utils.tsx:229-238
These new Email columns render record.email directly. When PII masking applies (non-admin viewers), the API returns MASKED_EMAIL, so every row shows the mask string. The repo already has getVisibleEmail in UsersPureUtils.ts to cover this case, and other user surfaces such as ProfileDetailsPanel and MembersUserDetailBanners call it. This commit also removed the login column, so for these viewers the column that the PR says carries the unique identifier shows the same mask on every row. Users who share a display name then can't be told apart. Use getVisibleEmail(record.email) with a placeholder, and when the email is hidden, consider falling back to record.name so the column still shows a unique value.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@shah-harshit
shah-harshit merged commit eee3777 into main Nov 17, 2026
53 of 54 checks passed
@shah-harshit
shah-harshit deleted the fix/user-popover-display-name branch November 17, 2026 10:53
harsh-vador added a commit that referenced this pull request Nov 18, 2026
…splay name (#38074)

#37127 moved the login out of the users table's Name column, so the row
name no longer contains the firstName-dot the locator relied on and the
remove click hung until the test timeout.
shah-harshit added a commit that referenced this pull request Nov 18, 2026
* test(playwright): refresh stale 2.1 visual baselines and fix shell menu scenes

Refresh 32 baselines from the 2.1 nightly (run 44266671648) actuals. Every
diff traces to an intended change that arrived with the main merge: Tableau
connected-app auth option (#37084), 400px entity summary panel (#37888),
unified CopyButton (#37953), new Insights/AdvancedSearch icons (#37973),
Data Estate connector counts (#37910) and the users Name/Email columns
(#37127, #37998).

shell-profile-menu and shell-mode-menu waited for my-data-page, which
#38077 removed from /my-data in AI mode; wait for home-landing-page.

* test(playwright): complete 2.1 shell and expanded Tableau baselines
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs skip-pr-checks Bypass PR metadata validation check UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UserPopOverCard: resolve the user's display name itself instead of relying on callers

4 participants