feat: stateless federated identity resolver + federation UX improvements

Add identity.ts with isSelf() and resolveDisplayIdentity() — pure
stateless functions that detect replicated-self using the immutable
(username, homeInstance) composite key. No store lookups, no data
mutation. Fixes wrong avatar gradient and missing edit/delete on
own messages in remote channels.

Also includes: optimistic message dedup fix for cross-instance
messages (content-only matching), federation toast notifications,
Username component with @domain display, invite parser, and
deploy script simplification.
This commit is contained in:
Jannis Braun
2026-03-04 03:37:49 +01:00
parent 64fd8edfc9
commit dca9c4dc83
19 changed files with 713 additions and 110 deletions
@@ -0,0 +1,25 @@
import React from 'react';
import { Tooltip } from './Tooltip';
interface UsernameProps {
username: string;
className?: string;
style?: React.CSSProperties;
}
export function Username({ username, className, style }: UsernameProps) {
const atIndex = username.indexOf('@');
if (atIndex === -1) {
return <span className={className} style={style}>{username}</span>;
}
const name = username.slice(0, atIndex);
const domain = username.slice(atIndex + 1);
return (
<Tooltip content={username} position="top">
<span className={className} style={style}>
{name}
<span className="text-txt-tertiary text-[0.8em] ml-0.5 font-normal">@{domain}</span>
</span>
</Tooltip>
);
}