@@ -0,0 +1,315 @@
1+# Zoea Nova UI Layout Report
2+
3+Generated: 2026-02-05
4+
5+## Dashboard View (Main Screen)
6+
7+### Layout Structure (Top to Bottom)
8+
9+```
10+┌─────────────────────────────────────────────────────────┐
11+│ 1. HEADER (3 lines) │
12+│ 2. STATUS BAR (1 line) │
13+│ 3. SWARM BROADCAST SECTION (header + variable content) │
14+│ 4. MYSIS SWARM SECTION (header + bordered panel) │
15+│ 5. FOOTER (1 line) │
16+└─────────────────────────────────────────────────────────┘
17+```
18+
19+---
20+
21+## Panel Details
22+
23+### 1. HEADER (Lines 1-3)
24+**Location:** `dashboard.go` lines 33-56
25+**Rendering:** `headerStyle.Width(width).Render(headerText)`
26+
27+```
28+ ⬥═══════════════════════════════════════════════════════⬥
29+ ⬡ Z O E A N O V A ⬡ COMMAND CENTER
30+ ⬥═══════════════════════════════════════════════════════⬥
31+```
32+
33+**Components:**
34+- Top border: ` ⬥` + `═` repeated + `⬥`
35+- Title: Centered text with hexagonal motifs (`⬡`)
36+- Bottom border: Same as top border
37+- **Style:** `headerStyle` (defined in `styles.go`)
38+
39+---
40+
41+### 2. STATUS BAR (Line 5)
42+**Location:** `dashboard.go` lines 58-89
43+**Rendering:** `statusBarStyle.Width(width).Render(stats)`
44+
45+```
46+ ∙ 1 ◦ 1 ◌ 0 ✖ 0
47+```
48+
49+**Components:**
50+- **Running count:** `∙` (bullet operator U+2219) + count
51+- **Idle count:** `◦` (white bullet U+25E6) + count
52+- **Stopped count:** `◌` (dotted circle) + count
53+- **Errored count:** `✖` (heavy multiplication X) + count
54+- **Loading indicator:** (optional) spinner + count if any myses are loading
55+
56+**Calculation:**
57+- Running: Counts myses with `state == "running"`
58+- Idle: `len(myses) - running - stopped - errored`
59+- Stopped: Counts myses with `state == "stopped"`
60+- Errored: Counts myses with `state == "errored"`
61+
62+**Style:** `statusBarStyle` with colored icons:
63+- Running: `stateRunningStyle` (green)
64+- Idle: `stateIdleStyle` (yellow)
65+- Stopped: `stateStoppedStyle` (dimmed)
66+- Errored: `stateErroredStyle` (red)
67+
68+---
69+
70+### 3. SWARM BROADCAST SECTION (Lines 6-8)
71+**Location:** `dashboard.go` lines 91-122
72+**Always visible:** Yes (shows placeholder when empty)
73+
74+#### Header (Line 6)
75+```
76+⬧────────────────── SWARM BROADCAST ──────────────────⬧
77+```
78+**Rendering:** `renderSectionTitle("SWARM BROADCAST", width)`
79+
80+#### Content (Lines 7-8, variable)
81+**When empty:**
82+```
83+No broadcasts yet. Press 'b' to broadcast.
84+```
85+
86+**When populated (up to 10 messages):**
87+```
88+11:00:00 All units: proceed to sector 7
89+11:05:00 Target rich environment detected
90+```
91+
92+**Format per message:**
93+- Timestamp: `HH:MM:SS` (dimmed style)
94+- Content: Single line, truncated if > `width - 15` characters
95+- Newlines replaced with spaces
96+- Truncation: `...` suffix if content too long
97+
98+**Max messages:** 10 (constant `maxSwarmMessages`)
99+**Order:** Most recent first
100+
101+---
102+
103+### 4. MYSIS SWARM SECTION (Lines 9-40)
104+**Location:** `dashboard.go` lines 124-161
105+
106+#### Header (Line 9)
107+```
108+⬧──────────────────── MYSIS SWARM ────────────────────⬧
109+```
110+**Rendering:** `renderSectionTitle("MYSIS SWARM", width)`
111+
112+#### Panel (Lines 10-40, bordered box)
113+**Border style:** Double-line box (`╔═╗║╚═╝`)
114+**Rendering:** `mysisListStyle.Width(width - 2).Height(mysisListHeight).Render(content)`
115+
116+**Height calculation:**
117+```
118+usedHeight = 6 (header + stats + mysis header + footer)
119+ + 1 (swarm header)
120+ + len(msgLines) (swarm content)
121+ + 2 (panel borders)
122+mysisListHeight = height - usedHeight
123+```
124+
125+**When empty:**
126+```
127+╔════════════════════════════════════════════════════╗
128+║No myses. Press 'n' to create one. ║
129+║ ║
130+╚════════════════════════════════════════════════════╝
131+```
132+
133+**When populated:**
134+```
135+╔════════════════════════════════════════════════════╗
136+║ ⠋ alpha running [ollama] @crab_warrior │ ... ║
137+║ ◦ beta idle [zen] @crab_trader │ ... ║
138+╚════════════════════════════════════════════════════╝
139+```
140+
141+#### Mysis Line Format
142+**Location:** `dashboard.go` lines 170-243
143+**Function:** `renderMysisLine()`
144+
145+**Structure:**
146+```
147+[space] [indicator] [space] [styled content]
148+```
149+
150+**Indicator (outside styled area):**
151+- Running: Animated spinner (e.g., `⠋`)
152+- Idle: `◦` (white bullet)
153+- Stopped: `◌` (dotted circle)
154+- Errored: `✖` (heavy X)
155+- Loading: Animated spinner
156+
157+**Content (inside styled area):**
158+```
159+[name(16)] [state(8)] [provider] [account] │ [last message]
160+```
161+
162+**Fields:**
163+- **Name:** Max 16 chars, truncated with `...` if longer
164+- **State:** 8 chars, padded, colored by state
165+- **Provider:** `[ollama]` or `[opencode_zen]`, dimmed
166+- **Account:** `@username` or `(no account)`, dimmed
167+- **Last message:** Remaining width, truncated with `...`, dimmed, prefixed with ` │ `
168+
169+**Selection styling:**
170+- Selected: `mysisItemSelectedStyle` (background color applied)
171+- Unselected: `mysisItemStyle` (no background)
172+
173+**Note:** Indicator is rendered OUTSIDE the styled content to prevent background color from applying to it (fix from commit fb1d0b6).
174+
175+---
176+
177+### 5. FOOTER (Line 41)
178+**Location:** `dashboard.go` lines 163-165
179+**Rendering:** `dimmedStyle.Render(hint)`
180+
181+```
182+[ ? ] HELP · [ n ] NEW MYSIS · [ b ] BROADCAST
183+```
184+
185+**Components:**
186+- Help hint: `[ ? ] HELP`
187+- New mysis hint: `[ n ] NEW MYSIS`
188+- Broadcast hint: `[ b ] BROADCAST`
189+- Separator: ` · ` (middle dot)
190+
191+**Style:** `dimmedStyle` (gray/dimmed color)
192+
193+---
194+
195+## Focus View (Detailed Mysis View)
196+
197+### Layout Structure
198+
199+```
200+┌─────────────────────────────────────────────────────────┐
201+│ 1. HEADER (mysis name + account + state) │
202+│ 2. CONVERSATION VIEWPORT (scrollable) │
203+│ 3. FOOTER (help hints) │
204+└─────────────────────────────────────────────────────────┘
205+```
206+
207+### Components
208+
209+#### 1. Header
210+**Location:** `focus.go` `renderFocusHeader()`
211+
212+```
213+⬧──────────────────── MYSIS: alpha ────────────────────⬧
214+@crab_warrior · running
215+```
216+
217+**Components:**
218+- Title bar: `⬧` + `─` repeated + `MYSIS: [name]` + `─` repeated + `⬧`
219+- Account + state: `@username · state` (dimmed)
220+
221+#### 2. Conversation Viewport
222+**Location:** `focus.go` `RenderFocusViewWithViewport()`
223+
224+**Scrollable content showing log entries:**
225+
226+**Entry types:**
227+- **System messages:** Cyan color, `[SYSTEM]` prefix
228+- **User messages:** Green color, `[USER]` or `[BROADCAST]` prefix
229+- **Assistant messages:** Magenta color, `[AI]` prefix
230+- **Tool calls:** Yellow color, `[TOOL_CALL]` prefix
231+- **Tool results:** Yellow color, `[TOOL_RESULT]` prefix
232+
233+**Broadcast labels:**
234+- Self broadcast: `[BROADCAST (self)]`
235+- Swarm broadcast: `[SWARM BROADCAST]`
236+
237+**Reasoning display:**
238+- When verbose mode enabled (`v` key)
239+- Shows reasoning content in dimmed style
240+- Prefix: `[REASONING]`
241+
242+**JSON rendering:**
243+- Tool results with JSON are rendered as tree structure
244+- Collapsible/expandable (when verbose mode enabled)
245+- Syntax highlighting with colors
246+
247+**Scrollbar:**
248+- Visual indicator on right edge
249+- Shows scroll position
250+- Characters: `█` (thumb), `│` (track)
251+
252+#### 3. Footer
253+```
254+[ ESC ] BACK · [ v ] VERBOSE · [ ? ] HELP
255+```
256+
257+---
258+
259+## Key Observations
260+
261+### Current Issues Identified
262+
263+1. **Status Bar Position:**
264+ - Currently at line 5 (between header and swarm broadcast)
265+ - Styled with `statusBarStyle` (full-width panel)
266+
267+2. **No Duplicate Status Icons:**
268+ - Status icons appear ONLY in the status bar (line 5)
269+ - Footer only shows keyboard hints
270+ - No duplication found in current code
271+
272+3. **Swarm Broadcast Section:**
273+ - Always visible (shows placeholder when empty)
274+ - Takes variable height based on message count (max 10)
275+ - Positioned between status bar and mysis list
276+
277+4. **Mysis List Panel:**
278+ - Bordered box with double-line style
279+ - Height dynamically calculated to fill remaining space
280+ - Each mysis line shows: indicator, name, state, provider, account, last message
281+
282+---
283+
284+## Code References
285+
286+### Main Files
287+- `internal/tui/dashboard.go` - Dashboard rendering
288+- `internal/tui/focus.go` - Focus view rendering
289+- `internal/tui/styles.go` - Style definitions
290+- `internal/tui/app.go` - Model and update logic
291+
292+### Key Functions
293+- `RenderDashboard()` - Main dashboard render (line 30)
294+- `renderMysisLine()` - Individual mysis line (line 170)
295+- `renderSectionTitle()` - Section headers (in `styles.go`)
296+- `RenderFocusViewWithViewport()` - Focus view with scrolling
297+
298+### Test Files
299+- `internal/tui/testdata/TestDashboard/with_swarm_messages/Stripped.golden`
300+- `internal/tui/testdata/TestDashboard/empty_swarm/Stripped.golden`
301+
302+---
303+
304+## Summary
305+
306+The current UI has **5 main sections** in the dashboard:
307+
308+1. **Header** (3 lines) - Retro-futuristic banner
309+2. **Status Bar** (1 line) - Mysis state counts with icons
310+3. **Swarm Broadcast** (variable) - Recent broadcast messages
311+4. **Mysis Swarm** (variable) - Bordered list of myses
312+5. **Footer** (1 line) - Keyboard hints
313+
314+**Total fixed height:** 6 lines (header + status + footer + 2 section headers)
315+**Variable height:** Swarm messages + Mysis list (fills remaining space)