Open a user's profile popout with their banner #219
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat-user-profile"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Stacked on: #214 (
feat-entity-images). Merge that first; this branch starts from it.Before this PR, clicking a user did nothing. The client had no profile popout at all, so a user's banner could not be seen.
What opens it
A left click opens the popout, as
PreloadableUserPopout.tsx:241-269does, on:MemberListItem.tsx:265-278);MessageAvatar.tsx:57-68,MessageUsername.tsx:84-98);VoiceParticipantItem.tsx:332-344). A right click there still opens the participant menu.The DM list does not open it, and neither does the original (
DMListItem.tsx: a click navigates).Placement follows
PopoverPopouts.tsx:170anduseAntiShiftFloating.ts:305-311:right-start, 8 px from the target;left-startwhen it does not fit, which is what happens for the member list;max(6, adaptive padding).The target's bounds are reported in window coordinates, also from inside the scrolled lists (
widgets::popout::trigger).It closes on a click outside it, a click on the same target again, Escape, Message and Edit profile.
Request and response
GET /users/{id}/profile?guild_id=…&with_mutual_friends=true&with_mutual_guilds=true.guild_idis sent only in a guild, and the mutual flags are always sent, asUserProfileCommands.tsx:37-43does.The model is
UserProfileResponse, built as the fork'sgetUserProfilebuilds it (UserAccountRequestService.ts:343-433,UserMappers.ts:215-284):user;user_profile {bio, pronouns, banner, banner_color, accent_color};guild_member?andguild_member_profile? {bio, pronouns, banner, accent_color};profile_badges,operator_pass_since,hidden_profile_badge_count?;mutual_friends?,mutual_guilds?,connected_accounts?;timezone_offset,profile_limited?.Everything except
useris read leniently. It is under the OpenAPI contract test (UserProfileFullResponse,ProfileBadgeResponse). The fixtures are synthetic.Caching follows
UserProfile.ts:Message opens the existing DM, or calls
POST /users/@me/channels {recipient_id}and opens the new channel (PrivateChannelCommands.ts:83-106).What the popout shows
Card: 305 px wide (300 px content plus a 2.5 px accent border), 6 px radius,
--background-primary.BANNER_UNSET.banners/{user}/{hash}.webp?size=600, member bannersguilds/{g}/users/{u}/banners/{hash}.webp?size=600.a_) banners play while "Automatically play GIFs" is on, otherwise on hover.accent_color, otherwiseavatar_color, otherwise the default avatar's colour, otherwise#4641D9(AccentColorUtils.ts:17-37).banner_coloris not used, as in the original.username#discriminator. The discriminator is hidden only on instances with unique usernames (UserTagUtils.ts, read from the discovery document'sfeatures). Pronouns below.RESTRICTED_USER_BIOflags, 14 px with 1.5 line height, at most 3 lines.Mar 4, 2024.RoleManagement.module.css.While nothing is cached, a skeleton is shown instead.
Left out (follow-ups)
No dead buttons: only Message and Edit profile are shown, and both work.
Refs #212. This PR adds user and member banners and the
avatar_coloraccent. #212 stays open for the guild splash and the voice tileavatar_colorbackground.Devserver
GET /users/{id}/profileservesfixtures/rest/user_profile*.jsonwith the server's rules: the member and member profile only for a guild the user is in, mutuals only when asked for and never on your own profile,404 UNKNOWN_USERotherwise.POST /users/@me/channelsreturns the existing DM, or creates one and sendsCHANNEL_CREATE.Tests
tests/profiles.rs): open/toggle, fetch once, 60 s cache, failure state, invalidation, overrides, accent colour priority, tags, dates, roles, Message with an existing DM and with a new one, Edit profile.apps/fluxer/tests/profile.rs): open → the runtime's request → the popout view model with the member banner → the realImageCacheloads it from the devserver → Message creates and selects the DM.Goldens
Two goldens were added; the existing ones are unchanged:
profile_popout_member.png: ada from the member list row, flipped left, with her member banner, bio, pronouns and both dates.profile_popout_no_banner.png: relay from a message author, with the accent-colour banner and the BOT tag.Rendered on lavapipe in the local
fluxer-native-shots:u2204image (Ubuntu 22.04). The host has no software Vulkan, so the host's 1.98.1 toolchain and cargo registry were mounted read-only into the container, withWGPU_BACKEND=vulkanandVK_ICD_FILENAMES=/usr/share/vulkan/icd.d/lvp_icd.x86_64.json:cargo test -p fluxer-ui --test screenshots -- --ignored(UPDATE_GOLDEN=1for the two new goldens);cargo xtask cipasses on the host; the screenshot step is not run there.Check first on the real server
banners/{user}/…and member overrides atguilds/{g}/users/{u}/banners/…. Check that animated ones play when GIF autoplay is on.#discriminator: this depends on the instance'sfeatures.tag_style/account_identity.🤖 Generated with Claude Code
Clicking a user did nothing: there was no profile popout. Now a left click on a member list row, a message author's avatar or name, or a voice participant row opens the web app's profile card beside it. - fluxer-proto: UserProfileResponse (GET /users/{id}/profile, shaped as the fork's getUserProfile builds it, lenient everywhere but `user`), UserProfileQuery, CreateDmRequest; WellKnown::features with uses_unique_usernames(). Fixtures user_profile*.json. - fluxer-api: user_profile(), create_dm(). - fluxer-core: Profiles (open popout with its anchor, fetch with guild_id and the mutual flags, 60 s cache, forgotten on READY and guild/member changes), MessageUser (existing DM or POST /users/@me/channels), user and member banner URLs, and the selectors::profile view model (overrides, BANNER_UNSET/AVATAR_UNSET, accent colour priority, tag, dates, roles, footer action). - fluxer-ui: widgets::popout (trigger with window bounds inside scrolled lists; right-start placement with flip and shift as Floating UI does), screens::main::profile_popout (305 px card, banner with the GIF rule, always-animated 80 px avatar, names, pronouns, bio with the bio Markdown flags, member since, role pills, Message/Edit profile, skeleton and failure warning), Escape and click-outside to close. - fluxer-devserver: the profile endpoint and DM creation; member banner pictures. - apps/fluxer: run the two requests; end-to-end test. - Goldens profile_popout_member and profile_popout_no_banner (lavapipe, Ubuntu 22.04). Refs #212 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>