feat: add automatic version update checking and notifications

- Add internal/version module for GitHub release checking
- Integrate async version check in Bubble Tea UI
- Display update notification in main interface
- Add version check to --version/-v command output
- Include comprehensive version comparison and error handling
- Add unit tests for version parsing and comparison logic
This commit is contained in:
2025-09-08 14:46:05 +02:00
parent ef075e74cf
commit 5c832ce26f
8 changed files with 331 additions and 15 deletions

View File

@@ -16,7 +16,7 @@ import (
)
// NewModel creates a new TUI model with the given SSH hosts
func NewModel(hosts []config.SSHHost, configFile string) Model {
func NewModel(hosts []config.SSHHost, configFile, currentVersion string) Model {
// Initialize the history manager
historyManager, err := history.NewHistoryManager()
if err != nil {
@@ -38,6 +38,7 @@ func NewModel(hosts []config.SSHHost, configFile string) Model {
pingManager: pingManager,
sortMode: SortByName,
configFile: configFile,
currentVersion: currentVersion,
styles: styles,
width: 80,
height: 24,
@@ -136,8 +137,8 @@ func NewModel(hosts []config.SSHHost, configFile string) Model {
}
// RunInteractiveMode starts the interactive TUI interface
func RunInteractiveMode(hosts []config.SSHHost, configFile string) error {
m := NewModel(hosts, configFile)
func RunInteractiveMode(hosts []config.SSHHost, configFile, currentVersion string) error {
m := NewModel(hosts, configFile, currentVersion)
// Start the application in alt screen mode for clean output
p := tea.NewProgram(m, tea.WithAltScreen())