diff options
| author | Kujtim Hoxha <[email protected]> | 2025-05-01 12:48:19 +0200 |
|---|---|---|
| committer | adamdottv <[email protected]> | 2025-05-01 11:07:47 -0500 |
| commit | e4680caebb7235988450f6b1d59da2e46a78e567 (patch) | |
| tree | 94b4a560276748b86c67684b6c3053d587076787 /internal/tui/components | |
| parent | e760d28c5a125f7f4de30cf0491be53e32bb897d (diff) | |
| download | opencode-e4680caebb7235988450f6b1d59da2e46a78e567.tar.gz opencode-e4680caebb7235988450f6b1d59da2e46a78e567.zip | |
some small fixes
Diffstat (limited to 'internal/tui/components')
| -rw-r--r-- | internal/tui/components/chat/message.go | 5 | ||||
| -rw-r--r-- | internal/tui/components/core/status.go | 4 | ||||
| -rw-r--r-- | internal/tui/components/logs/table.go | 8 |
3 files changed, 6 insertions, 11 deletions
diff --git a/internal/tui/components/chat/message.go b/internal/tui/components/chat/message.go index f8d721f19..5163ec735 100644 --- a/internal/tui/components/chat/message.go +++ b/internal/tui/components/chat/message.go @@ -30,11 +30,6 @@ const ( maxResultHeight = 10 ) -// getDiffWidth returns the width for the diff formatting -func getDiffWidth(width int) int { - return width -} - type uiMessage struct { ID string messageType uiMessageType diff --git a/internal/tui/components/core/status.go b/internal/tui/components/core/status.go index ca02265e1..28120a430 100644 --- a/internal/tui/components/core/status.go +++ b/internal/tui/components/core/status.go @@ -21,7 +21,7 @@ import ( type StatusCmp interface { tea.Model - SetHelpMsg(string) + SetHelpWidgetMsg(string) } type statusCmp struct { @@ -263,7 +263,7 @@ func (m statusCmp) model() string { Render(model.Name) } -func (m statusCmp) SetHelpMsg(s string) { +func (m statusCmp) SetHelpWidgetMsg(s string) { // Update the help widget text using the getHelpWidget function helpWidget = getHelpWidget(s) } diff --git a/internal/tui/components/logs/table.go b/internal/tui/components/logs/table.go index b9386cb73..8d59f967f 100644 --- a/internal/tui/components/logs/table.go +++ b/internal/tui/components/logs/table.go @@ -63,6 +63,9 @@ func (i *tableCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) { func (i *tableCmp) View() string { t := theme.CurrentTheme() + defaultStyles := table.DefaultStyles() + defaultStyles.Selected = defaultStyles.Selected.Foreground(t.Primary()) + i.table.SetStyles(defaultStyles) return styles.ForceReplaceBackgroundWithLipgloss(i.table.View(), t.Background()) } @@ -116,7 +119,6 @@ func (i *tableCmp) setRows() { } func NewLogsTable() TableComponent { - t := theme.CurrentTheme() columns := []table.Column{ {Title: "ID", Width: 4}, {Title: "Time", Width: 4}, @@ -124,11 +126,9 @@ func NewLogsTable() TableComponent { {Title: "Message", Width: 10}, {Title: "Attributes", Width: 10}, } - defaultStyles := table.DefaultStyles() - defaultStyles.Selected = defaultStyles.Selected.Foreground(t.Primary()) + tableModel := table.New( table.WithColumns(columns), - table.WithStyles(defaultStyles), ) tableModel.Focus() return &tableCmp{ |
