summaryrefslogtreecommitdiffhomepage
path: root/internal/tui/components
diff options
context:
space:
mode:
authorKujtim Hoxha <[email protected]>2025-04-03 17:36:40 +0200
committerKujtim Hoxha <[email protected]>2025-04-03 17:38:28 +0200
commit795b3692197acf75ff13ed8a14c9a11d4b32ec5f (patch)
tree186dfea8eb2aa1f87a9960f415ac852f3768982e /internal/tui/components
parentcfdd687216799cb5b47f099f1e7cd5dd16b3bdd0 (diff)
downloadopencode-795b3692197acf75ff13ed8a14c9a11d4b32ec5f.tar.gz
opencode-795b3692197acf75ff13ed8a14c9a11d4b32ec5f.zip
small fixes
Diffstat (limited to 'internal/tui/components')
-rw-r--r--internal/tui/components/core/button.go6
-rw-r--r--internal/tui/components/repl/messages.go6
2 files changed, 3 insertions, 9 deletions
diff --git a/internal/tui/components/core/button.go b/internal/tui/components/core/button.go
index 102957e0e..090fbc1ee 100644
--- a/internal/tui/components/core/button.go
+++ b/internal/tui/components/core/button.go
@@ -67,7 +67,7 @@ const (
// ButtonMsg is sent when a button is clicked
type ButtonMsg struct {
ID string
- Payload interface{}
+ Payload any
}
// ButtonCmp represents a clickable button component
@@ -79,7 +79,7 @@ type ButtonCmp struct {
state ButtonState
variant ButtonVariant
keyMap ButtonKeyMap
- payload interface{}
+ payload any
style lipgloss.Style
hoverStyle lipgloss.Style
}
@@ -107,7 +107,7 @@ func (b *ButtonCmp) WithVariant(variant ButtonVariant) *ButtonCmp {
}
// WithPayload sets the payload sent with button events
-func (b *ButtonCmp) WithPayload(payload interface{}) *ButtonCmp {
+func (b *ButtonCmp) WithPayload(payload any) *ButtonCmp {
b.payload = payload
return b
}
diff --git a/internal/tui/components/repl/messages.go b/internal/tui/components/repl/messages.go
index 2b5e599aa..30ce4be7c 100644
--- a/internal/tui/components/repl/messages.go
+++ b/internal/tui/components/repl/messages.go
@@ -5,7 +5,6 @@ import (
"fmt"
"sort"
"strings"
- "time"
"github.com/charmbracelet/bubbles/key"
"github.com/charmbracelet/bubbles/viewport"
@@ -41,7 +40,6 @@ type messagesCmp struct {
height int
focused bool
cachedView string
- timeLoaded time.Time
}
func (m *messagesCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
@@ -424,9 +422,6 @@ func (m *messagesCmp) projectDiagnostics() string {
}
if len(errorDiagnostics) == 0 && len(warnDiagnostics) == 0 && len(hintDiagnostics) == 0 && len(infoDiagnostics) == 0 {
- if time.Since(m.timeLoaded) < time.Second*10 {
- return "Loading diagnostics..."
- }
return "No diagnostics"
}
@@ -496,7 +491,6 @@ func (m *messagesCmp) SetSize(width int, height int) {
}
func (m *messagesCmp) Init() tea.Cmd {
- m.timeLoaded = time.Now()
return nil
}