From 7404285d1fe05b5705291c4053a265de59a100cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bjarne=20=C3=98verli?= Date: Tue, 21 Jul 2026 23:15:49 +0200 Subject: [PATCH] fix(ci): restore cross-platform checks --- go.mod | 4 ++-- go.sum | 8 ++++---- tracksave/save_test.go | 13 +++++++++--- ui/model/scroll.go | 10 ---------- ui/model/update.go | 5 ----- ui/model/view.go | 45 ------------------------------------------ 6 files changed, 16 insertions(+), 69 deletions(-) diff --git a/go.mod b/go.mod index fc723f4..e13e434 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/urfave/cli/v3 v3.8.0 github.com/yuin/gopher-lua v1.1.2 golang.org/x/oauth2 v0.36.0 - golang.org/x/text v0.37.0 + golang.org/x/text v0.39.0 google.golang.org/api v0.274.0 ) @@ -74,7 +74,7 @@ require ( golang.org/x/crypto v0.51.0 // indirect golang.org/x/exp v0.0.0-20251209150349-8475f28825e9 // indirect golang.org/x/net v0.55.0 // indirect - golang.org/x/sync v0.20.0 // indirect + golang.org/x/sync v0.21.0 // indirect golang.org/x/sys v0.45.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20260319201613-d00831a3d3e7 // indirect google.golang.org/grpc v1.79.3 // indirect diff --git a/go.sum b/go.sum index 7a77907..8559bea 100644 --- a/go.sum +++ b/go.sum @@ -177,8 +177,8 @@ golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs= golang.org/x/oauth2 v0.36.0/go.mod h1:YDBUJMTkDnJS+A4BP4eZBjCqtokkg1hODuPjwiGPO7Q= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4= -golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= +golang.org/x/sync v0.21.0 h1:HLII4xRRTtCRkxYp4HNFF0Js/Og6q2i++KXbg0gHCwM= +golang.org/x/sync v0.21.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -196,8 +196,8 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.37.0 h1:Cqjiwd9eSg8e0QAkyCaQTNHFIIzWtidPahFWR83rTrc= -golang.org/x/text v0.37.0/go.mod h1:a5sjxXGs9hsn/AJVwuElvCAo9v8QYLzvavO5z2PiM38= +golang.org/x/text v0.39.0 h1:UbZz4pLOvn600D6Oh6GGEI6VAmndrEBLv8/6BEXzyus= +golang.org/x/text v0.39.0/go.mod h1:3UwRclnC2g0TU9x8PZiyfOajCd1zaUNHF9cvqcQZ+ZM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= diff --git a/tracksave/save_test.go b/tracksave/save_test.go index db30462..1385c34 100644 --- a/tracksave/save_test.go +++ b/tracksave/save_test.go @@ -9,8 +9,7 @@ import ( ) func TestSaveCopiesTemporaryDownload(t *testing.T) { - home := t.TempDir() - t.Setenv("HOME", home) + home := setTestHome(t) source, err := os.CreateTemp("", "cliamp-save-*.flac") if err != nil { t.Fatal(err) @@ -38,8 +37,16 @@ func TestSaveCopiesTemporaryDownload(t *testing.T) { } func TestSaveRejectsUserLibraryFile(t *testing.T) { - t.Setenv("HOME", t.TempDir()) + setTestHome(t) if _, err := Save(playlist.Track{Path: "/var/lib/music/song.flac"}); err == nil { t.Fatal("Save accepted a non-temporary library file") } } + +func setTestHome(t *testing.T) string { + t.Helper() + home := t.TempDir() + t.Setenv("HOME", home) + t.Setenv("USERPROFILE", home) + return home +} diff --git a/ui/model/scroll.go b/ui/model/scroll.go index d146758..10afcac 100644 --- a/ui/model/scroll.go +++ b/ui/model/scroll.go @@ -88,16 +88,6 @@ func (m Model) effectivePlaylistVisible() int { return min(m.plVisible, m.layout.bodyRows) } -// recomputeChrome preserves the existing layout-refresh seam for callers that -// change an overlay or visualizer mode. -func (m *Model) recomputeChrome() { - m.recomputeLayout() -} - -func (m *Model) invalidateChrome() { - m.recomputeLayout() -} - func (m *Model) refreshChrome() { m.recomputeLayout() } diff --git a/ui/model/update.go b/ui/model/update.go index a14bedc..744aa83 100644 --- a/ui/model/update.go +++ b/ui/model/update.go @@ -1216,8 +1216,3 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { return m, nil } - -// restorePanelWidth resets PanelWidth to the correct value based on compact mode. -func (m *Model) restorePanelWidth() { - m.recomputeLayout() -} diff --git a/ui/model/view.go b/ui/model/view.go index f026c80..c53e52e 100644 --- a/ui/model/view.go +++ b/ui/model/view.go @@ -2,7 +2,6 @@ package model import ( "fmt" - "math" "slices" "strings" "time" @@ -911,50 +910,6 @@ func (m Model) renderHelp() string { } } -// helpHint is a rendered help key with an associated display priority. -type helpHint struct { - text string - priority int -} - -// fitHints drops lowest-priority hints until they fit within maxWidth. -// Widths are pre-computed once to avoid repeated lipgloss.Width calls. -func fitHints(hints []helpHint, maxWidth int) string { - active := make([]bool, len(hints)) - widths := make([]int, len(hints)) - var total int - for i, h := range hints { - active[i] = true - widths[i] = lipgloss.Width(h.text) - total += widths[i] - } - - for total > maxWidth { - // Find lowest-priority active hint and drop it. - minPri := math.MaxInt - minIdx := -1 - for i, h := range hints { - if active[i] && h.priority < minPri { - minPri = h.priority - minIdx = i - } - } - if minIdx < 0 { - break - } - active[minIdx] = false - total -= widths[minIdx] - } - - var sb strings.Builder - for i, h := range hints { - if active[i] { - sb.WriteString(h.text) - } - } - return sb.String() -} - // renderBottomStatus renders the bottom status line: speed (left) and // network stats (right) on the same row. func (m Model) renderBottomStatus() string {