xonecas.io
62159
Sy

symb / commit c6ed614

fix: mouseover state not existing

xonecas2026-02-14 c6ed61402afe2dabbdd8c9f259877c459ea12741 parent 069be30

8 files changed

config.toml+21−12
@@ -1,58 +1,67 @@
11 # Symb Configuration File
22
33 # Default provider (optional - if not set, first provider in map is used)
4-default_provider = "zen-pickle"
4+default_provider = "ollama-qwen-small"
55
66 # Ollama providers (local)
77 [providers.ollama-qwen]
88 endpoint = "http://localhost:11434"
99 model = "qwen3:8b"
10-temperature = 0.3
10+temperature = 0.2
1111
1212 [providers.ollama-qwen-small]
1313 endpoint = "http://localhost:11434"
1414 model = "qwen3:4b"
15-temperature = 0.3
15+temperature = 0.2
1616
1717 [providers.ollama-llama]
1818 endpoint = "http://localhost:11434"
1919 model = "llama3.1:8b"
20-temperature = 0.3
20+temperature = 0.2
2121
2222 [providers.ollama-llama32]
2323 endpoint = "http://localhost:11434"
2424 model = "llama3.2"
25-temperature = 0.3
25+temperature = 0.2
2626
2727 [providers.mfd-deepseek]
2828 endpoint = "http://localhost:11434"
2929 model = "MFDoom/deepseek-r1-tool-calling:14b"
30-temperature = 0.3
30+temperature = 0.2
3131
3232 # OpenCode Zen providers (cloud)
3333 [providers.zen-nano]
3434 endpoint = "https://opencode.ai/zen/v1"
3535 model = "gpt-5-nano"
3636 api_key_name = "opencode_zen"
37-temperature = 0.3
37+temperature = 0.2
3838
3939 [providers.zen-pickle]
4040 endpoint = "https://opencode.ai/zen/v1"
4141 model = "big-pickle"
4242 api_key_name = "opencode_zen"
43-temperature = 0.3
43+temperature = 0.2
44+
45+[providers.zen-opus]
46+endpoint = "https://opencode.ai/zen/v1"
47+model = "claude-opus-4-6"
48+api_key_name = "opencode_zen"
49+temperature = 0.2
4450
4551 [mcp]
4652 upstream = ""
4753
48-# UI settings for Symb TUI
4954 [ui]
50-theme = "molokai"
51-split_ratio = 0.5
52-syntax_theme = "monokai"
55+# TODO: Code needs to pull these constants.
56+# TODO: highlight color
57+# selection background
58+# link background
59+# grayscale used
60+# syntax theme
5361
5462 [cache]
5563 ttl_hours = 24
5664
5765 [git]
66+# TODO: When adding worktrees later
5867 enable_sandbox = false
docs/DESIGN.md+0−6
@@ -100,18 +100,12 @@ symbols/scope to LLM as auto-context instead of whole files.
100100
101101 ### Tool improvements:
102102
103-Separate OpenForUser into Read and Show.
104-Read sends the output to the llm.
105-Show can send any content the llm passes to the editor.
106-- Allows LLM to send snippets, git diffs and full file contents to the editor without big refactor.
107-
108103 Update hover iteraction on tool responses for ux and tool call tui output.
109104
110105 - mousing over a tool reply apllies a background to show it's clickable.
111106 - Show tool call arguments expanded: `Grep(pattern="...", ...)`, for all tools.
112107 - Show LSP diagnostics after each mutation call in conversation log, as part of the tool response.
113108
114-
115109 ### Statusbar implementation
116110
117111 (in order: left to right)
internal/constants/constants.go+3−0
@@ -1,5 +1,8 @@
11 package constants
22
3+// TODO: Add constants for:
4+// - highlight color for search matches
5+
36 // SyntaxTheme is the Chroma syntax highlighting theme used in the editor.
47 //
58 // TODO: AFTER MVP -- Add way to toggle theme
internal/tui/mouse.go+36−0
@@ -83,6 +83,11 @@ func (m Model) handleMouse(msg tea.MouseMsg) (tea.Model, tea.Cmd) {
8383 }
8484 }
8585
86+ // --- Hover: clear when outside conv area --------------------------------
87+ if _, isMotion := msg.(tea.MouseMotionMsg); isMotion && !inRect(x, y, m.layout.conv) {
88+ m.hoverConvLine = -1
89+ }
90+
8691 // --- Editor: forward with original coords (left pane starts at 0) -------
8792 if inRect(x, y, m.layout.editor) {
8893 var cmd tea.Cmd
@@ -121,6 +126,15 @@ func (m Model) handleMouse(msg tea.MouseMsg) (tea.Model, tea.Cmd) {
121126 if m.convDragging && m.convSel != nil && totalLines > 0 {
122127 m.convSel.active = m.convPosFromScreen(x, y, totalLines)
123128 }
129+ // Update hover state
130+ if totalLines > 0 {
131+ lineIdx := m.visibleStartLine() + (y - m.layout.conv.Min.Y)
132+ if lineIdx >= 0 && lineIdx < totalLines && m.isClickableLine(lineIdx) {
133+ m.hoverConvLine = lineIdx
134+ } else {
135+ m.hoverConvLine = -1
136+ }
137+ }
124138
125139 case tea.MouseReleaseMsg:
126140 m.convDragging = false
@@ -188,6 +202,28 @@ func (m Model) translateMouse(msg tea.MouseMsg, offX, offY int) tea.Msg {
188202 return msg
189203 }
190204
205+// isClickableLine returns true if the wrapped line at lineIdx is clickable
206+// (tool result entry or contains a file path reference).
207+func (m *Model) isClickableLine(lineIdx int) bool {
208+ lines := m.wrappedConvLines() // ensures convLineSource is also fresh
209+ src := m.convLineSource
210+ if lineIdx < 0 || lineIdx >= len(src) {
211+ return false
212+ }
213+ entryIdx := src[lineIdx]
214+ if entryIdx < 0 || entryIdx >= len(m.convEntries) {
215+ return false
216+ }
217+ if m.convEntries[entryIdx].kind == entryToolResult {
218+ return true
219+ }
220+ if lineIdx >= len(lines) {
221+ return false
222+ }
223+ plain := ansi.Strip(lines[lineIdx])
224+ return filePathRe.MatchString(plain)
225+}
226+
191227 // handleConvClick resolves a click on a wrapped conversation line.
192228 // If the line belongs to a tool result entry, the full content is opened in
193229 // the editor. Otherwise, if the line contains a file path reference
internal/tui/selection.go+7−1
@@ -60,9 +60,15 @@ func (m *Model) selectedConvText() string {
6060 return sb.String()
6161 }
6262
63-// renderConvLine renders a single conversation line with optional selection highlight.
63+// renderConvLine renders a single conversation line with optional hover or selection highlight.
6464 // Returns the styled line. Padding is handled by the caller.
6565 func (m Model) renderConvLine(line string, lineIdx, width int, bgFill lipgloss.Style) string {
66+ // Hover highlight (selection takes priority below)
67+ if m.hoverConvLine == lineIdx && (m.convSel == nil || m.convSel.empty()) {
68+ plain := ansi.Strip(line)
69+ return m.styles.Hover.Render(plain)
70+ }
71+
6672 if m.convSel == nil || m.convSel.empty() {
6773 return line
6874 }
internal/tui/styles.go+7−1
@@ -18,7 +18,8 @@ var (
1818 ColorSurface = ColorHighlight // Selection highlight — reuse accent
1919
2020 // Semantic aliases
21- ColorError = lipgloss.Color("#932e2e")
21+ ColorError = lipgloss.Color("#932e2e")
22+ ColorLinkBg = lipgloss.Color("#111111") // Subtle hover background for clickable elements
2223 )
2324
2425 // Styles holds all pre-built lipgloss styles used across the TUI.
@@ -37,6 +38,9 @@ type Styles struct {
3738 Selection lipgloss.Style // Mouse text selection highlight
3839 BgFill lipgloss.Style // Pure black background fill for empty areas
3940
41+ // Hover
42+ Hover lipgloss.Style // Highlight text on subtle dark bg for clickable hover
43+
4044 // Status bar
4145 StatusText lipgloss.Style // Status bar text
4246 }
@@ -56,6 +60,8 @@ func DefaultStyles() Styles {
5660 Selection: lipgloss.NewStyle().Background(ColorSurface).Foreground(ColorBg),
5761 BgFill: bg,
5862
63+ Hover: lipgloss.NewStyle().Background(ColorLinkBg).Foreground(ColorHighlight),
64+
5965 StatusText: bg.Foreground(ColorDim),
6066 }
6167 }
internal/tui/tui.go+4−0
@@ -197,6 +197,9 @@ type Model struct {
197197 // Conversation selection
198198 convSel *convSelection
199199 convDragging bool
200+
201+ // Hover state: wrapped line index under cursor (-1 = none)
202+ hoverConvLine int
200203 }
201204
202205 // New creates a new TUI model.
@@ -255,6 +258,7 @@ func New(prov provider.Provider, proxy *mcp.Proxy, tools []mcp.Tool, modelID str
255258 cancel: cancel,
256259
257260 streamEntryStart: -1,
261+ hoverConvLine: -1,
258262 }
259263 }
260264
internal/tui/view.go+8−2
@@ -15,7 +15,7 @@ import (
1515 func (m Model) View() tea.View {
1616 v := tea.NewView(m.renderContent())
1717 v.AltScreen = true
18- v.MouseMode = tea.MouseModeCellMotion
18+ v.MouseMode = tea.MouseModeAllMotion
1919 // Keyboard enhancements are automatically enabled in v2 (Kitty protocol).
2020 // This gives us ctrl+shift+c/v disambiguation.
2121 return v
@@ -75,10 +75,16 @@ func (m Model) renderContent() string {
7575 // Selection highlight (character-level)
7676 line = m.renderConvLine(line, lineIdx, rw, bgFill)
7777
78+ // Use hover background for padding when line is hovered
79+ padFill := bgFill
80+ if m.hoverConvLine == lineIdx && (m.convSel == nil || m.convSel.empty()) {
81+ padFill = m.styles.Hover
82+ }
83+
7884 lw := lipgloss.Width(line)
7985 b.WriteString(line)
8086 if lw < rw {
81- b.WriteString(bgFill.Render(strings.Repeat(" ", rw-lw)))
87+ b.WriteString(padFill.Render(strings.Repeat(" ", rw-lw)))
8288 }
8389 } else {
8490 b.WriteString(bgFill.Render(strings.Repeat(" ", rw)))