xonecas.io
62159
Sy

symb / commit 05d013d

feat: remove editor pane -> tool view modals

xonecas2026-02-19 05d013d918988e9365e6e9638398701d66b31232 parent a24f3c4

20 files changed

This diff is too big to show in full. The first 1000 lines are below, and every file is listed with its counts.

docs/DESIGN.md+5−12
@@ -25,24 +25,16 @@ throttle on wheel/motion events.
2525 ╰─────────────────────────────────────────────╯
2626 ```
2727
28-// TODO: Remove editor pane. keep the editor for agent input
29-Editor component (`internal/tui/editor`): full editing capability (insert,
30-delete, paste, tab indent) gated behind `ReadOnly` flag. Left pane is read-only
31-viewer. Input pane uses same component with `ReadOnly=false`.
32-
33-Make a generic modal with inputbox + list combo for re-use. Then use that to make the file search one.
34-(It will be used for a command box maybe)
35-
36-// TODO: Drop editor pane, use full with.
37-// Bigger refactor, means making a modal to view tool results
38-// Filesearch modal now becomes an autocomple, an inserts the file into the prompt when sent. User triggers the modal with `@`
28+### Log
3929
4030 Conversation log, an interactive conversation log where the user can click on tool messages to open a modal
4131 and view the contents of that tool call (call and results). Streams results in modal if tool is running.
4232
43-
4433 ### Agent input interactivity:
4534
35+Editor component (`internal/tui/editor`): full editing capability (insert,
36+delete, paste, tab indent)
37+
4638 Agent input, simple multiline textarea with markdown highlighting.
4739
4840 Use a special key `@` to spawn an autocomplete/filesearch modal. This can match files, skills, commands or subagents.
@@ -75,6 +67,7 @@ Status bar, a simple bar showing the current git status current model and animat
7567 Left:
7668
7769 - Show current branch + dirty status in status bar. (needs to be updated every X frames/time) to be responsive
70+- Count of files added/changed/removed in git tracking // TODO
7871
7972 Right (right aligned text)
8073
internal/tui/gitdiff.go+0−111
@@ -1,111 +0,0 @@
1-package tui
2-
3-import (
4- "bytes"
5- "context"
6- "os/exec"
7- "strconv"
8- "strings"
9-
10- "github.com/xonecas/symb/internal/tui/editor"
11-)
12-
13-// GitFileMarkers runs `git diff` for the given file path and returns
14-// gutter markers keyed by 0-indexed line number.
15-// Returns nil (not error) when outside a git repo or on a new/untracked file.
16-func GitFileMarkers(ctx context.Context, filePath string) map[int]editor.GutterMark {
17- cmd := exec.CommandContext(ctx, "git", "diff", "--unified=0", "--", filePath)
18- var stdout bytes.Buffer
19- cmd.Stdout = &stdout
20- // Ignore errors — not-a-repo or untracked files just return nil.
21- _ = cmd.Run()
22-
23- return ParseDiffMarkers(stdout.String())
24-}
25-
26-// ParseDiffMarkers parses unified diff output (--unified=0) and returns
27-// gutter markers keyed by 0-indexed line number in the new file.
28-func ParseDiffMarkers(diff string) map[int]editor.GutterMark {
29- if strings.TrimSpace(diff) == "" {
30- return nil
31- }
32-
33- markers := make(map[int]editor.GutterMark)
34-
35- for _, line := range strings.Split(diff, "\n") {
36- if !strings.HasPrefix(line, "@@ ") {
37- continue
38- }
39-
40- // Parse hunk header: @@ -oldStart[,oldCount] +newStart[,newCount] @@
41- newStart, newCount, oldCount, ok := parseHunkHeader(line)
42- if !ok {
43- continue
44- }
45-
46- if newCount == 0 {
47- // Pure deletion: no new lines, mark the line before as delete.
48- // newStart points to the line after the deletion.
49- row := newStart - 1 // convert to 0-indexed
50- if row < 0 {
51- row = 0
52- }
53- markers[row] = editor.GutterDelete
54- } else if oldCount == 0 {
55- // Pure addition.
56- for i := 0; i < newCount; i++ {
57- markers[newStart-1+i] = editor.GutterAdd
58- }
59- } else {
60- // Modification (some old lines replaced by some new lines).
61- for i := 0; i < newCount; i++ {
62- markers[newStart-1+i] = editor.GutterChange
63- }
64- }
65- }
66-
67- if len(markers) == 0 {
68- return nil
69- }
70- return markers
71-}
72-
73-// parseHunkHeader extracts newStart, newCount, oldCount from a @@ line.
74-// Format: @@ -oldStart[,oldCount] +newStart[,newCount] @@
75-func parseHunkHeader(line string) (newStart, newCount, oldCount int, ok bool) {
76- // Strip leading "@@ " and trailing " @@..."
77- idx := strings.Index(line[3:], " @@")
78- if idx < 0 {
79- return 0, 0, 0, false
80- }
81- header := line[3 : 3+idx] // e.g. "-10,3 +12,5"
82-
83- parts := strings.Fields(header)
84- if len(parts) != 2 {
85- return 0, 0, 0, false
86- }
87-
88- // Parse old range.
89- old := strings.TrimPrefix(parts[0], "-")
90- _, oldCount = parseRange(old)
91-
92- // Parse new range.
93- neu := strings.TrimPrefix(parts[1], "+")
94- newStart, newCount = parseRange(neu)
95-
96- if newStart == 0 {
97- return 0, 0, 0, false
98- }
99- return newStart, newCount, oldCount, true
100-}
101-
102-// parseRange parses "start,count" or "start" (count defaults to 1).
103-func parseRange(s string) (start, count int) {
104- if idx := strings.IndexByte(s, ','); idx >= 0 {
105- start, _ = strconv.Atoi(s[:idx])
106- count, _ = strconv.Atoi(s[idx+1:])
107- return start, count
108- }
109- start, _ = strconv.Atoi(s)
110- return start, 1
111-}
internal/tui/messages.go+0−30
@@ -10,9 +10,6 @@ import (
1010 "time"
1111
1212 tea "charm.land/bubbletea/v2"
13- "github.com/hexops/gotextdiff"
14- "github.com/hexops/gotextdiff/myers"
15- "github.com/hexops/gotextdiff/span"
1613 "github.com/rs/zerolog/log"
1714 "github.com/xonecas/symb/internal/delta"
1815 "github.com/xonecas/symb/internal/llm"
@@ -162,33 +159,6 @@ func (m Model) sendToLLM(userInput string) tea.Cmd {
162159 return func() tea.Msg { return llmUserMsg{content: userInput} }
163160 }
164161
165-func (m Model) sendDiffToLLM() tea.Cmd {
166- return func() tea.Msg {
167- if m.editorFilePath == "" {
168- return nil
169- }
170- onDisk, err := os.ReadFile(m.editorFilePath)
171- if err != nil {
172- return nil
173- }
174- current := m.editor.Value()
175- if current == string(onDisk) {
176- return nil
177- }
178- uri := span.URIFromPath(m.editorFilePath)
179- edits := myers.ComputeEdits(uri, string(onDisk), current)
180- if len(edits) == 0 {
181- return nil
182- }
183- diff := fmt.Sprint(gotextdiff.ToUnified(m.editorFilePath, m.editorFilePath, string(onDisk), edits))
184- if strings.TrimSpace(diff) == "" {
185- return nil
186- }
187- content := "Apply the following diff:\n```diff\n" + diff + "\n```"
188- return llmUserMsg{content: content}
189- }
190-}
191-
192162 func (m Model) waitForLLMUpdate() tea.Cmd {
193163 ch := m.updateChan
194164 return func() tea.Msg {
internal/tui/modal/modal_test.go+4−1
@@ -123,7 +123,10 @@ func TestDebounceFiresSearch(t *testing.T) {
123123 m.HandleMsg(key('x'))
124124 seq := m.seq
125125 // Fire matching debounce.
126- m.HandleMsg(debounceMsg{seq: seq})
126+ _, cmd := m.HandleMsg(debounceMsg{seq: seq})
127+ if cmd != nil {
128+ cmd() // execute the search command
129+ }
127130 if !called {
128131 t.Fatal("expected search to be called")
129132 }
internal/tui/mouse.go+0−126
@@ -1,15 +1,10 @@
11 package tui
22
33 import (
4- "os"
5- "path/filepath"
6- "strconv"
7- "strings"
84 "time"
95
106 tea "charm.land/bubbletea/v2"
117 "charm.land/lipgloss/v2"
12- "github.com/xonecas/symb/internal/highlight"
138 )
149
1510 // ---------------------------------------------------------------------------
@@ -46,21 +41,6 @@ func mouseXY(msg tea.MouseMsg) (int, int) {
4641 func (m Model) handleMouse(msg tea.MouseMsg) (tea.Model, tea.Cmd) {
4742 x, y := mouseXY(msg)
4843
49- // --- Divider drag -------------------------------------------------------
50- if done, handled := m.handleDividerDrag(msg, x, y); handled {
51- return done, nil
52- }
53-
54- // --- Focus switching on click -------------------------------------------
55- m.handleFocusClick(msg, x, y)
56-
57- // --- Editor: forward with original coords (left pane starts at 0) -------
58- if inRect(x, y, m.layout.editor) {
59- var cmd tea.Cmd
60- m.editor, cmd = m.editor.Update(msg)
61- return m, cmd
62- }
63-
6444 // --- Input: translate coords to component-local -------------------------
6545 if inRect(x, y, m.layout.input) {
6646 translated := m.translateMouse(msg, m.layout.input.Min.X, m.layout.input.Min.Y)
@@ -77,49 +57,6 @@ func (m Model) handleMouse(msg tea.MouseMsg) (tea.Model, tea.Cmd) {
7757 return m, nil
7858 }
7959
80-// handleDividerDrag tracks divider click/release and processes drag motion.
81-// Returns (model, true) if the event was consumed by the divider.
82-func (m *Model) handleDividerDrag(msg tea.MouseMsg, x, y int) (Model, bool) {
83- switch ev := msg.(type) {
84- case tea.MouseClickMsg:
85- if ev.Button == tea.MouseLeft && inRect(x, y, m.layout.div) {
86- m.resizingPane = true
87- }
88- case tea.MouseReleaseMsg:
89- m.resizingPane = false
90- default:
91- }
92- if m.resizingPane {
93- if _, ok := msg.(tea.MouseMotionMsg); ok {
94- if x >= minPaneWidth && x <= m.width-minPaneWidth {
95- m.divX = x
96- m.layout = generateLayout(m.width, m.height, m.divX)
97- m.updateComponentSizes()
98- }
99- return *m, true
100- }
101- }
102- return Model{}, false
103-}
104-
105-// handleFocusClick switches focus when clicking in the editor or input panes.
106-func (m *Model) handleFocusClick(msg tea.MouseMsg, x, y int) {
107- click, ok := msg.(tea.MouseClickMsg)
108- if !ok || click.Button != tea.MouseLeft {
109- return
110- }
111- switch {
112- case inRect(x, y, m.layout.editor):
113- m.setFocus(focusEditor)
114- m.agentInput.ClearSelection()
115- m.convSel = nil
116- case inRect(x, y, m.layout.input):
117- m.setFocus(focusInput)
118- m.editor.ClearSelection()
119- m.convSel = nil
120- }
121-}
122-
12360 // handleConvMouse handles mouse events within the conversation pane.
12461 func (m *Model) handleConvMouse(msg tea.MouseMsg, x, y int) tea.Cmd {
12562 lines := m.wrappedConvLines()
@@ -131,7 +68,6 @@ func (m *Model) handleConvMouse(msg tea.MouseMsg, x, y int) tea.Cmd {
13168 cp := m.convPosFromScreen(x, y, totalLines)
13269 m.convDragging = true
13370 m.convSel = &convSelection{anchor: cp, active: cp}
134- m.editor.ClearSelection()
13571 m.agentInput.ClearSelection()
13672 }
13773 case tea.MouseMotionMsg:
@@ -323,65 +259,3 @@ func (m *Model) handleToolResultView(entry convEntry) tea.Cmd {
323259 return openToolViewMsg{title: title, content: entry.full}
324260 }
325261 }
326-
327-// openFileAtCenter opens a file and positions the cursor in the middle of the
328-// read range (for Read tool results).
329-func (m *Model) openFileAtCenter(path string, startLine int, content string) tea.Cmd {
330- if sm := toolResultRangeRe.FindStringSubmatch(content); sm != nil {
331- start, _ := strconv.Atoi(sm[1])
332- end, _ := strconv.Atoi(sm[2])
333- if start > 0 && end >= start {
334- return m.openFile(path, (start+end)/2)
335- }
336- }
337- return m.openFile(path, startLine)
338-}
339-
340-// showRawContent loads raw text content into the editor for viewing.
341-func (m *Model) showRawContent(content, language string) {
342- m.editor.SetValue(content)
343- m.editor.Language = language
344- m.editor.SetGutterMarkers(nil)
345- m.editor.DiagnosticLines = nil
346- m.editorFilePath = ""
347- m.lspErrors = 0
348- m.lspWarnings = 0
349- m.setFocus(focusEditor)
350-}
351-
352-// openFile loads a file into the editor. path is relative to cwd.
353-func (m *Model) openFile(path string, lineNum int) tea.Cmd {
354- absPath, err := filepath.Abs(path)
355- if err != nil {
356- return nil
357- }
358-
359- // Restrict to files within the working directory
360- wd, err := os.Getwd()
361- if err != nil {
362- return nil
363- }
364- rel, err := filepath.Rel(wd, absPath)
365- if err != nil || strings.HasPrefix(rel, "..") {
366- return nil
367- }
368-
369- content, err := os.ReadFile(absPath)
370- if err != nil {
371- return nil
372- }
373-
374- language := highlight.DetectLanguage(path)
375- m.editor.SetValue(string(content))
376- m.editor.Language = language
377- m.editor.SetGutterMarkers(GitFileMarkers(m.ctx, path))
378- m.editor.DiagnosticLines = nil
379- m.editorFilePath = absPath
380- m.lspErrors = 0
381- m.lspWarnings = 0
382- if lineNum > 0 {
383- m.editor.GotoLine(lineNum)
384- }
385- m.setFocus(focusEditor)
386- return nil
387-}
internal/tui/selection.go+0−2
@@ -17,8 +17,6 @@ import (
1717 func (m *Model) copySelection() tea.Cmd {
1818 var text string
1919 switch {
20- case m.editor.HasSelection():
21- text = m.editor.SelectedText()
2220 case m.agentInput.HasSelection():
2321 text = m.agentInput.SelectedText()
2422 case m.convSel != nil && !m.convSel.empty():
internal/tui/testdata/TestLayout/120x40/ANSI.golden+40−40
@@ -1,40 +1,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- │Ask anything... (CTRL+h for keybinds)  
37- │  
38- │  
39-────────────────────────────────────────────────────────────┴───────────────────────────────────────────────────────────
40- test-provider ⠋ 
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+Ask anything... (CTRL+h for keybinds)  
37+  
38+  
39+────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
40+ test-provider/test-model ⠋ 
internal/tui/testdata/TestLayout/120x40/Stripped.golden+40−40
@@ -1,40 +1,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- │Ask anything... (CTRL+h for keybinds)
37- │
38- │
39-────────────────────────────────────────────────────────────┴───────────────────────────────────────────────────────────
40- test-provider ⠋
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+Ask anything... (CTRL+h for keybinds)
37+
38+
39+────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
40+ test-provider/test-model ⠋
internal/tui/testdata/TestLayout/80x24/ANSI.golden+24−24
@@ -1,24 +1,24 @@
1- 1   │ 
2- │ 
3- │ 
4- │ 
5- │ 
6- │ 
7- │ 
8- │ 
9- │ 
10- │ 
11- │ 
12- │ 
13- │ 
14- │ 
15- │ 
16- │ 
17- │ 
18- │ 
19- │───────────────────────────────────────
20- │Ask anything... (CTRL+h for keybinds) 
21- │  
22- │  
23-────────────────────────────────────────┴───────────────────────────────────────
24- test-provider ⠋ 
1+ 
2+ 
3+ 
4+ 
5+ 
6+ 
7+ 
8+ 
9+ 
10+ 
11+ 
12+ 
13+ 
14+ 
15+ 
16+ 
17+ 
18+ 
19+────────────────────────────────────────────────────────────────────────────────
20+Ask anything... (CTRL+h for keybinds)  
21+  
22+  
23+────────────────────────────────────────────────────────────────────────────────
24+ test-provider/test-model ⠋ 
internal/tui/testdata/TestLayout/80x24/Stripped.golden+24−24
@@ -1,24 +1,24 @@
1- 1 │
2- │
3- │
4- │
5- │
6- │
7- │
8- │
9- │
10- │
11- │
12- │
13- │
14- │
15- │
16- │
17- │
18- │
19- │───────────────────────────────────────
20- │Ask anything... (CTRL+h for keybinds)
21- │
22- │
23-────────────────────────────────────────┴───────────────────────────────────────
24- test-provider ⠋
1+
2+
3+
4+
5+
6+
7+
8+
9+
10+
11+
12+
13+
14+
15+
16+
17+
18+
19+────────────────────────────────────────────────────────────────────────────────
20+Ask anything... (CTRL+h for keybinds)
21+
22+
23+────────────────────────────────────────────────────────────────────────────────
24+ test-provider/test-model ⠋
internal/tui/tui.go+8−71
@@ -26,35 +26,26 @@ import (
2626 // layout holds computed rectangles for every TUI region.
2727 // Recomputed from terminal dimensions on every resize.
2828 type layout struct {
29- editor image.Rectangle // Left pane: code viewer
30- conv image.Rectangle // Right pane: conversation log
31- sep image.Rectangle // Right pane: separator between conv and input
32- input image.Rectangle // Right pane: agent input
33- div image.Rectangle // Vertical divider column (1-wide)
29+ conv image.Rectangle // Conversation log
30+ sep image.Rectangle // Separator between conv and input
31+ input image.Rectangle // Agent input
3432 }
3533
3634 const (
3735 inputRows = 3 // Agent input height
3836 statusRows = 2 // Status separator + status bar
39- minPaneWidth = 20
4037 maxDisplayTurns = 5 // Max conversation turns kept in memory; older turns live in DB
4138
4239 roleAssistant = "assistant"
4340 )
4441
45-// generateLayout computes all regions from terminal size and divider position.
46-func generateLayout(width, height, divX int) layout {
42+// generateLayout computes all regions from terminal size.
43+func generateLayout(width, height int) layout {
4744 contentH := height - statusRows
4845 if contentH < 1 {
4946 contentH = 1
5047 }
5148
52- rightX := divX + 1
53- rightW := width - rightX
54- if rightW < 1 {
55- rightW = 1
56- }
57-
5849 sepY := contentH - inputRows - 1
5950 if sepY < 0 {
6051 sepY = 0
@@ -65,11 +56,9 @@ func generateLayout(width, height, divX int) layout {
6556 }
6657
6758 return layout{
68- editor: image.Rect(0, 0, divX, contentH),
69- div: image.Rect(divX, 0, divX+1, contentH),
70- conv: image.Rect(rightX, 0, rightX+rightW, sepY),
71- sep: image.Rect(rightX, sepY, rightX+rightW, sepY+1),
72- input: image.Rect(rightX, inputY, rightX+rightW, inputY+inputRows),
59+ conv: image.Rect(0, 0, width, sepY),
60+ sep: image.Rect(0, sepY, width, sepY+1),
61+ input: image.Rect(0, inputY, width, inputY+inputRows),
7362 }
7463 }
7564
@@ -78,30 +67,6 @@ func inRect(x, y int, r image.Rectangle) bool {
7867 return image.Pt(x, y).In(r)
7968 }
8069
81-// ---------------------------------------------------------------------------
82-// Focus
83-// ---------------------------------------------------------------------------
84-
85-type focus int
86-
87-const (
88- focusInput focus = iota // Default: agent input has focus
89- focusEditor // Code viewer has focus
90-)
91-
92-// setFocus switches focus between editor and input panes.
93-func (m *Model) setFocus(f focus) {
94- m.focus = f
95- switch f {
96- case focusEditor:
97- m.agentInput.Blur()
98- m.editor.Focus()
99- case focusInput:
100- m.editor.Blur()
101- m.agentInput.Focus()
102- }
103-}
104-
10570 // ---------------------------------------------------------------------------
10671 // Conversation types
10772 // ---------------------------------------------------------------------------
@@ -186,13 +151,10 @@ type Model struct {
186151 width, height int
187152
188153 // Sub-models
189- editor editor.Model
190154 agentInput editor.Model
191155
192156 // Layout
193157 layout layout
194- divX int // Divider X position (resizable)
195- focus focus
196158 styles Styles
197159
198160 // LLM
@@ -239,9 +201,6 @@ type Model struct {
239201 fileTracker FileReadResetter // for clearing read-tracking on undo
240202 tsIndex *treesitter.Index
241203
242- // Editor state
243- editorFilePath string // absolute path of the file currently shown in the editor
244-
245204 // File finder modal
246205 fileModal *modal.Model
247206 // Keybinds modal
@@ -260,9 +219,6 @@ type Model struct {
260219 // Pending tool calls: maps tool call ID → arguments for line extraction
261220 pendingToolCalls map[string]provider.ToolCall
262221
263- // Mouse state
264- resizingPane bool
265-
266222 // Conversation selection
267223 convSel *convSelection
268224 convDragging bool
@@ -277,8 +233,6 @@ type Model struct {
277233 providerConfigName string // TOML config key (e.g. "zen-pickle")
278234 gitBranch string // Current git branch name
279235 gitDirty bool // Working tree has uncommitted changes
280- lspErrors int // Error count for current editor file
281- lspWarnings int // Warning count for current editor file
282236 lastNetError string // Last LLM network error (truncated for display)
283237 llmInFlight bool // True while an LLM turn is in progress
284238
@@ -297,21 +251,6 @@ func New(prov provider.Provider, proxy *mcp.Proxy, tools []mcp.Tool, modelID str
297251
298252 selStyle := sty.Selection
299253
300- ed := editor.New()
301- ed.ShowLineNumbers = true
302- ed.ReadOnly = false
303- ed.Language = "markdown"
304- ed.SyntaxTheme = syntaxTheme
305- ed.CursorStyle = cursorStyle
306- ed.SelectionStyle = selStyle
307- ed.LineNumStyle = lipgloss.NewStyle().Foreground(ColorBorder)
308- ed.BgColor = ColorBg
309- ed.MarkAddStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("#4ec964")).Background(ColorBg)
310- ed.MarkChgStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("#e5c07b")).Background(ColorBg)
311- ed.MarkDelStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("#e06c75")).Background(ColorBg)
312- ed.DiagErrStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("#e06c75"))
313- ed.DiagWarnStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("#e5c07b"))
314-
315254 ai := editor.New()
316255 ai.Placeholder = "Ask anything... (CTRL+h for keybinds)"
317256 ai.SubmitOnEnter = true
@@ -343,10 +282,8 @@ func New(prov provider.Provider, proxy *mcp.Proxy, tools []mcp.Tool, modelID str
343282 }
344283
345284 return Model{
346- editor: ed,
347285 agentInput: ai,
348286 styles: sty,
349- focus: focusInput,
350287
351288 provider: prov,
352289 mcpProxy: proxy,
internal/tui/update.go+5−15
@@ -116,15 +116,11 @@ func (m Model) handleSystemEvent(msg tea.Msg) (tea.Model, tea.Cmd, bool) {
116116 return m, nil, false
117117 }
118118
119-// forwardToSubModels sends a non-handled message to sub-editors.
119+// forwardToSubModels sends a non-handled message to sub-models.
120120 func (m Model) forwardToSubModels(msg tea.Msg) (tea.Model, tea.Cmd) {
121- var cmds []tea.Cmd
122121 var cmd tea.Cmd
123- m.editor, cmd = m.editor.Update(msg)
124- cmds = append(cmds, cmd)
125122 m.agentInput, cmd = m.agentInput.Update(msg)
126- cmds = append(cmds, cmd)
127- return m, tea.Batch(cmds...)
123+ return m, cmd
128124 }
129125
130126 func (m Model) handlePaste(msg tea.Msg) tea.Model {
@@ -141,17 +137,11 @@ func (m Model) handlePaste(msg tea.Msg) tea.Model {
141137 return m
142138 }
143139
144-// insertPaste inserts pasted text into the focused component.
140+// insertPaste inserts pasted text into the agent input.
145141 func (m *Model) insertPaste(text string) {
146142 if text == "" {
147143 return
148144 }
149- switch m.focus {
150- case focusInput:
151- m.agentInput.DeleteSelection()
152- m.agentInput.InsertText(text)
153- case focusEditor:
154- m.editor.DeleteSelection()
155- m.editor.InsertText(text)
156- }
145+ m.agentInput.DeleteSelection()
146+ m.agentInput.InsertText(text)
157147 }
internal/tui/update_keypress.go+2−14
@@ -19,7 +19,6 @@ func (m *Model) keyPressHandlers() map[string]func(*Model) (Model, tea.Cmd, bool
1919 "ctrl+c": (*Model).handleCtrlC,
2020 "ctrl+shift+c": (*Model).handleCtrlShiftC,
2121 "ctrl+shift+v": (*Model).handleCtrlShiftV,
22- "ctrl+s": (*Model).handleCtrlS,
2322 "esc": (*Model).handleEsc,
2423 "enter": (*Model).handleEnter,
2524 "ctrl+f": (*Model).handleCtrlF,
@@ -43,24 +42,13 @@ func (m *Model) handleCtrlShiftV() (Model, tea.Cmd, bool) {
4342 return *m, tea.ReadClipboard, true
4443 }
4544
46-func (m *Model) handleCtrlS() (Model, tea.Cmd, bool) {
47- if m.turnCancel == nil && !m.turnPending && !m.undoInFlight {
48- return *m, m.sendDiffToLLM(), true
49- }
50- return *m, nil, true
51-}
52-
5345 func (m *Model) handleEsc() (Model, tea.Cmd, bool) {
5446 if m.llmInFlight {
5547 cmd := m.cancelTurnCmd()
5648 m.cancelTurn()
5749 return *m, tea.Batch(cmd, m.waitForLLMUpdate()), true
5850 }
59- if m.focus == focusInput {
60- m.agentInput.Blur()
61- } else {
62- m.editor.Blur()
63- }
51+ m.agentInput.Blur()
6452 return *m, nil, true
6553 }
6654
@@ -76,7 +64,7 @@ func (m *Model) cancelProgramCmd() tea.Cmd {
7664 }
7765
7866 func (m *Model) handleEnter() (Model, tea.Cmd, bool) {
79- if m.focus == focusInput && m.agentInput.Value() != "" && m.turnCancel == nil && !m.turnPending && !m.undoInFlight {
67+ if m.agentInput.Value() != "" && m.turnCancel == nil && !m.turnPending && !m.undoInFlight {
8068 userMsg := m.agentInput.Value()
8169 m.agentInput.Reset()
8270 return *m, m.sendToLLM(userMsg), true
internal/tui/update_modals.go+3−8
@@ -48,12 +48,11 @@ func (m *Model) openKeybindsModal() {
4848 {Name: "ctrl+h", Desc: "keybinds"},
4949 {Name: "ctrl+f", Desc: "file search"},
5050 {Name: "ctrl+m", Desc: "switch model"},
51- {Name: "ctrl+s", Desc: "save editor (send diff) [experimental]"},
5251 {Name: "ctrl+shift+c", Desc: "copy selection"},
5352 {Name: "ctrl+shift+v", Desc: "paste"},
5453 {Name: "ctrl+c", Desc: "quit"},
5554 {Name: "esc", Desc: "cancel/blur"},
56- {Name: "enter", Desc: "send message in input, newline on editor"},
55+ {Name: "enter", Desc: "send message"},
5756 {Name: "shift+enter", Desc: "newline in input"},
5857 {Name: "tab", Desc: "indent"},
5958 {Name: "backspace", Desc: "delete backward"},
@@ -119,14 +118,10 @@ func (m *Model) updateFileModal(msg tea.Msg) (Model, tea.Cmd, bool) {
119118 return *m, nil, false
120119 }
121120 action, cmd := m.fileModal.HandleMsg(msg)
122- switch a := action.(type) {
123- case modal.ActionClose:
121+ switch action.(type) {
122+ case modal.ActionClose, modal.ActionSelect:
124123 m.fileModal = nil
125124 return *m, nil, true
126- case modal.ActionSelect:
127- m.fileModal = nil
128- openCmd := m.openFile(a.Item.Name, 0)
129- return *m, openCmd, true
130125 }
131126 if cmd != nil {
132127 return *m, cmd, true
internal/tui/update_resize.go+1−12
@@ -7,23 +7,12 @@ import (
77 // handleResize applies a window size change and re-derives layout.
88 func (m *Model) handleResize(msg tea.WindowSizeMsg) {
99 m.width, m.height = msg.Width, msg.Height
10- if m.divX == 0 {
11- m.divX = m.width / 2
12- }
13- if m.divX < minPaneWidth {
14- m.divX = minPaneWidth
15- }
16- if m.divX > m.width-minPaneWidth {
17- m.divX = m.width - minPaneWidth
18- }
19- m.layout = generateLayout(m.width, m.height, m.divX)
10+ m.layout = generateLayout(m.width, m.height)
2011 m.updateComponentSizes()
2112 }
2213
2314 // updateComponentSizes pushes layout dimensions to sub-models.
2415 func (m *Model) updateComponentSizes() {
25- m.editor.SetWidth(m.layout.editor.Dx())
26- m.editor.SetHeight(m.layout.editor.Dy())
2716 m.agentInput.SetWidth(m.layout.input.Dx() - 2) // padding for border
2817 m.agentInput.SetHeight(inputRows)
2918 }
internal/tui/update_status.go+2−17
@@ -4,23 +4,8 @@ import (
44 tea "charm.land/bubbletea/v2"
55 )
66
7-// handleLSPDiag applies LSP diagnostic markers when the file matches the editor.
8-func (m *Model) handleLSPDiag(msg LSPDiagnosticsMsg) Model {
9- if msg.FilePath == m.editorFilePath {
10- m.editor.DiagnosticLines = msg.Lines
11- // Count errors (severity 1) and warnings (severity 2) for the statusbar.
12- errs, warns := 0, 0
13- for _, sev := range msg.Lines {
14- switch sev {
15- case 1:
16- errs++
17- case 2:
18- warns++
19- }
20- }
21- m.lspErrors = errs
22- m.lspWarnings = warns
23- }
7+// handleLSPDiag is a no-op now that the editor pane is removed.
8+func (m *Model) handleLSPDiag(_ LSPDiagnosticsMsg) Model {
249 return *m
2510 }
2611
internal/tui/view.go+1−5
@@ -34,20 +34,16 @@ func (m Model) renderContent() string {
3434 return ""
3535 }
3636
37- ly := m.layout
3837 contentH := m.height - statusRows
3938 var b strings.Builder
4039
41- editorLines := strings.Split(m.editor.View(), "\n")
4240 inputLines := strings.Split(m.agentInput.View(), "\n")
4341 convLines := m.wrappedConvLines()
4442 startLine := m.visibleStartLine()
4543 bgFill := m.styles.BgFill
4644
4745 for row := 0; row < contentH; row++ {
48- m.renderEditorRow(&b, editorLines, row, ly.editor.Dx(), bgFill)
49- b.WriteString(m.styles.Border.Render("│"))
50- m.renderRightPaneRow(&b, convLines, inputLines, row, startLine, bgFill)
46+ m.renderPaneRow(&b, convLines, inputLines, row, startLine, bgFill)
5147 b.WriteByte('\n')
5248 }
5349
internal/tui/view_editor.go+0−26
@@ -1,26 +0,0 @@
1-package tui
2-
3-import (
4- "strings"
5-
6- "charm.land/lipgloss/v2"
7- "github.com/charmbracelet/x/ansi"
8-)
9-
10-// renderEditorRow writes one row of the left (editor) pane to b.
11-func (m Model) renderEditorRow(b *strings.Builder, editorLines []string, row, edW int, bgFill lipgloss.Style) {
12- if row < len(editorLines) {
13- line := editorLines[row]
14- lw := lipgloss.Width(line)
Cut short: this commit's diff is over 1000 lines.
internal/tui/view_rightpane.go+2−2
Cut short: this commit's diff is over 1000 lines.
internal/tui/view_status.go+1−19
Cut short: this commit's diff is over 1000 lines.