Files
tunnel-please/session/interaction/coming_soon.go
T
bagas e75788286f
SonarQube Scan / SonarQube Trigger (push) Successful in 5m41s
feat: upgrade bubbletea, bubbles, and lipgloss to v2
- 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
2026-03-06 14:26:04 +07:00

84 lines
1.9 KiB
Go

package interaction
import (
"strings"
"charm.land/bubbles/v2/textinput"
tea "charm.land/bubbletea/v2"
"charm.land/lipgloss/v2"
)
func (m *model) comingSoonUpdate(msg tea.KeyPressMsg) (tea.Model, tea.Cmd) {
m.showingComingSoon = false
return m, textinput.Blink
}
func (m *model) comingSoonView() string {
isCompact := shouldUseCompactLayout(m.width, 60)
var boxPadding int
var boxMargin int
if isCompact {
boxPadding = 1
boxMargin = 1
} else {
boxPadding = 3
boxMargin = 2
}
titleStyle := lipgloss.NewStyle().
Bold(true).
Foreground(lipgloss.Color("#7D56F4")).
PaddingTop(1).
PaddingBottom(1)
messageBoxWidth := getResponsiveWidth(m.width, 10, 30, 60)
messageBoxStyle := lipgloss.NewStyle().
Foreground(lipgloss.Color("#FAFAFA")).
Background(lipgloss.Color("#1A1A2E")).
Bold(true).
Border(lipgloss.RoundedBorder()).
BorderForeground(lipgloss.Color("#7D56F4")).
Padding(1, boxPadding).
MarginTop(boxMargin).
MarginBottom(boxMargin).
Width(messageBoxWidth).
Align(lipgloss.Center)
helpStyle := lipgloss.NewStyle().
Foreground(lipgloss.Color("#666666")).
Italic(true).
MarginTop(1)
var b strings.Builder
b.WriteString("\n\n")
var title string
if shouldUseCompactLayout(m.width, 40) {
title = "Coming Soon"
} else {
title = "⏳ Coming Soon"
}
b.WriteString(titleStyle.Render(title))
b.WriteString("\n\n")
var message string
if shouldUseCompactLayout(m.width, 50) {
message = "Coming soon!\nStay tuned."
} else {
message = "🚀 This feature is coming very soon!\n Stay tuned for updates."
}
b.WriteString(messageBoxStyle.Render(message))
b.WriteString("\n\n")
var helpText string
if shouldUseCompactLayout(m.width, 60) {
helpText = "Press any key..."
} else {
helpText = "This message will disappear in 5 seconds or press any key..."
}
b.WriteString(helpStyle.Render(helpText))
return b.String()
}