refactor(ui): migrate to bubbletea v2 and lipgloss v2

Switch imports to charm.land/bubbletea/v2 and charm.land/lipgloss/v2.
View now returns tea.View with AltScreen set, key handling uses
KeyPressMsg, and colour fields use image/color.
This commit is contained in:
2026-10-04 10:14:28 +01:00
parent 985220b6e6
commit f7287b3ef6
12 changed files with 223 additions and 224 deletions
+4 -4
View File
@@ -4,7 +4,7 @@ import (
"errors"
"testing"
tea "github.com/charmbracelet/bubbletea"
tea "charm.land/bubbletea/v2"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
@@ -12,7 +12,7 @@ import (
func typeKeys(t *testing.T, m model, text string) {
t.Helper()
for _, r := range text {
m.handleAddWizardKeys(tea.KeyMsg{Type: tea.KeyRunes, Runes: []rune{r}})
m.handleAddWizardKeys(tea.KeyPressMsg{Text: string(r)})
}
}
@@ -87,7 +87,7 @@ func TestManualNamespace_BackFromLaterStepRestoresTextInput(t *testing.T) {
m := newModelWithWizard(StepSelectResourceType)
m.ui.addWizard.namespaceManual = true
m.handleAddWizardKeys(tea.KeyMsg{Type: tea.KeyEsc})
m.handleAddWizardKeys(tea.KeyPressMsg{Code: tea.KeyEscape})
w := m.ui.addWizard
assert.Equal(t, StepSelectNamespace, w.step)
@@ -98,7 +98,7 @@ func TestKeysJK_StillNavigateInListMode(t *testing.T) {
m := newModelWithWizard(StepSelectResourceType)
m.ui.addWizard.inputMode = InputModeList
m.handleAddWizardKeys(tea.KeyMsg{Type: tea.KeyRunes, Runes: []rune{'j'}})
m.handleAddWizardKeys(tea.KeyPressMsg{Text: string('j')})
assert.Equal(t, 1, m.ui.addWizard.cursor)
}