refactor: app orchestration into tui

This commit is contained in:
2026-04-29 20:35:20 +02:00
parent 3d012e0c2e
commit 1147f4d25b
11 changed files with 1149 additions and 1086 deletions
+48
View File
@@ -0,0 +1,48 @@
package tui
import (
"parasocial/internal/auth"
"parasocial/internal/twitch"
)
// IRCState describes the current IRC join lifecycle for one streamer row.
type IRCState string
const (
IRCPending IRCState = "pending"
IRCJoined IRCState = "joined"
IRCDisconnected IRCState = "disconnected"
)
// AuthUpdate carries one incremental auth log line or completion result into the TUI.
type AuthUpdate struct {
Line string
State *auth.State
Err error
Done bool
}
// StreamerUpdate carries one streamer resolution update into the TUI.
type StreamerUpdate struct {
Viewer *twitch.Viewer
Entry *twitch.StreamerEntry
IRC *IRCUpdate
Index int
Err error
Done bool
}
// IRCUpdate carries one IRC connection state or log line into the TUI.
type IRCUpdate struct {
Login string
State IRCState
Line string
}
type authStartedMsg struct {
Updates <-chan AuthUpdate
}
type streamerStartedMsg struct {
Updates <-chan StreamerUpdate
}