fix(federation): normalize federated username display across UI

Use parseFederatedUsername() consistently to show base username instead
of raw user@domain format. Replace inline domain text in Username
component with compact globe icon + tooltip. Add globe icons to DM
header and sidebar for federated users.
This commit is contained in:
Jannis Braun
2026-03-27 02:23:04 +01:00
parent 843a2ce727
commit a9d330f013
6 changed files with 60 additions and 31 deletions
@@ -6,7 +6,7 @@ import { useAuthStore } from '../../stores/authStore';
import { useSocialStore } from '../../stores/socialStore';
import { Avatar } from '../ui/Avatar';
import { hasPermissionBit, PermissionBits } from '../../utils/permissions';
import { isSelf } from '../../utils/identity';
import { isSelf, parseFederatedUsername } from '../../utils/identity';
import { useDelayedLoading } from '../../hooks/useDelayedLoading';
import type { MessageWithUser } from '@backspace/shared';
@@ -374,8 +374,9 @@ function WelcomeHeader({ channelId }: { channelId: string }) {
if (isDm) {
const dm = dmChannels.find(d => d.id === channelId);
const otherUser = dm?.members.find(m => !isSelf(m, authUser));
const displayName = otherUser?.displayName ?? otherUser?.username ?? 'Unknown';
const username = otherUser?.username ?? 'unknown';
const { baseName } = parseFederatedUsername(otherUser?.username ?? 'unknown');
const displayName = otherUser?.displayName ?? baseName;
const username = baseName;
const isFriend = otherUser ? friends.some(f => f.id === otherUser.id) : false;
return (