UI: Identity component, LiveRunWidget, issue identifiers, and UX improvements
Add Identity component (avatar + name) used across agent/issue displays. Add LiveRunWidget for real-time streaming of active heartbeat runs on issue detail pages via WebSocket. Display issue identifiers (PAP-42) instead of UUID fragments throughout Issues, Inbox, CommandPalette, and detail pages. Enhance CommentThread with re-open checkbox, Cmd+Enter submit, sorted display, and run linking. Improve Activity page with richer formatting and filtering. Update Dashboard with live metrics. Add reports-to agent link in AgentProperties. Various small fixes: StatusIcon centering, CopyText ref init, agent detail run-issue cross-links. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
38
ui/src/components/Identity.tsx
Normal file
38
ui/src/components/Identity.tsx
Normal file
@@ -0,0 +1,38 @@
|
||||
import { cn } from "@/lib/utils";
|
||||
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
|
||||
|
||||
type IdentitySize = "sm" | "default" | "lg";
|
||||
|
||||
export interface IdentityProps {
|
||||
name: string;
|
||||
avatarUrl?: string | null;
|
||||
initials?: string;
|
||||
size?: IdentitySize;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
function deriveInitials(name: string): string {
|
||||
const parts = name.trim().split(/\s+/);
|
||||
if (parts.length >= 2) return (parts[0][0] + parts[parts.length - 1][0]).toUpperCase();
|
||||
return name.slice(0, 2).toUpperCase();
|
||||
}
|
||||
|
||||
const textSize: Record<IdentitySize, string> = {
|
||||
sm: "text-xs",
|
||||
default: "text-sm",
|
||||
lg: "text-sm",
|
||||
};
|
||||
|
||||
export function Identity({ name, avatarUrl, initials, size = "default", className }: IdentityProps) {
|
||||
const displayInitials = initials ?? deriveInitials(name);
|
||||
|
||||
return (
|
||||
<span className={cn("inline-flex items-center gap-1.5", size === "lg" && "gap-2", className)}>
|
||||
<Avatar size={size}>
|
||||
{avatarUrl && <AvatarImage src={avatarUrl} alt={name} />}
|
||||
<AvatarFallback>{displayInitials}</AvatarFallback>
|
||||
</Avatar>
|
||||
<span className={cn("truncate", textSize[size])}>{name}</span>
|
||||
</span>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user