You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit edfd121
Browse filesBrowse the repository at this point in the historyBrowse files
feat(profile): ✨ add a profile preview card for usernames and avatars
Hovering or focusing a linked username or avatar opens a card with the
member's cover fading into the card, avatar with an online dot, name,
handle and primary role, Reputation / Joined / Last visited stats and a
View profile button. Moderators also see the member's warning summary with
a link to the ModCP. The card only receives the nameCode and loads the
public profile when it opens (shared cache with the profile page), with a
skeleton while loading and an empty state for missing or failed profiles.
On touch screens a tap opens the same content in a swipeable bottom
drawer. The drawer's built-in handle row can now be turned off, and the
new `DrawerIndent` scales the page behind an open bottom drawer.
All copy lives under `core.profile.preview` keys, and the user format docs
page documents the preview with screenshots.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`UserFormat` prints a member's name the way the rest of the site does. Use it
8
12
anywhere a name shows up: article bylines, tables, comments, notifications.
9
13
@@ -89,6 +93,57 @@ Leave `link` off when the name sits inside another link or a button, such as a
89
93
table row that already opens something. Nested links are invalid HTML and
90
94
confuse screen readers.
91
95
96
+
## Profile preview
97
+
98
+
A linked name opens a profile preview when someone rests the pointer on it or
99
+
tabs to it. The card shows the member's cover, avatar with an online dot, name,
100
+
`@nameCode` and primary role, then their reputation, how long ago they joined
101
+
and when they were last here, with a **View profile** button at the bottom.
102
+
103
+
<ImgDocsalt="A profile preview card under a linked username, with cover, avatar with an online dot, name, role, reputation, join time, last visit and a View profile button"src={previewCard} />
104
+
105
+
Phones and tablets have no hover, so there a tap opens the same preview as a
106
+
bottom sheet. Swipe it down to close it, or tap **View profile** to go on to
107
+
the profile.
108
+
109
+
<ImgDocsalt="The same profile preview as a bottom sheet on a phone, with a drag handle over the cover"src={previewSheet} />
110
+
111
+
Moderators also see the member's warnings in the preview: their active warning
112
+
points, how many warnings are active and in total, and a **Review** link to the
113
+
member's warnings in the ModCP. Everyone else never loads them.
114
+
115
+
You don't pass the preview any data. When it opens, it loads the member's
116
+
public profile from `GET /users/profile/{nameCode}` and shows a skeleton until
117
+
the answer arrives. The preview shares its cache with the profile page, so
118
+
opening it and then going to the profile renders the page right away. Nothing
119
+
is fetched for names nobody opens.
120
+
121
+
The preview is on by default for every `UserFormat` with `link`. Turn it off
122
+
with `preview={false}` when the name already sits inside another hover card:
0 commit comments