xonecas.io
62159
Sy

symb / commit f51d5c1

feat: remove outside border

xonecas2026-02-11 f51d5c1a0f9aab27bee9b4591235f4657f5562d4 parent 1637dbe

7 files changed

AGENTS.md+1−0
@@ -15,3 +15,4 @@
1515 - Always use [ELM](https://guide.elm-lang.org/architecture/) architecture.
1616 - Go & Golintci
1717 - Bubbletea, Bubbles and Lipgloss.
18+- Use Makefile commands to build, lint and test.
internal/tui/styles.go+2−0
@@ -5,5 +5,7 @@ import "github.com/charmbracelet/lipgloss"
55 var (
66 ColorMatrix = lipgloss.Color("#00AA00") // Matrix green
77 ColorDarkGray = lipgloss.Color("#2a2a2a") // Dark gray
8+ ColorGray = lipgloss.Color("#3f3f3f")
89 ColorBorder = ColorDarkGray
10+ ColorDimText = ColorGray
911 )
internal/tui/testdata/TestLayout/120x40/ANSI.golden+40−40
@@ -1,40 +1,40 @@
1-╭───────────────────────────────────────────────────────────┬──────────────────────────────────────────────────────────╮
2-│┃ 1 Start editing... │ │
3-│┃ │ │
4-│┃ │ │
5-│┃ │ │
6-│┃ │ │
7-│┃ │ │
8-│┃ │ │
9-│┃ │ │
10-│┃ │ │
11-│┃ │ │
12-│┃ │ │
13-│┃ │ │
14-│┃ │ │
15-│┃ │ │
16-│┃ │ │
17-│┃ │ │
18-│┃ │ │
19-│┃ │ │
20-│┃ │ │
21-│┃ │ │
22-│┃ │ │
23-│┃ │ │
24-│┃ │ │
25-│┃ │ │
26-│┃ │ │
27-│┃ │ │
28-│┃ │ │
29-│┃ │ │
30-│┃ │ │
31-│┃ │ │
32-│┃ │ │
33-│┃ │ │
34-│┃ │ │
35-│┃ │ │
36-│┃ │ │
37-│┃ │ │
38-├───────────────────────────────────────────────────────────┴──────────────────────────────────────────────────────────┤
39-│ master* │ ⣾ │
40-╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
1+ 1 │
2+ │
3+ │
4+ │
5+ │
6+ │
7+ │
8+ │
9+ │
10+ │
11+ │
12+ │
13+ │
14+ │
15+ │
16+ │
17+ │
18+ │
19+ │
20+ │
21+ │
22+ │
23+ │
24+ │
25+ │
26+ │
27+ │
28+ │
29+ │
30+ │
31+ │
32+ │
33+ │
34+ │
35+ │
36+ │
37+ │
38+ │
39+────────────────────────────────────────────────────────────┴───────────────────────────────────────────────────────────
40+ master* │ ⣾
internal/tui/testdata/TestLayout/120x40/Stripped.golden+40−40
@@ -1,40 +1,40 @@
1-╭───────────────────────────────────────────────────────────┬──────────────────────────────────────────────────────────╮
2-│┃ 1 Start editing... │ │
3-│┃ │ │
4-│┃ │ │
5-│┃ │ │
6-│┃ │ │
7-│┃ │ │
8-│┃ │ │
9-│┃ │ │
10-│┃ │ │
11-│┃ │ │
12-│┃ │ │
13-│┃ │ │
14-│┃ │ │
15-│┃ │ │
16-│┃ │ │
17-│┃ │ │
18-│┃ │ │
19-│┃ │ │
20-│┃ │ │
21-│┃ │ │
22-│┃ │ │
23-│┃ │ │
24-│┃ │ │
25-│┃ │ │
26-│┃ │ │
27-│┃ │ │
28-│┃ │ │
29-│┃ │ │
30-│┃ │ │
31-│┃ │ │
32-│┃ │ │
33-│┃ │ │
34-│┃ │ │
35-│┃ │ │
36-│┃ │ │
37-│┃ │ │
38-├───────────────────────────────────────────────────────────┴──────────────────────────────────────────────────────────┤
39-│ master* │ ⣾ │
40-╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
1+ 1 │
2+ │
3+ │
4+ │
5+ │
6+ │
7+ │
8+ │
9+ │
10+ │
11+ │
12+ │
13+ │
14+ │
15+ │
16+ │
17+ │
18+ │
19+ │
20+ │
21+ │
22+ │
23+ │
24+ │
25+ │
26+ │
27+ │
28+ │
29+ │
30+ │
31+ │
32+ │
33+ │
34+ │
35+ │
36+ │
37+ │
38+ │
39+────────────────────────────────────────────────────────────┴───────────────────────────────────────────────────────────
40+ master* │ ⣾
internal/tui/testdata/TestLayout/80x24/ANSI.golden+24−24
@@ -1,24 +1,24 @@
1-╭───────────────────────────────────────┬──────────────────────────────────────╮
2-│┃ 1 Start editing... │ │
3-│┃ │ │
4-│┃ │ │
5-│┃ │ │
6-│┃ │ │
7-│┃ │ │
8-│┃ │ │
9-│┃ │ │
10-│┃ │ │
11-│┃ │ │
12-│┃ │ │
13-│┃ │ │
14-│┃ │ │
15-│┃ │ │
16-│┃ │ │
17-│┃ │ │
18-│┃ │ │
19-│┃ │ │
20-│┃ │ │
21-│┃ │ │
22-├───────────────────────────────────────┴──────────────────────────────────────┤
23-│ master* │ ⣾ │
24-╰──────────────────────────────────────────────────────────────────────────────╯
1+ 1 │
2+ │
3+ │
4+ │
5+ │
6+ │
7+ │
8+ │
9+ │
10+ │
11+ │
12+ │
13+ │
14+ │
15+ │
16+ │
17+ │
18+ │
19+ │
20+ │
21+ │
22+ │
23+────────────────────────────────────────┴───────────────────────────────────────
24+ master* │ ⣾
internal/tui/testdata/TestLayout/80x24/Stripped.golden+24−24
@@ -1,24 +1,24 @@
1-╭───────────────────────────────────────┬──────────────────────────────────────╮
2-│┃ 1 Start editing... │ │
3-│┃ │ │
4-│┃ │ │
5-│┃ │ │
6-│┃ │ │
7-│┃ │ │
8-│┃ │ │
9-│┃ │ │
10-│┃ │ │
11-│┃ │ │
12-│┃ │ │
13-│┃ │ │
14-│┃ │ │
15-│┃ │ │
16-│┃ │ │
17-│┃ │ │
18-│┃ │ │
19-│┃ │ │
20-│┃ │ │
21-│┃ │ │
22-├───────────────────────────────────────┴──────────────────────────────────────┤
23-│ master* │ ⣾ │
24-╰──────────────────────────────────────────────────────────────────────────────╯
1+ 1 │
2+ │
3+ │
4+ │
5+ │
6+ │
7+ │
8+ │
9+ │
10+ │
11+ │
12+ │
13+ │
14+ │
15+ │
16+ │
17+ │
18+ │
19+ │
20+ │
21+ │
22+ │
23+────────────────────────────────────────┴───────────────────────────────────────
24+ master* │ ⣾
internal/tui/tui.go+15−35
@@ -64,8 +64,8 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
6464
6565 // Update textarea size to fit left pane
6666 halfWidth := m.width / 2
67- contentHeight := m.height - 4
68- m.textarea.SetWidth(halfWidth - 3) // -3 for borders and padding
67+ contentHeight := m.height - 2 // -2 for status separator and status bar
68+ m.textarea.SetWidth(halfWidth - 1) // -1 for center divider
6969 m.textarea.SetHeight(contentHeight)
7070 }
7171
@@ -90,78 +90,58 @@ func (m Model) View() string {
9090 // Split width in half for left/right panes
9191 halfWidth := m.width / 2
9292
93- // Content height = total - top border - status separator - status bar - bottom border
94- contentHeight := m.height - 4
93+ // Content height = total - status separator - status bar
94+ contentHeight := m.height - 2
9595
9696 var b strings.Builder
9797 borderStyle := lipgloss.NewStyle().Foreground(ColorBorder)
9898
99- // Top border: ╭───...───┬───...───╮
100- b.WriteString(borderStyle.Render("╭"))
101- b.WriteString(borderStyle.Render(strings.Repeat("─", halfWidth-1)))
102- b.WriteString(borderStyle.Render("┬"))
103- b.WriteString(borderStyle.Render(strings.Repeat("─", m.width-halfWidth-2)))
104- b.WriteString(borderStyle.Render("╮"))
105- b.WriteString("\n")
106-
10799 // Render textarea in left pane
108100 textareaView := m.textarea.View()
109101 textareaLines := strings.Split(textareaView, "\n")
110102
111103 // Content rows
112104 for i := 0; i < contentHeight; i++ {
113- b.WriteString(borderStyle.Render("│"))
114-
115105 // Left pane: textarea
116106 if i < len(textareaLines) {
117107 line := textareaLines[i]
118108 lineWidth := lipgloss.Width(line)
119- padding := halfWidth - 1 - lineWidth
109+ padding := halfWidth - lineWidth
120110 if padding < 0 {
121111 padding = 0
122112 }
123113 b.WriteString(line)
124114 b.WriteString(strings.Repeat(" ", padding))
125115 } else {
126- b.WriteString(strings.Repeat(" ", halfWidth-1))
116+ b.WriteString(strings.Repeat(" ", halfWidth))
127117 }
128118
129119 b.WriteString(borderStyle.Render("│"))
130120
131121 // Right pane: empty for now
132- b.WriteString(strings.Repeat(" ", m.width-halfWidth-2))
122+ b.WriteString(strings.Repeat(" ", m.width-halfWidth-1))
133123
134- b.WriteString(borderStyle.Render("│"))
135124 b.WriteString("\n")
136125 }
137126
138- // Status separator: ├───...───┴───...───┤
139- b.WriteString(borderStyle.Render("├"))
140- b.WriteString(borderStyle.Render(strings.Repeat("─", halfWidth-1)))
127+ // Status separator: ───...───┴───...───
128+ b.WriteString(borderStyle.Render(strings.Repeat("─", halfWidth)))
141129 b.WriteString(borderStyle.Render("┴"))
142- b.WriteString(borderStyle.Render(strings.Repeat("─", m.width-halfWidth-2)))
143- b.WriteString(borderStyle.Render("┤"))
130+ b.WriteString(borderStyle.Render(strings.Repeat("─", m.width-halfWidth-1)))
144131 b.WriteString("\n")
145132
146- // Status bar: │ master* │<spaces>spinner │
147- statusLeft := borderStyle.Render("│") + " master* " + borderStyle.Render("│")
133+ // Status bar: master* │<spaces>spinner
134+ statusTextStyle := lipgloss.NewStyle().Foreground(ColorGray)
135+ statusLeft := statusTextStyle.Render(" gitbranch/working dir")
148136 spinnerView := strings.TrimSpace(m.spinner.View())
149- statusRight := " " + borderStyle.Render("│")
150137 // Use lipgloss.Width for accurate display width
151138 leftWidth := lipgloss.Width(statusLeft)
152- rightWidth := lipgloss.Width(statusRight)
153139 spinnerWidth := lipgloss.Width(spinnerView)
154- spacesNeeded := m.width - leftWidth - spinnerWidth - rightWidth
140+ spacesNeeded := m.width - leftWidth - spinnerWidth - 1
155141 b.WriteString(statusLeft)
156142 b.WriteString(strings.Repeat(" ", spacesNeeded))
157143 b.WriteString(spinnerView)
158- b.WriteString(statusRight)
159- b.WriteString("\n")
160-
161- // Bottom border: ╰───...───╯
162- b.WriteString(borderStyle.Render("╰"))
163- b.WriteString(borderStyle.Render(strings.Repeat("─", m.width-2)))
164- b.WriteString(borderStyle.Render("╯"))
144+ b.WriteString(" ")
165145
166146 return b.String()
167147 }