on main help sign in
refactor: move domain-specific type out of generic pubsub package

๐Ÿ’˜ Generated with Crush Assisted-by: GLM-4.7 via Crush <crush@charm.land>

commit4261dfbf156ae6c82e5e0d534eacd2651bd1f896 authorChristian Rocha <christian@rocha.is> dateSun 18 Jan 2026, 18:13 (9 months ago) parentb7c128a
3 files changed+9โˆ’9
internal/app/app.go+8โˆ’1 internal/pubsub/events.goโˆ’7 internal/tui/tui.go+1โˆ’1
internal/app/app.go+8โˆ’1
@@ -40,6 +40,13 @@ import (
4040 "github.com/charmbracelet/x/term"
4141)
4242
43+// UpdateAvailableMsg is sent when a new version is available.
44+type UpdateAvailableMsg struct {
45+ CurrentVersion string
46+ LatestVersion string
47+ IsDevelopment bool
48+}
49+
4350type App struct {
4451 Sessions session.Service
4552 Messages message.Service
@@ -452,7 +459,7 @@ func (app *App) checkForUpdates(ctx context.Context) {
452459 if err != nil || !info.Available() {
453460 return
454461 }
455โˆ’ app.events <- pubsub.UpdateAvailableMsg{
462+ app.events <- UpdateAvailableMsg{
456463 CurrentVersion: info.Current,
457464 LatestVersion: info.Latest,
458465 IsDevelopment: info.IsDevelopment(),
internal/pubsub/events.goโˆ’7
@@ -26,10 +26,3 @@ type (
2626 Publish(EventType, T)
2727 }
2828)
29โˆ’
30โˆ’// UpdateAvailableMsg is sent when a new version is available.
31โˆ’type UpdateAvailableMsg struct {
32โˆ’ CurrentVersion string
33โˆ’ LatestVersion string
34โˆ’ IsDevelopment bool
35โˆ’}
internal/tui/tui.go+1โˆ’1
@@ -385,7 +385,7 @@ func (a *appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
385385 }
386386 return a, tea.Batch(cmds...)
387387 // Update Available
388โˆ’ case pubsub.UpdateAvailableMsg:
388+ case app.UpdateAvailableMsg:
389389 // Show update notification in status bar
390390 statusMsg := fmt.Sprintf("Crush update available: v%s โ†’ v%s.", msg.CurrentVersion, msg.LatestVersion)
391391 if msg.IsDevelopment {