refactor: move domain-specific type out of generic pubsub package

Christian Rocha created

💘 Generated with Crush

Assisted-by: GLM-4.7 via Crush <crush@charm.land>

Change summary

internal/app/app.go       | 9 ++++++++-
internal/pubsub/events.go | 7 -------
internal/tui/tui.go       | 2 +-
3 files changed, 9 insertions(+), 9 deletions(-)

Detailed changes

internal/app/app.go 🔗

@@ -40,6 +40,13 @@ import (
 	"github.com/charmbracelet/x/term"
 )
 
+// UpdateAvailableMsg is sent when a new version is available.
+type UpdateAvailableMsg struct {
+	CurrentVersion string
+	LatestVersion  string
+	IsDevelopment  bool
+}
+
 type App struct {
 	Sessions    session.Service
 	Messages    message.Service
@@ -452,7 +459,7 @@ func (app *App) checkForUpdates(ctx context.Context) {
 	if err != nil || !info.Available() {
 		return
 	}
-	app.events <- pubsub.UpdateAvailableMsg{
+	app.events <- 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 🔗

@@ -385,7 +385,7 @@ func (a *appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
 		}
 		return a, tea.Batch(cmds...)
 	// Update Available
-	case pubsub.UpdateAvailableMsg:
+	case app.UpdateAvailableMsg:
 		// Show update notification in status bar
 		statusMsg := fmt.Sprintf("Crush update available: v%s → v%s.", msg.CurrentVersion, msg.LatestVersion)
 		if msg.IsDevelopment {