@@ -9,7 +9,6 @@ import { useUniverseStore } from '../stores/universeStore'
99import { DEFAULT_TOOLS } from '@multiverse/shared'
1010import { SpriteIcon , resolveToolIcon } from './SpriteIcon'
1111import { ResizableSidePanel } from './ResizableSidePanel'
12- import { AgentChatPanel } from './AgentChatPanel'
1312import { AgentTypeLogo , AGENT_TYPE_META } from './AgentTypeLogo'
1413import { Button , ScrollArea } from '@multiverse/ui'
1514
@@ -123,35 +122,24 @@ export function AgentPanel() {
123122 const clearSelection = useUIStore ( ( s ) => s . clearSelection )
124123 const setFollowAgent = useUIStore ( ( s ) => s . setFollowAgent )
125124 const followAgentId = useUIStore ( ( s ) => s . followAgentId )
126- const setConversationAgent = useUIStore ( ( s ) => s . setConversationAgent )
127- const conversationAgentId = useUIStore ( ( s ) => s . conversationAgentId )
128125 const agents = useAgentStore ( ( s ) => s . agents )
129126 const islands = useUniverseStore ( ( s ) => s . islands )
130127 const districts = useUniverseStore ( ( s ) => s . districts )
131128 const buildings = useUniverseStore ( ( s ) => s . buildings )
132- const spriteAssignment = useAgentStore ( ( s ) => s . spriteAssignment )
133129 const getAgentEvents = useEventStore ( ( s ) => s . getAgentEvents )
134130
135- if ( selectedType !== 'agent' || ! selectedId ) return null
131+ const agent = selectedType === 'agent' && selectedId ? agents . get ( selectedId ) : null
136132
137- const agent = agents . get ( selectedId )
138133 if ( ! agent ) return null
139134
140135 const recentEvents = getAgentEvents ( agent . id , 50 )
141136 const isFollowing = followAgentId === agent . id
142- const isTalking = conversationAgentId === agent . id
143137 const typeMeta = AGENT_TYPE_META [ agent . type ]
144138 const location = resolveLocation ( agent . id , agents , islands , districts , buildings )
145139
146140 return (
147141 < ResizableSidePanel >
148- { /* When chatting, show only the embedded chat — fills the entire sidebar */ }
149- { isTalking ? (
150- < div className = "flex-1 min-h-0 flex flex-col" >
151- < AgentChatPanel agentId = { agent . id } />
152- </ div >
153- ) : (
154- < div className = "p-4 flex flex-col" >
142+ < div className = "p-4 flex flex-col" >
155143 { /* Header — name + status orb + type logo + close */ }
156144 < div className = "flex items-center gap-2 mb-5" >
157145 < h2 className = "font-pixel text-sm text-green-400 flex-1 min-w-0 truncate" >
@@ -192,7 +180,7 @@ export function AgentPanel() {
192180 </ div >
193181 ) }
194182
195- { /* Key Actions — Follow + Talk side by side */ }
183+ { /* Key Actions */ }
196184 < div className = "flex gap-2 mb-4" >
197185 < Button
198186 variant = "ghost"
@@ -212,16 +200,6 @@ export function AgentPanel() {
212200 < SpriteIcon region = "chains" size = { 18 } className = "shrink-0" />
213201 < span className = "font-pixel leading-none" > { isFollowing ? 'Following' : 'Follow' } </ span >
214202 </ Button >
215- < Button
216- variant = "ghost"
217- size = "sm"
218- onClick = { ( ) => setConversationAgent ( agent . id ) }
219- className = "h-auto flex-1 gap-1.5 bg-muted px-3 py-2 text-xs font-medium text-card-foreground hover:bg-accent focus-visible:ring-2 focus-visible:ring-blue-500"
220- aria-label = "Chat with agent"
221- >
222- < SpriteIcon region = { spriteAssignment . get ( agent . id ) ?? 'hero_knight' } size = { 18 } className = "shrink-0" />
223- < span className = "font-pixel leading-none" > Chat</ span >
224- </ Button >
225203 </ div >
226204
227205 { /* Divider */ }
@@ -310,8 +288,7 @@ export function AgentPanel() {
310288 } ) }
311289 </ div >
312290 </ ScrollArea >
313- </ div >
314- ) }
291+ </ div >
315292 </ ResizableSidePanel >
316293 )
317294}
0 commit comments