feat: upgrade bubbletea to v2
SonarQube Scan / SonarQube Trigger (push) Failing after 2m16s

This commit is contained in:
2026-03-20 18:06:08 +07:00
parent 9dc3711875
commit 93d4fb48e7
9 changed files with 90 additions and 86 deletions
+7 -10
View File
@@ -4,9 +4,8 @@ import (
"strings"
"time"
tea "charm.land/bubbletea/v2"
"github.com/charmbracelet/bubbles/key"
"github.com/charmbracelet/bubbles/textinput"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/lipgloss"
)
@@ -17,24 +16,22 @@ func (m *model) handleCommandSelection(item commandItem) (tea.Model, tea.Cmd) {
m.editingSlug = true
m.slugInput.SetValue(m.interaction.slug.String())
m.slugInput.Focus()
return m, tea.Batch(tea.ClearScreen, textinput.Blink)
return m, nil
case "tunnel-type":
m.showingCommands = false
m.showingComingSoon = true
return m, tea.Batch(tickCmd(5*time.Second), tea.ClearScreen, textinput.Blink)
return m, tickCmd(5 * time.Second)
default:
m.showingCommands = false
return m, nil
}
}
func (m *model) commandsUpdate(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
var cmd tea.Cmd
func (m *model) commandsUpdate(msg tea.KeyPressMsg) (tea.Model, tea.Cmd) {
switch {
case key.Matches(msg, m.keymap.quit), msg.String() == "esc":
m.showingCommands = false
return m, tea.Batch(tea.ClearScreen, textinput.Blink)
return m, nil
case msg.String() == "enter":
selectedItem := m.commandList.SelectedItem()
if selectedItem != nil {
@@ -42,8 +39,8 @@ func (m *model) commandsUpdate(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
return m.handleCommandSelection(item)
}
}
m.commandList, cmd = m.commandList.Update(msg)
return m, cmd
m.commandList, _ = m.commandList.Update(msg)
return m, nil
}
func (m *model) commandsView() string {