diff options
| author | adamdottv <[email protected]> | 2025-05-13 09:26:54 -0500 |
|---|---|---|
| committer | adamdottv <[email protected]> | 2025-05-13 09:26:54 -0500 |
| commit | 1e9399fbee0c99f09d3eb06d2e2ccc05f8871571 (patch) | |
| tree | d1c3d1d02df7c4d788a69301416e762ce8fdf1ff | |
| parent | e9f74b867fa70399a9120a39974a2f848e9c27da (diff) | |
| download | opencode-1e9399fbee0c99f09d3eb06d2e2ccc05f8871571.tar.gz opencode-1e9399fbee0c99f09d3eb06d2e2ccc05f8871571.zip | |
chore: cleanup
| -rw-r--r-- | internal/tui/components/logs/table.go | 1 | ||||
| -rw-r--r-- | internal/tui/tui.go | 14 |
2 files changed, 15 insertions, 0 deletions
diff --git a/internal/tui/components/logs/table.go b/internal/tui/components/logs/table.go index 47cc6334b..feca0fe55 100644 --- a/internal/tui/components/logs/table.go +++ b/internal/tui/components/logs/table.go @@ -172,6 +172,7 @@ func (i *tableCmp) updateRows() { } rows = append(rows, row) } + i.table.SetRows(rows) } diff --git a/internal/tui/tui.go b/internal/tui/tui.go index ac7a956be..b4a7209e5 100644 --- a/internal/tui/tui.go +++ b/internal/tui/tui.go @@ -7,6 +7,7 @@ import ( "strings" "github.com/charmbracelet/bubbles/key" + "github.com/charmbracelet/bubbles/spinner" tea "github.com/charmbracelet/bubbletea" "github.com/charmbracelet/lipgloss" "github.com/opencode-ai/opencode/internal/app" @@ -171,10 +172,23 @@ func (a appModel) Init() tea.Cmd { return tea.Batch(cmds...) } +func (a appModel) updateAllPages(msg tea.Msg) (tea.Model, tea.Cmd) { + var cmds []tea.Cmd + var cmd tea.Cmd + for id, _ := range a.pages { + a.pages[id], cmd = a.pages[id].Update(msg) + cmds = append(cmds, cmd) + } + return a, tea.Batch(cmds...) +} + func (a appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) { var cmds []tea.Cmd var cmd tea.Cmd switch msg := msg.(type) { + case spinner.TickMsg: + return a.updateAllPages(msg) + case tea.WindowSizeMsg: msg.Height -= 1 // Make space for the status bar a.width, a.height = msg.Width, msg.Height |
