@@ -23,6 +23,9 @@ import { toast } from "sonner";
2323
2424import { MemorySection } from "@/features/agent-memory/ui/MemorySection" ;
2525import { AgentStatusBadge } from "@/features/agents/ui/AgentStatusBadge" ;
26+ import { useActiveAgentTurns } from "@/features/agents/activeAgentTurnsStore" ;
27+ import { formatElapsed } from "@/features/agents/ui/agentSessionUtils" ;
28+ import { useAppNavigation } from "@/app/navigation/useAppNavigation" ;
2629import { getPresenceLabel } from "@/features/presence/lib/presence" ;
2730import { PresenceDot } from "@/features/presence/ui/PresenceBadge" ;
2831import type {
@@ -36,6 +39,8 @@ import { StatusEmoji } from "@/features/user-status/ui/StatusEmoji";
3639import { BotIdenticon } from "@/features/messages/ui/BotIdenticon" ;
3740import type { ManagedAgent , RelayAgent } from "@/shared/api/types" ;
3841import { cn } from "@/shared/lib/cn" ;
42+ import { useNow } from "@/shared/lib/useNow" ;
43+ import { Badge } from "@/shared/ui/badge" ;
3944
4045const RUNTIME_LABELS : Record < string , string > = {
4146 goose : "Goose" ,
@@ -59,6 +64,7 @@ export type ProfileSummaryViewProps = {
5964 canEditAgent : boolean ;
6065 canViewActivity : boolean ;
6166 channelCount : number ;
67+ channelIdToName : Record < string , string > ;
6268 channelsLoading : boolean ;
6369 displayName : string ;
6470 followMutation : ReturnType < typeof useFollowMutation > ;
@@ -90,6 +96,7 @@ export function ProfileSummaryView({
9096 canEditAgent,
9197 canViewActivity,
9298 channelCount,
99+ channelIdToName,
93100 channelsLoading,
94101 displayName,
95102 followMutation,
@@ -116,6 +123,9 @@ export function ProfileSummaryView({
116123 unfollowMutation,
117124 userStatus,
118125} : ProfileSummaryViewProps ) {
126+ const { goChannel } = useAppNavigation ( ) ;
127+ const activeTurns = useActiveAgentTurns ( isBot ? pubkey : null ) ;
128+
119129 const metadataFields = [
120130 ...buildPublicFields ( {
121131 pubkey,
@@ -161,6 +171,20 @@ export function ProfileSummaryView({
161171 />
162172 ) : null }
163173
174+ { activeTurns . length > 0 ? (
175+ < div className = "flex flex-wrap justify-center gap-1.5" >
176+ { activeTurns . map ( ( { channelId, observedAt } ) => (
177+ < ProfileWorkingBadge
178+ key = { channelId }
179+ channelId = { channelId }
180+ name = { channelIdToName [ channelId ] ?? channelId }
181+ observedAt = { observedAt }
182+ onNavigate = { goChannel }
183+ />
184+ ) ) }
185+ </ div >
186+ ) : null }
187+
164188 { showMemoriesIngress || showChannelsIngress || canViewActivity ? (
165189 < section className = "space-y-2" >
166190 { showMemoriesIngress ? (
@@ -211,6 +235,30 @@ export function ProfileSummaryView({
211235 ) ;
212236}
213237
238+ function ProfileWorkingBadge ( {
239+ channelId,
240+ name,
241+ observedAt,
242+ onNavigate,
243+ } : {
244+ channelId : string ;
245+ name : string ;
246+ observedAt : number ;
247+ onNavigate : ( channelId : string ) => void ;
248+ } ) {
249+ const now = useNow ( 1000 ) ;
250+
251+ return (
252+ < Badge
253+ className = "cursor-pointer motion-safe:animate-pulse normal-case tracking-normal hover:opacity-80"
254+ variant = "default"
255+ onClick = { ( ) => onNavigate ( channelId ) }
256+ >
257+ Working in #{ name } · { formatElapsed ( now - observedAt ) }
258+ </ Badge >
259+ ) ;
260+ }
261+
214262// ── Hero & metadata ──────────────────────────────────────────────────────────
215263
216264function ProfileHero ( {
0 commit comments