fix: resolve federated avatar color to home instance identity

Federated users get a different snowflake ID on remote instances,
causing avatar gradients to mismatch their home identity. Apply
resolveDisplayIdentity/isSelf resolution in VoiceUser, StreamTile,
VoiceChannel sidebar, and MemberSidebar so the current user's avatar
color is consistent across all views.
This commit is contained in:
Jannis Braun
2026-03-04 04:27:35 +01:00
parent 2d6cdd0a3c
commit 9432f81ba3
4 changed files with 17 additions and 4 deletions
@@ -2,6 +2,8 @@ import React, { useMemo } from 'react';
import type { MemberWithUser } from '@backspace/shared';
import { useServerStore } from '../../stores/serverStore';
import { useUIStore } from '../../stores/uiStore';
import { useAuthStore } from '../../stores/authStore';
import { resolveDisplayIdentity } from '../../utils/identity';
import { Avatar } from '../ui/Avatar';
import { Username } from '../ui/Username';
@@ -46,6 +48,7 @@ export function MemberSidebar() {
const currentServerId = useServerStore((s) => s.currentServerId);
const memberListOpen = useUIStore((s) => s.memberListOpen);
const openUserProfile = useUIStore((s) => s.openUserProfile);
const authUser = useAuthStore((s) => s.user);
const server = servers.find(s => s.id === currentServerId);
const ownerId = server?.ownerId;
@@ -97,6 +100,7 @@ export function MemberSidebar() {
const renderMember = (member: MemberWithUser, isOffline = false) => {
const displayName = member.user.displayName ?? member.user.username;
const colorStyle = isOffline ? undefined : getMemberColor(member);
const resolvedUser = resolveDisplayIdentity(member.user, authUser ?? null);
return (
<div
key={member.userId}
@@ -110,6 +114,7 @@ export function MemberSidebar() {
status={isOffline ? 'offline' : member.user.status}
className={isOffline ? 'opacity-60' : undefined}
user={member.user}
userId={resolvedUser.id}
/>
<div className="flex-1 min-w-0">
<Username