Skip to content
This repository was archived by the owner on Jan 23, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ require (
github.com/evanw/esbuild v0.25.0
github.com/fsnotify/fsnotify v1.7.0
github.com/google/uuid v1.6.0
github.com/lrstanley/bubblezone v1.0.0
github.com/marcozac/go-jsonc v0.1.1
github.com/mattn/go-isatty v0.0.20
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,6 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
github.com/lrstanley/bubblezone v1.0.0 h1:bIpUaBilD42rAQwlg/4u5aTqVAt6DSRKYZuSdmkr8UA=
github.com/lrstanley/bubblezone v1.0.0/go.mod h1:kcTekA8HE/0Ll2bWzqHlhA2c513KDNLW7uDfDP4Mly8=
github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY=
github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
Expand Down
36 changes: 4 additions & 32 deletions internal/dev/tui.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ import (
"github.com/charmbracelet/bubbles/viewport"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/lipgloss"
"github.com/google/uuid"
zone "github.com/lrstanley/bubblezone"
"golang.org/x/term"
)

Expand Down Expand Up @@ -62,15 +60,14 @@ type spinnerStartMsg struct{}
type spinnerStopMsg struct{}

type logItem struct {
id string
timestamp time.Time
message string
raw string
}

func (i logItem) Title() string { return zone.Mark(i.id, i.message) }
func (i logItem) Title() string { return i.message }
func (i logItem) Description() string { return "" }
func (i logItem) FilterValue() string { return zone.Mark(i.id, i.message) }
func (i logItem) FilterValue() string { return i.message }

type tickMsg time.Time
type addLogMsg logItem
Expand Down Expand Up @@ -213,28 +210,6 @@ func (m *model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
m.spinner = sm
cmd = append(cmd, c)
break
case tea.MouseMsg:
if !m.showhelp && !m.showagents && !m.logList.SettingFilter() && m.selectedLog == nil {
if msg.Button == tea.MouseButtonWheelUp {
m.logList.CursorUp()
} else if msg.Button == tea.MouseButtonWheelDown {
m.logList.CursorDown()
} else if msg.Button == tea.MouseButtonLeft && msg.Action == tea.MouseActionRelease {
// try and find the item that was clicked on
for i, listItem := range m.logList.VisibleItems() {
v, _ := listItem.(logItem)
if zone.Get(v.id).InBounds(msg) {
index := i - 1
if index < 0 {
index = 0
}
m.logList.Select(index)
break
}
}
}
}
break
case tea.KeyMsg:
if msg.Type == tea.KeyCtrlC {
cmd = append(cmd, tea.Quit)
Expand Down Expand Up @@ -406,7 +381,7 @@ func (m *model) View() string {
view = " "
}

return zone.Scan(fmt.Sprintf("%s\n%s\n%s", m.infoBox, view+statusMsgStyle.Render(m.statusMessage), m.logList.View()))
return fmt.Sprintf("%s\n%s\n%s", m.infoBox, view+statusMsgStyle.Render(m.statusMessage), m.logList.View())
}

type Agent struct {
Expand Down Expand Up @@ -509,11 +484,9 @@ func (d *DevModeUI) Start() {
if !d.enabled {
return
}
zone.NewGlobal()
d.program = tea.NewProgram(
d.model,
tea.WithoutSignalHandler(),
tea.WithMouseAllMotion(),
)
d.wg.Add(1)
go func() {
Expand All @@ -536,7 +509,6 @@ func (d *DevModeUI) AddLog(log string, args ...any) {
}
raw := fmt.Sprintf(log, args...)
d.program.Send(addLogMsg{
id: uuid.New().String(),
timestamp: time.Now(),
raw: raw,
message: strings.ReplaceAll(ansiColorStripper.ReplaceAllString(raw, ""), "\n", " "),
Expand Down Expand Up @@ -596,7 +568,7 @@ func (d *DevModeUI) SetSpinner(spinning bool) {
}
}
}()
} else {
} else if d.spinnerCtx != nil {
d.spinnerCancel()
d.spinnerCtx = nil
d.program.Send(spinnerStopMsg{})
Expand Down
Loading