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