refactor(update): remove legacy update check

Amolith created

Assisted-by: Claude Opus 4.5 via Crush

Change summary

internal/app/app.go            | 21 ---------------------
internal/pubsub/events.go      |  7 -------
internal/tui/tui.go            | 14 --------------
internal/update/update_test.go |  1 -
4 files changed, 43 deletions(-)

Detailed changes

internal/app/app.go 🔗

@@ -33,8 +33,6 @@ import (
 	"github.com/charmbracelet/crush/internal/term"
 	"github.com/charmbracelet/crush/internal/tui/components/anim"
 	"github.com/charmbracelet/crush/internal/tui/styles"
-	"github.com/charmbracelet/crush/internal/update"
-	"github.com/charmbracelet/crush/internal/version"
 	"github.com/charmbracelet/x/ansi"
 	"github.com/charmbracelet/x/exp/charmtone"
 )
@@ -94,9 +92,6 @@ func New(ctx context.Context, conn *sql.DB, cfg *config.Config) (*App, error) {
 	// Initialize LSP clients in the background.
 	app.initLSPClients(ctx)
 
-	// Check for updates in the background.
-	go app.checkForUpdates(ctx)
-
 	go func() {
 		slog.Info("Initializing MCP clients")
 		mcp.Initialize(ctx, app.Permissions, cfg)
@@ -410,19 +405,3 @@ func (app *App) Shutdown() {
 	}
 	wg.Wait()
 }
-
-// checkForUpdates checks for available updates.
-func (app *App) checkForUpdates(ctx context.Context) {
-	checkCtx, cancel := context.WithTimeout(ctx, 30*time.Second)
-	defer cancel()
-
-	info, err := update.Check(checkCtx, version.Version, update.Default)
-	if err != nil || !info.Available() {
-		return
-	}
-	app.events <- pubsub.UpdateAvailableMsg{
-		CurrentVersion: info.Current,
-		LatestVersion:  info.Latest,
-		IsDevelopment:  info.IsDevelopment(),
-	}
-}

internal/pubsub/events.go 🔗

@@ -26,10 +26,3 @@ type (
 		Publish(EventType, T)
 	}
 )
-
-// UpdateAvailableMsg is sent when a new version is available.
-type UpdateAvailableMsg struct {
-	CurrentVersion string
-	LatestVersion  string
-	IsDevelopment  bool
-}

internal/tui/tui.go 🔗

@@ -384,20 +384,6 @@ func (a *appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
 			cmds = append(cmds, pageCmd)
 		}
 		return a, tea.Batch(cmds...)
-	// Update Available
-	case pubsub.UpdateAvailableMsg:
-		// Show update notification in status bar
-		statusMsg := fmt.Sprintf("Crush update available: v%s → v%s.", msg.CurrentVersion, msg.LatestVersion)
-		if msg.IsDevelopment {
-			statusMsg = fmt.Sprintf("This is a development version of Crush. The latest version is v%s.", msg.LatestVersion)
-		}
-		s, statusCmd := a.status.Update(util.InfoMsg{
-			Type: util.InfoTypeUpdate,
-			Msg:  statusMsg,
-			TTL:  10 * time.Second,
-		})
-		a.status = s.(status.StatusCmp)
-		return a, statusCmd
 	}
 	s, _ := a.status.Update(msg)
 	a.status = s.(status.StatusCmp)