xonecas.io
60255
Zn

Zoea-Nova / commit 8491b5b

fix(tui): improve dashboard header and json tree rendering

- Add top border to dashboard header
- Remove blank line between header and broadcasts
- Sort JSON keys in tree view for deterministic rendering
- Update golden files
- Add known issue to TODO.md

xonecas2026-02-05 8491b5b0334d0e62e45230d8377d537d8c6205e4 parent df58f43

15 files changed

documentation/TODO.md+4−0
@@ -17,3 +17,7 @@
1717
1818 - Make install command that places the binary in the user's zoea config folder
1919 - check ollama logs, llms are stopping the loop.
20+
21+- mysis are calculating tick wrong.
22+│ │ AI: Waiting for travel to sol_base to complete (arrival_tick: 38549). Will sell ore once arrived at base to conver│ │ │
23+│ │ resources into credits.
internal/tui/dashboard.go+23−17
@@ -31,28 +31,34 @@ func RenderDashboard(myses []MysisInfo, swarmMessages []SwarmMessageInfo, select
3131 var sections []string
3232
3333 // Header - retro-futuristic command center banner with hexagonal motif (matching logo)
34- // Build width-spanning lines (exactly `width` characters)
3534 if width < 20 {
3635 width = 20
3736 }
38- topLine := " ⬥" + strings.Repeat("═", width-3) + "⬥"
39- titleText := " ⬡ Z O E A N O V A ⬡ COMMAND CENTER"
40- // Center the title and pad to full width - use lipgloss.Width() for Unicode
41- titleDisplayWidth := lipgloss.Width(titleText)
42- titlePadding := (width - titleDisplayWidth) / 2
43- if titlePadding < 0 {
44- titlePadding = 0
45- }
46- titleLine := strings.Repeat(" ", titlePadding) + titleText
47- // Pad right side to fill width
48- titleLineWidth := lipgloss.Width(titleLine)
49- if titleLineWidth < width {
50- titleLine += strings.Repeat(" ", width-titleLineWidth)
37+
38+ // Define custom border with empty sides but diamonds in corners
39+ // We enable all borders to get the corners, but set sides to empty strings
40+ headerBorder := lipgloss.Border{
41+ Top: "═",
42+ Bottom: "═",
43+ Left: " ",
44+ Right: " ",
45+ TopLeft: "⬥",
46+ TopRight: "⬥",
47+ BottomLeft: "⬥",
48+ BottomRight: "⬥",
5149 }
52- bottomLine := " ⬥" + strings.Repeat("═", width-3) + "⬥"
5350
54- headerText := topLine + "\n" + titleLine + "\n" + bottomLine
55- header := headerStyle.Width(width).Render(headerText)
51+ headerStyle := lipgloss.NewStyle().
52+ Bold(true).
53+ Foreground(colorBrand).
54+ Background(colorBgAlt).
55+ Width(width-2). // Subtract 2 for the corner characters
56+ Align(lipgloss.Center).
57+ Border(headerBorder, true, true, true, true).
58+ BorderForeground(colorBrand)
59+
60+ titleText := "⬡ Z O E A N O V A ⬡ COMMAND CENTER"
61+ header := headerStyle.Render(titleText)
5662 sections = append(sections, header)
5763
5864 // Swarm message history - always visible with fixed height
internal/tui/json_tree.go+2−1
@@ -3,6 +3,7 @@ package tui
33 import (
44 "encoding/json"
55 "fmt"
6+ "sort"
67 "strings"
78
89 "github.com/charmbracelet/lipgloss"
@@ -75,7 +76,7 @@ func renderObject(obj map[string]interface{}, prefix string, isLast bool, verbos
7576 for k := range obj {
7677 keys = append(keys, k)
7778 }
78- // Note: Not sorting to preserve JSON order, but could add sort.Strings(keys) here
79+ sort.Strings(keys)
7980
8081 for i, key := range keys {
8182 isLastField := i == len(keys)-1
internal/tui/testdata/TestDashboard/empty_swarm/ANSI.golden+3−4
@@ -1,7 +1,6 @@
1- ⬥═════════════════════════════════════════════════════════════════════════════════════════════════════════════════════⬥
2- ⬡ Z O E A N O V A ⬡ COMMAND CENTER 
3- ⬥═════════════════════════════════════════════════════════════════════════════════════════════════════════════════════⬥
4-
1+⬥══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════⬥
2+  ⬡ Z O E A N O V A ⬡ COMMAND CENTER  
3+⬥══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════⬥
54 ⬧────────────────────────────────────────────────── SWARM BROADCAST ───────────────────────────────────────────────────⬧
65 No broadcasts yet. Press 'b' to broadcast.
76 ⬧──────────────────────────────────────────────────── MYSIS SWARM ─────────────────────────────────────────────────────⬧
internal/tui/testdata/TestDashboard/empty_swarm/Stripped.golden+2−3
@@ -1,7 +1,6 @@
1- ⬥═════════════════════════════════════════════════════════════════════════════════════════════════════════════════════⬥
1+⬥══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════⬥
22 ⬡ Z O E A N O V A ⬡ COMMAND CENTER
3- ⬥═════════════════════════════════════════════════════════════════════════════════════════════════════════════════════⬥
4-
3+⬥══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════⬥
54 ⬧────────────────────────────────────────────────── SWARM BROADCAST ───────────────────────────────────────────────────⬧
65 No broadcasts yet. Press 'b' to broadcast.
76 ⬧──────────────────────────────────────────────────── MYSIS SWARM ─────────────────────────────────────────────────────⬧
internal/tui/testdata/TestDashboard/with_swarm_messages/ANSI.golden+3−4
@@ -1,7 +1,6 @@
1- ⬥═════════════════════════════════════════════════════════════════════════════════════════════════════════════════════⬥
2- ⬡ Z O E A N O V A ⬡ COMMAND CENTER 
3- ⬥═════════════════════════════════════════════════════════════════════════════════════════════════════════════════════⬥
4-
1+⬥══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════⬥
2+  ⬡ Z O E A N O V A ⬡ COMMAND CENTER  
3+⬥══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════⬥
54 ⬧────────────────────────────────────────────────── SWARM BROADCAST ───────────────────────────────────────────────────⬧
65 11:00:00 All units: proceed to sector 7
76 11:05:00 Target rich environment detected
internal/tui/testdata/TestDashboard/with_swarm_messages/Stripped.golden+2−3
@@ -1,7 +1,6 @@
1- ⬥═════════════════════════════════════════════════════════════════════════════════════════════════════════════════════⬥
1+⬥══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════⬥
22 ⬡ Z O E A N O V A ⬡ COMMAND CENTER
3- ⬥═════════════════════════════════════════════════════════════════════════════════════════════════════════════════════⬥
4-
3+⬥══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════⬥
54 ⬧────────────────────────────────────────────────── SWARM BROADCAST ───────────────────────────────────────────────────⬧
65 11:00:00 All units: proceed to sector 7
76 11:05:00 Target rich environment detected
internal/tui/testdata/TestFocusView/with_all_roles/ANSI.golden+2−2
@@ -15,8 +15,8 @@
1515 │ REASONING: The ship sensors show stable orbit. Fuel at 75%. Cargo hold empty.  │
1616 │ │
1717 │ TOOL: { │
18-│ ├─"name": alpha │
19-│ └─"fuel": 75 │
18+│ ├─"fuel": 75 │
19+│ └─"name": alpha │
2020 │ } │
2121 │ │
2222 │ │
internal/tui/testdata/TestFocusView/with_all_roles/Stripped.golden+2−2
@@ -15,8 +15,8 @@
1515 │ REASONING: The ship sensors show stable orbit. Fuel at 75%. Cargo hold empty. │
1616 │ │
1717 │ TOOL: { │
18-│ ├─"name": alpha │
19-│ └─"fuel": 75 │
18+│ ├─"fuel": 75 │
19+│ └─"name": alpha │
2020 │ } │
2121 │ │
2222 │ │
internal/tui/testdata/TestJSONTree/simple_object/ANSI.golden+2−2
@@ -1,5 +1,5 @@
11 {
2+ ├─"id": abc123
23 ├─"name": mysis-1
3- ├─"state": running
4- └─"id": abc123
4+ └─"state": running
55 }
internal/tui/testdata/TestJSONTree/simple_object/Stripped.golden+2−2
@@ -1,5 +1,5 @@
11 {
2+ ├─"id": abc123
23 ├─"name": mysis-1
3- ├─"state": running
4- └─"id": abc123
4+ └─"state": running
55 }
internal/tui/testdata/TestLogEntry/tool_with_json/ANSI.golden+2−2
@@ -1,6 +1,6 @@
11
22 TOOL: {
3+ ├─"fuel": 100
34 ├─"name": mysis-1
4- ├─"state": running
5- └─"fuel": 100
5+ └─"state": running
66 }
internal/tui/testdata/TestLogEntry/tool_with_json/Stripped.golden+2−2
@@ -1,6 +1,6 @@
11
22 TOOL: {
3+ ├─"fuel": 100
34 ├─"name": mysis-1
4- ├─"state": running
5- └─"fuel": 100
5+ └─"state": running
66 }
internal/tui/testdata/TestLogEntry/tool_with_prefixed_json/ANSI.golden+2−2
@@ -1,6 +1,6 @@
11
22 TOOL: {
3- ├─"total": 1
43 ├─"max": 16
5- └─"status": ok
4+ ├─"status": ok
5+ └─"total": 1
66 }
internal/tui/testdata/TestLogEntry/tool_with_prefixed_json/Stripped.golden+2−2
@@ -1,6 +1,6 @@
11
22 TOOL: {
3- ├─"total": 1
43 ├─"max": 16
5- └─"status": ok
4+ ├─"status": ok
5+ └─"total": 1
66 }