Skip to content

Commit 052fd06

Browse files
committed
feat: show crisis summary + category in timeline cards, add cost tracking to footer, viz loading state
1 parent ec86d5b commit 052fd06

4 files changed

Lines changed: 50 additions & 6 deletions

File tree

src/cli/dashboard/src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ function AppContent() {
251251

252252
{/* About tab redirects to the landing page */}
253253
</main>
254-
<Footer />
254+
<Footer cost={gameState.cost} />
255255
{tourActive && (
256256
<GuidedTour
257257
onTabChange={(tab) => setActiveTab(tab)}

src/cli/dashboard/src/components/layout/Footer.tsx

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
export function Footer() {
1+
interface FooterProps {
2+
cost?: { totalTokens: number; totalCostUSD: number; llmCalls: number };
3+
}
4+
5+
export function Footer({ cost }: FooterProps) {
26
return (
37
<footer
48
className="shrink-0"
@@ -23,6 +27,21 @@ export function Footer() {
2327
<a href="/docs" style={{ color: 'var(--rust)', fontWeight: 600 }}>docs</a>
2428
<a href="https://agentos.sh/blog" target="_blank" rel="noopener" style={{ color: 'var(--rust)', fontWeight: 600 }}>blog</a>
2529
</nav>
30+
31+
{cost && cost.llmCalls > 0 && (
32+
<span style={{ display: 'flex', alignItems: 'baseline', gap: '4px', fontFamily: 'var(--mono)', fontSize: '10px' }}>
33+
<span style={{ color: 'var(--green)', fontWeight: 800 }}>
34+
${cost.totalCostUSD < 0.01 ? cost.totalCostUSD.toFixed(4) : cost.totalCostUSD.toFixed(2)}
35+
</span>
36+
<span style={{ color: 'var(--text-3)' }}>
37+
{(cost.totalTokens / 1000).toFixed(0)}k tok
38+
</span>
39+
<span style={{ color: 'var(--text-3)' }}>
40+
{cost.llmCalls} calls
41+
</span>
42+
</span>
43+
)}
44+
2645
<span>
2746
<span style={{ fontFamily: 'var(--mono)', fontWeight: 700, letterSpacing: '.08em', fontSize: '10px' }}>PARA<span style={{ color: 'var(--amber)' }}>COSM</span></span>
2847
{' '}&middot; Apache-2.0 &middot; <a href="https://manic.agency" target="_blank" rel="noopener" style={{ color: 'var(--text-3)' }}>Manic Agency</a> / <a href="https://frame.dev" target="_blank" rel="noopener" style={{ color: 'var(--text-3)' }}>Frame.dev</a>

src/cli/dashboard/src/components/sim/Timeline.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,21 @@ function SideTimeline({ turns, side }: { turns: TurnEntry[]; side: Side }) {
123123
<span style={{ flex: 1, color: 'var(--text-1)', fontWeight: 700, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', minWidth: 0 }}>
124124
{t.title}
125125
</span>
126+
{t.category && (
127+
<span style={{ fontSize: '9px', padding: '0 4px', borderRadius: '2px', background: 'var(--bg-deep)', color: 'var(--text-3)', fontFamily: 'var(--mono)', flexShrink: 0 }}>
128+
{t.category}
129+
</span>
130+
)}
131+
{t.emergent && (
132+
<span style={{ fontSize: '8px', fontWeight: 800, color: 'var(--rust)', fontFamily: 'var(--mono)', flexShrink: 0 }}>EMERGENT</span>
133+
)}
126134
{outcomeBadge(t.outcome)}
127135
</div>
136+
{t.summary && (
137+
<div style={{ fontSize: '10px', color: 'var(--text-3)', marginTop: '2px', lineHeight: 1.4, overflow: 'hidden', display: '-webkit-box', WebkitLineClamp: 2, WebkitBoxOrient: 'vertical' as const, fontStyle: 'italic' }}>
138+
{t.summary}
139+
</div>
140+
)}
128141
{t.decision && (
129142
<div style={{ fontSize: '10px', color: 'var(--text-2)', marginTop: '2px', lineHeight: 1.4, overflow: 'hidden', display: '-webkit-box', WebkitLineClamp: 2, WebkitBoxOrient: 'vertical' as const }}>
130143
{t.decision}
@@ -146,7 +159,7 @@ export function Timeline({ state }: TimelineProps) {
146159
return (
147160
<div className="timeline-row" role="region" aria-label="Turn timeline" style={{
148161
borderTop: '1px solid var(--border)', background: 'var(--bg-panel)',
149-
display: 'flex', gap: '4px', height: '160px', overflow: 'hidden', flexShrink: 0,
162+
display: 'flex', gap: '4px', height: '200px', overflow: 'hidden', flexShrink: 0,
150163
padding: '4px 8px', minWidth: 0, maxWidth: '100%',
151164
}}>
152165
<SideTimeline turns={turnsA} side="a" />

src/cli/dashboard/src/components/viz/ColonyViz.tsx

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,24 @@ export function ColonyViz({ state }: ColonyVizProps) {
7171
const leaderB = state.b.leader;
7272

7373
if (maxTurn === 0) {
74+
const isRunning = state.isRunning && !state.isComplete;
7475
return (
7576
<div style={{
76-
display: 'flex', alignItems: 'center', justifyContent: 'center',
77-
flex: 1, color: 'var(--text-3)', fontSize: 13,
77+
display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center',
78+
flex: 1, color: 'var(--text-3)', fontSize: 13, gap: 8,
7879
}}>
79-
Run a simulation to see the colony visualization.
80+
{isRunning ? (
81+
<>
82+
<div style={{ fontSize: 11, fontWeight: 700, color: 'var(--rust)', letterSpacing: '.08em', textTransform: 'uppercase' }}>
83+
Simulation Running
84+
</div>
85+
<div>Waiting for first turn to complete...</div>
86+
<div style={{ width: 24, height: 24, border: '2px solid var(--border)', borderTop: '2px solid var(--rust)', borderRadius: '50%', animation: 'spin 1s linear infinite' }} />
87+
<style>{`@keyframes spin { to { transform: rotate(360deg); } }`}</style>
88+
</>
89+
) : (
90+
'Run a simulation to see the colony visualization.'
91+
)}
8092
</div>
8193
);
8294
}

0 commit comments

Comments
 (0)