▍ humdrum codex / sportsball v0.1.1
license AGPL-3.0

Open standings for focused game in detail view; drop GoReleaser cruft

7408d582a0519de9cd466ff229a9430c1f296000
humdrum <me@humdrum.me> · 2026-06-18 19:04

parent 31b333c7

Open standings for focused game in detail view; drop GoReleaser cruft

Detail view: `s` now opens standings for the open game's league (was a
no-op there; the dashboard already did this). Standings remembers its
opener via prevMode so esc returns to the detail view, guarded against
the shared-prevMode clobber when a schedule is opened from standings.

Remove dead GoReleaser config + dist/ ignore now that releases run
through the custard self-hosted Homebrew tap.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

3 files changed

.gitignore +0 −2
@@ -1,8 +1,6 @@
 # Built binaries
 /pts
 /sportsball
-# GoReleaser output
-/dist/
 # Go workspace / test artifacts
 *.out
 *.test
.goreleaser.yaml +0 −65
@@ -1,65 +0,0 @@
-# GoReleaser config — cross-compiles sportsball and publishes a Homebrew formula.
-# Docs: https://goreleaser.com  •  run locally with `goreleaser release --snapshot --clean`
-version: 2
-
-project_name: sportsball
-
-before:
-  hooks:
-    - go mod tidy
-
-builds:
-  - id: sportsball
-    main: .
-    binary: sportsball
-    env:
-      - CGO_ENABLED=0
-    goos:
-      - darwin
-      - linux
-    goarch:
-      - amd64
-      - arm64
-    ldflags:
-      - -s -w -X main.version={{ .Version }}
-
-archives:
-  - id: sportsball
-    formats:
-      - tar.gz
-    name_template: >-
-      {{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}
-    files:
-      - README.md
-      - LICENSE
-
-checksum:
-  name_template: checksums.txt
-
-snapshot:
-  version_template: "{{ incpatch .Version }}-dev"
-
-changelog:
-  sort: asc
-  filters:
-    exclude:
-      - "^docs:"
-      - "^test:"
-      - "^chore:"
-
-# Generates Formula/sportsball.rb and pushes it to the tap repo on release.
-brews:
-  - name: sportsball
-    repository:
-      owner: humdrum-tiv
-      name: homebrew-tap
-      branch: main
-      token: "{{ .Env.HOMEBREW_TAP_TOKEN }}"
-    directory: Formula
-    homepage: "https://github.com/humdrum-tiv/sportsball"
-    description: "Terminal dashboard for live sports — World Cup, MLB, NBA, NHL, NFL"
-    license: "AGPL-3.0-or-later"
-    install: |
-      bin.install "sportsball"
-    test: |
-      system "#{bin}/sportsball", "--version"
internal/ui/update.go +10 −1
@@ -66,6 +66,8 @@ 		case key.Matches(msg, keys.FavAway):
 			a.toggleFav(a.detail.League, a.detail.Away)
 		case key.Matches(msg, keys.FavHome):
 			a.toggleFav(a.detail.League, a.detail.Home)
+		case key.Matches(msg, keys.Standings):
+			return a.openStandingsFor(a.detail.League)
 		case key.Matches(msg, keys.Schedule):
 			return a.openSchedule(a.detail.League, a.detail.Away)
 		case key.Matches(msg, keys.ScheduleHome):
@@ -180,6 +182,7 @@ func (a App) openStandingsFor(l model.LeagueID) (tea.Model, tea.Cmd) {
 	if l == "" {
 		return a, nil
 	}
+	a.prevMode = a.mode
 	a.mode = viewStandings
 	a.standingsLeague = l
 	a.standingsCursor = 0
@@ -232,7 +235,13 @@ // leagues, open the selected team's schedule, or close.
 func (a App) handleStandingsKey(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
 	switch {
 	case key.Matches(msg, keys.Back), key.Matches(msg, keys.Standings):
-		a.mode = viewDashboard
+		// Return to the opener (dashboard or detail). prevMode is shared and
+		// may have been clobbered by opening a schedule from here, so fall back
+		// to the dashboard rather than looping back into standings/schedule.
+		a.mode = a.prevMode
+		if a.mode == viewStandings || a.mode == viewSchedule {
+			a.mode = viewDashboard
+		}
 		return a, nil
 	case key.Matches(msg, keys.Up):
 		a.standingsCursor--