Skip to content

Commit 44ceda1

Browse files
mirror: sync from hq/multiverse
Automated by mirror-to-agentis workflow. Source commit: 60e03e2976ba517ec2b85fd90a7c781e96b7f0b2
1 parent 9d83fd7 commit 44ceda1

File tree

5 files changed

+27
-53
lines changed

5 files changed

+27
-53
lines changed

packages/engine/src/components/AgentPanel.tsx

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { useUniverseStore } from '../stores/universeStore'
99
import { DEFAULT_TOOLS } from '@multiverse/shared'
1010
import { SpriteIcon, resolveToolIcon } from './SpriteIcon'
1111
import { ResizableSidePanel } from './ResizableSidePanel'
12-
import { AgentChatPanel } from './AgentChatPanel'
1312
import { AgentTypeLogo, AGENT_TYPE_META } from './AgentTypeLogo'
1413
import { 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
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { AgentPanel } from './AgentPanel'
2+
import { BuildingPanel } from './BuildingPanel'
3+
import { DistrictPanel } from './DistrictPanel'
4+
import { MonsterPanel } from './MonsterPanel'
5+
import { FollowBadge } from './FollowBadge'
6+
import { EventLog } from './EventLog'
7+
8+
export function WorldOverlays() {
9+
return (
10+
<>
11+
<EventLog />
12+
<FollowBadge />
13+
<AgentPanel />
14+
<BuildingPanel />
15+
<DistrictPanel />
16+
<MonsterPanel />
17+
</>
18+
)
19+
}

packages/engine/src/modes/demo/DemoPage.tsx

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,7 @@
55
// ============================================================================
66

77
import { GameCanvas } from '../../components/GameCanvas'
8-
import { AgentPanel } from '../../components/AgentPanel'
9-
import { BuildingPanel } from '../../components/BuildingPanel'
10-
import { DistrictPanel } from '../../components/DistrictPanel'
11-
import { MonsterPanel } from '../../components/MonsterPanel'
12-
import { FollowBadge } from '../../components/FollowBadge'
13-
import { EventLog } from '../../components/EventLog'
8+
import { WorldOverlays } from '../../components/WorldOverlays'
149
import { useUIStore } from '../../stores/uiStore'
1510
import { useModeStore } from '../../app/modeStore'
1611
import {
@@ -119,12 +114,7 @@ export function DemoPage() {
119114
{/* Main canvas area */}
120115
<main className="flex-1 min-h-0 relative overflow-hidden">
121116
<GameCanvas />
122-
<EventLog />
123-
<FollowBadge />
124-
<AgentPanel />
125-
<BuildingPanel />
126-
<DistrictPanel />
127-
<MonsterPanel />
117+
<WorldOverlays />
128118
</main>
129119
</div>
130120
</TooltipProvider>

packages/engine/src/modes/transcript/TranscriptPage.tsx

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,7 @@
66

77
import { useEffect, useMemo, useReducer, useRef, useState } from 'react'
88
import { GameCanvas } from '../../components/GameCanvas'
9-
import { AgentPanel } from '../../components/AgentPanel'
10-
import { BuildingPanel } from '../../components/BuildingPanel'
11-
import { DistrictPanel } from '../../components/DistrictPanel'
12-
import { MonsterPanel } from '../../components/MonsterPanel'
13-
import { FollowBadge } from '../../components/FollowBadge'
14-
import { EventLog } from '../../components/EventLog'
9+
import { WorldOverlays } from '../../components/WorldOverlays'
1510
import { useUIStore } from '../../stores/uiStore'
1611
import {
1712
Button,
@@ -226,12 +221,7 @@ export function TranscriptPage({ isLocalEnabled, localInstallUrl }: TranscriptPa
226221
{/* Main canvas area */}
227222
<main className="flex-1 min-h-0 relative overflow-hidden">
228223
<GameCanvas onRendererReady={(r) => { rendererRef.current = r; engine.setRenderer(r) }} />
229-
<EventLog />
230-
<FollowBadge />
231-
<AgentPanel />
232-
<BuildingPanel />
233-
<DistrictPanel />
234-
<MonsterPanel />
224+
<WorldOverlays />
235225

236226
<TranscriptHud show={showHud} rendererRef={rendererRef} />
237227
</main>

pnpm-lock.yaml

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)