Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions dashboard/src/components/activity/ActivityTimeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1737,12 +1737,12 @@ function summarizeStatusUpdatesForCard(item: LiveActivityItem): string | null {
if (isBuffered) {
if (updates.length > 0) {
const first = updates[0];
return `Queued ${updates.length} update${updates.length === 1 ? '' : 's'}: ${first.label}${first.status ? ` → ${first.status}` : ''}`;
return `Updates being applied: ${updates.length} queued update${updates.length === 1 ? '' : 's'} · ${first.label}${first.status ? ` → ${first.status}` : ''}`;
}
if (statusUpdatesApplied !== null && statusUpdatesApplied > 0) {
return `Queued ${statusUpdatesApplied} status update${statusUpdatesApplied === 1 ? '' : 's'} for sync`;
return `Updates being applied: ${statusUpdatesApplied} status update${statusUpdatesApplied === 1 ? '' : 's'} queued for sync`;
}
return 'Queued status updates for sync';
return 'Updates being applied: status updates queued for sync';
}

if (statusUpdatesApplied !== null && statusUpdatesApplied > 0) {
Expand Down Expand Up @@ -6473,20 +6473,25 @@ export const ActivityTimeline = memo(function ActivityTimeline({
const commitSha = metadataString(outcomes, ['commit_sha', 'commitSha']);
const commitUrl = metadataString(outcomes, ['commit_url', 'commitUrl']);
const tests = asMetadataRecord(outcomes?.tests) as { passed?: number; failed?: number; skipped?: number } | null;
const showStatusUpdatesPanel =
statusUpdates.length > 0 ||
(statusUpdatesApplied ?? 0) > 0 ||
statusBuffered;
const showUpdatesInOutcomes =
showStatusUpdatesPanel &&
(!activeArtifact || eventName.includes('status_updates'));
const hasAny =
prUrl ||
commitSha ||
tests ||
statusUpdates.length > 0 ||
(statusUpdatesApplied ?? 0) > 0 ||
statusBuffered;
showUpdatesInOutcomes;
if (!hasAny) return null;
return (
<div className="space-y-2">
<p className="text-micro font-semibold uppercase tracking-wider text-muted">
Updates & outcomes
{showUpdatesInOutcomes ? 'Updates & outcomes' : 'Outcomes'}
</p>
{(statusUpdates.length > 0 || (statusUpdatesApplied ?? 0) > 0 || statusBuffered) && (
{showUpdatesInOutcomes && (
<div className="rounded-xl border border-[#14B8A6]/20 bg-[#14B8A6]/[0.06] px-3.5 py-2.5">
<div className="flex items-center gap-3">
<span className="h-2 w-2 flex-shrink-0 rounded-full bg-[#14B8A6]" />
Expand Down
53 changes: 51 additions & 2 deletions dashboard/src/components/agents/AgentAvatar.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useMemo, useState } from 'react';
import { getAgentColor, getInitials } from '@/lib/tokens';
import { UserFractalAvatar } from '@/components/settings/UserFractalAvatar';

interface AgentAvatarProps {
name: string;
Expand All @@ -14,6 +15,15 @@ const sizeMap = {
md: 'w-10 h-10 text-body',
lg: 'w-16 h-16 text-title',
};
const sizePxMap = {
xs: 24,
sm: 32,
md: 40,
lg: 64,
} as const;

const USER_NAME_KEY = 'orgx.user.display-name';
const USER_SEED_SUFFIX_KEY = 'orgx.user.avatar-seed-suffix';

const baseUrl = '/orgx/live/';
const withBaseUrl = (path: string) => `${baseUrl.replace(/\/+$/, '/')}${path}`;
Expand Down Expand Up @@ -66,6 +76,30 @@ function resolveAgentAvatar(...hints: Array<string | null | undefined>): string
return null;
}

function normalizeIdentity(value: string | null | undefined): string {
return typeof value === 'string' ? value.trim().toLowerCase() : '';
}

function isUserIdentity(value: string | null | undefined): boolean {
const normalized = normalizeIdentity(value);
if (!normalized) return false;
if (normalized === 'you' || normalized === 'main' || normalized === 'me') return true;
if (normalized === 'user' || normalized === 'usr') return true;
if (normalized.startsWith('user_') || normalized.startsWith('usr_')) return true;
return false;
}

function readUserAvatarSeed(): string {
if (typeof window === 'undefined') return 'orgx-user';
try {
const displayName = (window.localStorage.getItem(USER_NAME_KEY) ?? '').trim();
const seedSuffix = window.localStorage.getItem(USER_SEED_SUFFIX_KEY) ?? '';
return `${displayName || 'orgx-user'}${seedSuffix}`;
} catch {
return 'orgx-user';
}
}

export function AgentAvatar({
name,
size = 'xs',
Expand All @@ -74,12 +108,20 @@ export function AgentAvatar({
}: AgentAvatarProps) {
const color = getAgentColor(name);
const [failedToLoad, setFailedToLoad] = useState(false);
const showUserAvatar = useMemo(
() => isUserIdentity(name) || isUserIdentity(hint),
[hint, name]
);
const userAvatarSeed = useMemo(
() => (showUserAvatar ? readUserAvatarSeed() : null),
[showUserAvatar]
);
const avatarSrc = useMemo(() => {
if (src && src.trim()) return src;
return resolveAgentAvatar(name, hint);
}, [hint, name, src]);

const showImage = Boolean(avatarSrc && !failedToLoad);
const showImage = Boolean(!showUserAvatar && avatarSrc && !failedToLoad);

return (
<div
Expand All @@ -91,7 +133,14 @@ export function AgentAvatar({
border: `1px solid ${color}30`,
}}
>
{showImage ? (
{showUserAvatar && userAvatarSeed ? (
<UserFractalAvatar
seed={userAvatarSeed}
size={sizePxMap[size]}
animate={false}
className="h-full w-full"
/>
) : showImage ? (
<img
src={avatarSrc ?? undefined}
alt={name}
Expand Down
64 changes: 33 additions & 31 deletions dashboard/src/components/mission-control/InProgressPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -637,13 +637,16 @@ export const InProgressPanel = memo(function InProgressPanel({
{groupedRows.groups.map((initGroup) => (
<div key={initGroup.initiativeId}>
{/* Initiative heading */}
<h3 className="text-[15px] font-semibold text-white/90 mb-2">
{sanitizeDisplayText(
initGroup.initiativeTitle && !isOpaqueId(initGroup.initiativeTitle)
? initGroup.initiativeTitle
: compactOpaqueLabel(initGroup.initiativeId, 'Initiative')
)}
</h3>
<div className="mb-2 flex items-center gap-1.5">
<EntityIcon type="initiative" size={13} className="opacity-90" />
<h3 className="text-[15px] font-semibold text-white/90">
{sanitizeDisplayText(
initGroup.initiativeTitle && !isOpaqueId(initGroup.initiativeTitle)
? initGroup.initiativeTitle
: compactOpaqueLabel(initGroup.initiativeId, 'Initiative')
)}
</h3>
</div>

{/* Workstream subsections */}
{initGroup.workstreams.map((wsGroup) => {
Expand Down Expand Up @@ -671,20 +674,15 @@ export const InProgressPanel = memo(function InProgressPanel({
: firstRow?.progress != null
? coerceProgress(firstRow.progress)
: null;
const workstreamHeading = sanitizeDisplayText(
firstRow?.workstreamTitle && !isOpaqueId(firstRow.workstreamTitle)
? firstRow.workstreamTitle
: compactOpaqueLabel(wsGroup.workstreamId, 'Workstream')
);

return (
<div
key={wsGroup.workstreamId}
className="pl-4 border-l border-white/[0.08] mb-3"
>
{/* Workstream header with agent persona */}
<div className="flex items-start gap-2 mb-2">
{/* Workstream context row */}
<div className="mb-2 flex items-start gap-2">
<div className="min-w-0 flex flex-1 items-center gap-1.5">
<EntityIcon type="workstream" size={12} className="flex-shrink-0 opacity-80" />
{agentPersona && (
<div
className="w-6 h-6 rounded-full flex items-center justify-center text-[10px] font-bold flex-shrink-0"
Expand All @@ -696,20 +694,17 @@ export const InProgressPanel = memo(function InProgressPanel({
{agentPersona.name.charAt(0).toUpperCase()}
</div>
)}
<div className="min-w-0">
<p className="truncate text-[13px] font-semibold text-white/88" title={workstreamHeading}>
{workstreamHeading}
{agentPersona ? (
<p
className="truncate text-[11px] font-medium"
style={{ color: agentPersona.color }}
title={agentPersona.displayLabel}
>
{agentPersona.displayLabel}
</p>
{agentPersona ? (
<p
className="truncate text-[11px] font-medium"
style={{ color: agentPersona.color }}
title={agentPersona.displayLabel}
>
{agentPersona.displayLabel}
</p>
) : null}
</div>
) : (
<span className="text-[11px] text-white/45">Workstream</span>
)}
</div>

{/* Task position + mini progress bar */}
Expand All @@ -730,8 +725,7 @@ export const InProgressPanel = memo(function InProgressPanel({
</div>
)}

{/* Workstream headers intentionally omit relative time to avoid duplicate cadence signals.
The active row card carries the canonical "last updated" stamp. */}
{/* Header intentionally omits workstream title to avoid duplicate copy with the card title. */}
</div>

{/* Active rows */}
Expand Down Expand Up @@ -921,6 +915,14 @@ function InProgressRowCard({
? sliceRunByScope.get(`${row.initiativeId}:${row.workstreamId}`) ?? null
: null) ??
(row.runId ? sliceRunByScope.get(`run:${row.runId}`) ?? null : null);
const rowEntityType =
row.scope === 'task'
? 'task'
: row.scope === 'milestone'
? 'milestone'
: row.scope === 'workstream' || row.source === 'slice'
? 'workstream'
: 'session';

// Resolve agent persona for the row card
const persona = resolveAgentPersona(row.session?.agentId, row.session?.agentName);
Expand Down Expand Up @@ -966,7 +968,7 @@ function InProgressRowCard({
</p>
) : null}
<div className="flex min-w-0 items-start gap-1.5">
<EntityIcon type="session" size={12} className="mt-[3px] flex-shrink-0 opacity-80" />
<EntityIcon type={rowEntityType} size={12} className="mt-[3px] flex-shrink-0 opacity-80" />
<p className="min-w-0 line-clamp-2 text-body font-semibold leading-snug text-white" title={rowTitleDisplay}>
{rowTitleDisplay}
</p>
Expand Down
Loading
Loading