feat: upgrade bubbletea, bubbles, and lipgloss to v2
SonarQube Scan / SonarQube Trigger (push) Successful in 5m41s

- Migrate import paths from github.com/charmbracelet/* to charm.land/*/v2
- Replace tea.KeyMsg with tea.KeyPressMsg in all update handlers and tests
- Replace View() string return type with tea.View using declarative AltScreen
  and MouseMode instead of tea.WithAltScreen()/tea.WithMouseCellMotion()
- Replace tea.WindowSize() with tea.RequestWindowSize in Init()
- Remove tea.ClearScreen from all tea.Batch() calls (removed in v2)
- Replace lipgloss.SetColorProfile(termenv.TrueColor) with
  tea.WithColorProfile(colorprofile.TrueColor) in NewProgram options
- Replace ti.Width assignments with ti.SetWidth() method calls
- Update Redraw() to send tea.WindowSizeMsg{} instead of removed tea.ClearScreen
- Update test assertions to check view.Content instead of view directly
- Remove github.com/muesli/termenv dependency
This commit is contained in:
2026-03-06 14:26:04 +07:00
parent bc8deb86d2
commit e75788286f
11 changed files with 177 additions and 204 deletions
+8 -8
View File
@@ -5,26 +5,26 @@ import (
"strings"
"tunnel_pls/types"
"github.com/charmbracelet/bubbles/key"
"github.com/charmbracelet/bubbles/textinput"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/lipgloss"
"charm.land/bubbles/v2/key"
"charm.land/bubbles/v2/textinput"
tea "charm.land/bubbletea/v2"
"charm.land/lipgloss/v2"
)
func (m *model) slugUpdate(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
func (m *model) slugUpdate(msg tea.KeyPressMsg) (tea.Model, tea.Cmd) {
var cmd tea.Cmd
if m.tunnelType != types.TunnelTypeHTTP {
m.editingSlug = false
m.slugError = ""
return m, tea.Batch(tea.ClearScreen, textinput.Blink)
return m, textinput.Blink
}
switch msg.String() {
case "esc", "ctrl+c":
m.editingSlug = false
m.slugError = ""
return m, tea.Batch(tea.ClearScreen, textinput.Blink)
return m, textinput.Blink
case "enter":
inputValue := m.slugInput.Value()
if err := m.interaction.sessionRegistry.Update(m.interaction.user, types.SessionKey{
@@ -39,7 +39,7 @@ func (m *model) slugUpdate(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
}
m.editingSlug = false
m.slugError = ""
return m, tea.Batch(tea.ClearScreen, textinput.Blink)
return m, textinput.Blink
default:
if key.Matches(msg, m.keymap.random) {
newSubdomain, err := m.randomizer.String(20)