summaryrefslogtreecommitdiff
path: root/internal/tui/probes
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-05 19:20:18 +0200
committerPaul Buetow <paul@buetow.org>2026-03-05 19:20:18 +0200
commitbab716a6a5931c211fad2f17ee2f67e8d182a7fc (patch)
tree89b16ed3bf85198dd63751d2e1e54537c9340a1b /internal/tui/probes
parent96225fb6159212a8851043a08d781aba721b4e78 (diff)
feat(tui): migrate Bubble Tea stack to charm.land v2
Diffstat (limited to 'internal/tui/probes')
-rw-r--r--internal/tui/probes/model.go10
-rw-r--r--internal/tui/probes/model_test.go8
2 files changed, 9 insertions, 9 deletions
diff --git a/internal/tui/probes/model.go b/internal/tui/probes/model.go
index 5cec2c7..c50c696 100644
--- a/internal/tui/probes/model.go
+++ b/internal/tui/probes/model.go
@@ -6,9 +6,9 @@ import (
"strings"
"unicode/utf8"
- "github.com/charmbracelet/bubbles/textinput"
- tea "github.com/charmbracelet/bubbletea"
- "github.com/charmbracelet/lipgloss"
+ "charm.land/bubbles/v2/textinput"
+ tea "charm.land/bubbletea/v2"
+ "charm.land/lipgloss/v2"
)
// Manager defines the probe operations used by the modal.
@@ -45,7 +45,7 @@ func NewModel(manager Manager) Model {
ti := textinput.New()
ti.Prompt = "/ "
ti.CharLimit = 0
- ti.Width = 28
+ ti.SetWidth(28)
return Model{
manager: manager,
textInput: ti,
@@ -110,7 +110,7 @@ func (m Model) Update(msg tea.Msg) (Model, tea.Cmd) {
m.textInput.CursorEnd()
m.textInput.Focus()
return m, nil
- case " ", "enter":
+ case " ", "space", "enter":
selected := m.selectedSyscall()
if selected == "" {
return m, nil
diff --git a/internal/tui/probes/model_test.go b/internal/tui/probes/model_test.go
index 73a83bc..3a14675 100644
--- a/internal/tui/probes/model_test.go
+++ b/internal/tui/probes/model_test.go
@@ -5,7 +5,7 @@ import (
"ior/internal/probemanager"
- tea "github.com/charmbracelet/bubbletea"
+ tea "charm.land/bubbletea/v2"
)
type fakeManager struct {
@@ -61,7 +61,7 @@ func TestToggleEmitsProbeToggledMsg(t *testing.T) {
states: []probemanager.ProbeState{{Syscall: "read", Active: true}},
}
m := NewModel(fm).Open()
- next, cmd := m.Update(tea.KeyMsg{Type: tea.KeyRunes, Runes: []rune{' '}})
+ next, cmd := m.Update(tea.KeyPressMsg{Code: []rune{' '}[0], Text: string([]rune{' '})})
if cmd == nil {
t.Fatalf("expected toggle command")
}
@@ -90,7 +90,7 @@ func TestBulkKeysApplyGloballyNotOnlyFiltered(t *testing.T) {
m := NewModel(fm).Open()
m.search = "read"
- _, cmd := m.Update(tea.KeyMsg{Type: tea.KeyRunes, Runes: []rune{'n'}})
+ _, cmd := m.Update(tea.KeyPressMsg{Code: []rune{'n'}[0], Text: string([]rune{'n'})})
if cmd == nil {
t.Fatalf("expected bulk off command")
}
@@ -107,7 +107,7 @@ func TestBulkKeysApplyGloballyNotOnlyFiltered(t *testing.T) {
m = NewModel(fm).Open()
m.search = "read"
fm.toggles = nil
- _, cmd = m.Update(tea.KeyMsg{Type: tea.KeyRunes, Runes: []rune{'a'}})
+ _, cmd = m.Update(tea.KeyPressMsg{Code: []rune{'a'}[0], Text: string([]rune{'a'})})
if cmd == nil {
t.Fatalf("expected bulk on command")
}