Detailed changes
@@ -5,9 +5,9 @@ import (
"path/filepath"
"time"
- "github.com/charmbracelet/bubbles/key"
- tea "github.com/charmbracelet/bubbletea"
- "github.com/charmbracelet/lipgloss"
+ "github.com/charmbracelet/bubbles/v2/key"
+ tea "github.com/charmbracelet/bubbletea/v2"
+ "github.com/charmbracelet/lipgloss/v2"
"github.com/charmbracelet/soft-serve/git"
"github.com/charmbracelet/soft-serve/pkg/proto"
"github.com/charmbracelet/soft-serve/pkg/ui/common"
@@ -39,9 +39,8 @@ var Command = &cobra.Command{
// Bubble Tea uses Termenv default output so we have to use the same
// thing here.
- output := lipgloss.DefaultRenderer()
ctx := cmd.Context()
- c := common.NewCommon(ctx, output, 0, 0)
+ c := common.NewCommon(ctx, 0, 0)
c.HideCloneCmd = true
comps := []common.TabComponent{
repo.NewReadme(c),
@@ -166,16 +165,14 @@ func (m *model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
m.common.Zone.Close()
return m, tea.Quit
}
- case tea.MouseMsg:
- if msg.Action != tea.MouseActionPress {
- break
- }
- switch msg.Button {
- case tea.MouseButtonLeft:
- switch {
- case m.common.Zone.Get("footer").InBounds(msg):
- cmds = append(cmds, footer.ToggleFooterCmd)
- }
+ case tea.MouseClickMsg:
+ mouse := msg.Mouse()
+ switch mouse.Button {
+ case tea.MouseLeft:
+ // switch {
+ // case m.common.Zone.Get("footer").InBounds(msg):
+ // cmds = append(cmds, footer.ToggleFooterCmd)
+ // }
}
case footer.ToggleFooterMsg:
m.footer.SetShowAll(!m.footer.ShowAll())
@@ -7,6 +7,7 @@ import (
"runtime/debug"
"strconv"
+ "github.com/charmbracelet/colorprofile"
"github.com/charmbracelet/log"
"github.com/charmbracelet/soft-serve/cmd/soft/admin"
"github.com/charmbracelet/soft-serve/cmd/soft/browse"
@@ -18,7 +19,6 @@ import (
"github.com/charmbracelet/soft-serve/pkg/version"
mcobra "github.com/muesli/mango-cobra"
"github.com/muesli/roff"
- "github.com/muesli/termenv"
"github.com/spf13/cobra"
"go.uber.org/automaxprocs/maxprocs"
)
@@ -67,7 +67,7 @@ var (
func init() {
if noColor, _ := strconv.ParseBool(os.Getenv("SOFT_SERVE_NO_COLOR")); noColor {
- common.DefaultColorProfile = termenv.Ascii
+ common.DefaultColorProfile = colorprofile.NoTTY
}
rootCmd.AddCommand(
@@ -2,11 +2,8 @@ module github.com/charmbracelet/soft-serve
go 1.23.0
-toolchain go1.24.1
-
require (
- github.com/charmbracelet/bubbles v0.20.0
- github.com/charmbracelet/bubbletea v1.3.4
+ github.com/charmbracelet/bubbletea v1.3.4 // indirect
github.com/charmbracelet/glamour v0.9.1
github.com/charmbracelet/lipgloss v1.1.0
github.com/charmbracelet/wish v1.4.6
@@ -22,12 +19,18 @@ require (
github.com/alecthomas/chroma/v2 v2.15.0
github.com/aymanbagabas/git-module v1.8.4-0.20231101154130-8d27204ac6d2
github.com/caarlos0/duration v0.0.0-20240108180406-5d492514f3c7
- github.com/caarlos0/env/v11 v11.3.1
+ github.com/caarlos0/env/v11 v11.2.2
+ github.com/charmbracelet/bubbles/v2 v2.0.0-alpha.2.0.20250318132216-bd20b89a3e80
+ github.com/charmbracelet/bubbletea/v2 v2.0.0-alpha.2.0.20250318133619-2ce107c85fed
+ github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc
github.com/charmbracelet/git-lfs-transfer v0.1.1-0.20240708204110-bacbfdb68d92
- github.com/charmbracelet/keygen v0.5.3
- github.com/charmbracelet/log v0.4.1
- github.com/charmbracelet/ssh v0.0.0-20250213143314-8712ec3ff3ef
- github.com/go-jose/go-jose/v3 v3.0.4
+ github.com/charmbracelet/keygen v0.5.1
+ github.com/charmbracelet/lipgloss/v2 v2.0.0-alpha.2.0.20250313133401-58331b1fff40
+ github.com/charmbracelet/log v0.4.1-0.20241101171137-e66b83d34ed9
+ github.com/charmbracelet/ssh v0.0.0-20250128164007-98fd5ae11894
+ github.com/charmbracelet/wish/v2 v2.0.0-20250319172925-3ae4bfe9c24e
+ github.com/charmbracelet/x/ansi v0.8.0
+ github.com/go-jose/go-jose/v3 v3.0.3
github.com/gobwas/glob v0.2.3
github.com/golang-jwt/jwt/v5 v5.2.1
github.com/google/go-querystring v1.1.0
@@ -45,7 +48,7 @@ require (
github.com/rogpeppe/go-internal v1.14.1
github.com/spf13/cobra v1.9.1
go.uber.org/automaxprocs v1.6.0
- golang.org/x/crypto v0.36.0
+ golang.org/x/crypto v0.35.0
golang.org/x/sync v0.12.0
gopkg.in/yaml.v3 v3.0.1
modernc.org/sqlite v1.36.1
@@ -58,12 +61,11 @@ require (
github.com/aymerick/douceur v0.2.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
- github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc // indirect
- github.com/charmbracelet/x/ansi v0.8.0 // indirect
- github.com/charmbracelet/x/cellbuf v0.0.13-0.20250311204145-2c3ea96c31dd // indirect
+ github.com/charmbracelet/log/v2 v2.0.0-20250226163916-c379e29ff706 // indirect
+ github.com/charmbracelet/x/cellbuf v0.0.13 // indirect
github.com/charmbracelet/x/conpty v0.1.0 // indirect
github.com/charmbracelet/x/errors v0.0.0-20240725160154-f9f6568126ec // indirect
- github.com/charmbracelet/x/input v0.3.1 // indirect
+ github.com/charmbracelet/x/input v0.3.4 // indirect
github.com/charmbracelet/x/term v0.2.1 // indirect
github.com/charmbracelet/x/termios v0.1.0 // indirect
github.com/charmbracelet/x/windows v0.2.0 // indirect
@@ -100,7 +102,7 @@ require (
github.com/yuin/goldmark v1.7.8 // indirect
github.com/yuin/goldmark-emoji v1.0.5 // indirect
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
- golang.org/x/net v0.36.0 // indirect
+ golang.org/x/net v0.35.0 // indirect
golang.org/x/sys v0.31.0 // indirect
golang.org/x/term v0.30.0 // indirect
golang.org/x/text v0.23.0 // indirect
@@ -22,42 +22,50 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/caarlos0/duration v0.0.0-20240108180406-5d492514f3c7 h1:kJP/C2eL9DCKrCOlX6lPVmAUAb6U4u9xllgws1kP9ds=
github.com/caarlos0/duration v0.0.0-20240108180406-5d492514f3c7/go.mod h1:mSkwb/eZEwOJJJ4tqAKiuhLIPe0e9+FKhlU0oMCpbf8=
-github.com/caarlos0/env/v11 v11.3.1 h1:cArPWC15hWmEt+gWk7YBi7lEXTXCvpaSdCiZE2X5mCA=
-github.com/caarlos0/env/v11 v11.3.1/go.mod h1:qupehSf/Y0TUTsxKywqRt/vJjN5nz6vauiYEUUr8P4U=
+github.com/caarlos0/env/v11 v11.2.2 h1:95fApNrUyueipoZN/EhA8mMxiNxrBwDa+oAZrMWl3Kg=
+github.com/caarlos0/env/v11 v11.2.2/go.mod h1:JBfcdeQiBoI3Zh1QRAWfe+tpiNTmDtcCj/hHHHMx0vc=
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
-github.com/charmbracelet/bubbles v0.20.0 h1:jSZu6qD8cRQ6k9OMfR1WlM+ruM8fkPWkHvQWD9LIutE=
-github.com/charmbracelet/bubbles v0.20.0/go.mod h1:39slydyswPy+uVOHZ5x/GjwVAFkCsV8IIVy+4MhzwwU=
+github.com/charmbracelet/bubbles/v2 v2.0.0-alpha.2.0.20250318132216-bd20b89a3e80 h1:RlfUmUVZpshOB7YP4sdnIymgXb6tXhHeQ2854afgKoU=
+github.com/charmbracelet/bubbles/v2 v2.0.0-alpha.2.0.20250318132216-bd20b89a3e80/go.mod h1:OQsv1nZAu5v8GtZqNTqS4yY5mfR0VgImkpe2F0QYEfs=
github.com/charmbracelet/bubbletea v1.3.4 h1:kCg7B+jSCFPLYRA52SDZjr51kG/fMUEoPoZrkaDHyoI=
github.com/charmbracelet/bubbletea v1.3.4/go.mod h1:dtcUCyCGEX3g9tosuYiut3MXgY/Jsv9nKVdibKKRRXo=
+github.com/charmbracelet/bubbletea/v2 v2.0.0-alpha.2.0.20250318133619-2ce107c85fed h1:Fsn31oc6fmX7YgfZ1Am+19HVorJ8Bf6wJTebVNLcQP0=
+github.com/charmbracelet/bubbletea/v2 v2.0.0-alpha.2.0.20250318133619-2ce107c85fed/go.mod h1:ks5r0VCpADtYFlNU15krnFIbMn545yV3U6ee6UJrlto=
github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc h1:4pZI35227imm7yK2bGPcfpFEmuY1gc2YSTShr4iJBfs=
github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc/go.mod h1:X4/0JoqgTIPSFcRA/P6INZzIuyqdFY5rm8tb41s9okk=
github.com/charmbracelet/git-lfs-transfer v0.1.1-0.20240708204110-bacbfdb68d92 h1:KtQlsiHfY3K4AoIEh0yUE/wCLHteZ9EzV1hKmx+p7U8=
github.com/charmbracelet/git-lfs-transfer v0.1.1-0.20240708204110-bacbfdb68d92/go.mod h1:UrXUCm3xLQkq15fu7qlXHUMlrhdlXHoi13KH2Dfiits=
github.com/charmbracelet/glamour v0.9.1 h1:Q7PdJLOx8EoepsXUvW6Puz5WQ3YUElIGQdYKrIpiGLA=
github.com/charmbracelet/glamour v0.9.1/go.mod h1:+SHvIS8qnwhgTpVMiXwn7OfGomSqff1cHBCI8jLOetk=
-github.com/charmbracelet/keygen v0.5.3 h1:2MSDC62OUbDy6VmjIE2jM24LuXUvKywLCmaJDmr/Z/4=
-github.com/charmbracelet/keygen v0.5.3/go.mod h1:TcpNoMAO5GSmhx3SgcEMqCrtn8BahKhB8AlwnLjRUpk=
+github.com/charmbracelet/keygen v0.5.1 h1:zBkkYPtmKDVTw+cwUyY6ZwGDhRxXkEp0Oxs9sqMLqxI=
+github.com/charmbracelet/keygen v0.5.1/go.mod h1:zznJVmK/GWB6dAtjluqn2qsttiCBhA5MZSiwb80fcHw=
github.com/charmbracelet/lipgloss v1.1.0 h1:vYXsiLHVkK7fp74RkV7b2kq9+zDLoEU4MZoFqR/noCY=
github.com/charmbracelet/lipgloss v1.1.0/go.mod h1:/6Q8FR2o+kj8rz4Dq0zQc3vYf7X+B0binUUBwA0aL30=
-github.com/charmbracelet/log v0.4.1 h1:6AYnoHKADkghm/vt4neaNEXkxcXLSV2g1rdyFDOpTyk=
-github.com/charmbracelet/log v0.4.1/go.mod h1:pXgyTsqsVu4N9hGdHmQ0xEA4RsXof402LX9ZgiITn2I=
-github.com/charmbracelet/ssh v0.0.0-20250213143314-8712ec3ff3ef h1:dNZwn4is5svUd+sQEGsrXtp7VwD2ipYaCkKMzcpAEIE=
-github.com/charmbracelet/ssh v0.0.0-20250213143314-8712ec3ff3ef/go.mod h1:hg+I6gvlMl16nS9ZzQNgBIrrCasGwEw0QiLsDcP01Ko=
+github.com/charmbracelet/lipgloss/v2 v2.0.0-alpha.2.0.20250313133401-58331b1fff40 h1:9IxBdCOOJoJ1PYXgxWXJCk3Fkl7h2n+b7VtY+5BbIuQ=
+github.com/charmbracelet/lipgloss/v2 v2.0.0-alpha.2.0.20250313133401-58331b1fff40/go.mod h1:XhU7tcZRWVGzkjWQ6XYRH7tIVqYuWLx6XLjVqAz+7FU=
+github.com/charmbracelet/log v0.4.1-0.20241101171137-e66b83d34ed9 h1:m72jc7WwobapT4NLVVAjejNsz26f2UQ2Mz74uTq/Tro=
+github.com/charmbracelet/log v0.4.1-0.20241101171137-e66b83d34ed9/go.mod h1:soIjG88SDQxYFpbhYXbrDTPbd/07bfo66OjADdnY5HE=
+github.com/charmbracelet/log/v2 v2.0.0-20250226163916-c379e29ff706 h1:WkwO6Ks3mSIGnGuSdKl9qDSyfbYK50z2wc2gGMggegE=
+github.com/charmbracelet/log/v2 v2.0.0-20250226163916-c379e29ff706/go.mod h1:mjJGp00cxcfvD5xdCa+bso251Jt4owrQvuimJtVmEmM=
+github.com/charmbracelet/ssh v0.0.0-20250128164007-98fd5ae11894 h1:Ffon9TbltLGBsT6XE//YvNuu4OAaThXioqalhH11xEw=
+github.com/charmbracelet/ssh v0.0.0-20250128164007-98fd5ae11894/go.mod h1:hg+I6gvlMl16nS9ZzQNgBIrrCasGwEw0QiLsDcP01Ko=
github.com/charmbracelet/wish v1.4.6 h1:27WRqMTUmyFoZASoaAaEe78Je7LTU4VqyoBxnl4d9XA=
github.com/charmbracelet/wish v1.4.6/go.mod h1:RRy2LFW3WQ3tlPmMMGgEeSMDVlFd5yqklGBVZWQSHmk=
+github.com/charmbracelet/wish/v2 v2.0.0-20250319172925-3ae4bfe9c24e h1:WjrZFTFMjmm9dyc+KzXpY8z2viWdwShU6Qqqu3ixAss=
+github.com/charmbracelet/wish/v2 v2.0.0-20250319172925-3ae4bfe9c24e/go.mod h1:olUvE0hW+a8zFU1vNvlEm6PJS+ElY1V5pcaV5pjzaGI=
github.com/charmbracelet/x/ansi v0.8.0 h1:9GTq3xq9caJW8ZrBTe0LIe2fvfLR/bYXKTx2llXn7xE=
github.com/charmbracelet/x/ansi v0.8.0/go.mod h1:wdYl/ONOLHLIVmQaxbIYEC/cRKOQyjTkowiI4blgS9Q=
-github.com/charmbracelet/x/cellbuf v0.0.13-0.20250311204145-2c3ea96c31dd h1:vy0GVL4jeHEwG5YOXDmi86oYw2yuYUGqz6a8sLwg0X8=
-github.com/charmbracelet/x/cellbuf v0.0.13-0.20250311204145-2c3ea96c31dd/go.mod h1:xe0nKWGd3eJgtqZRaN9RjMtK7xUYchjzPr7q6kcvCCs=
+github.com/charmbracelet/x/cellbuf v0.0.13 h1:/KBBKHuVRbq1lYx5BzEHBAFBP8VcQzJejZ/IA3iR28k=
+github.com/charmbracelet/x/cellbuf v0.0.13/go.mod h1:xe0nKWGd3eJgtqZRaN9RjMtK7xUYchjzPr7q6kcvCCs=
github.com/charmbracelet/x/conpty v0.1.0 h1:4zc8KaIcbiL4mghEON8D72agYtSeIgq8FSThSPQIb+U=
github.com/charmbracelet/x/conpty v0.1.0/go.mod h1:rMFsDJoDwVmiYM10aD4bH2XiRgwI7NYJtQgl5yskjEQ=
github.com/charmbracelet/x/errors v0.0.0-20240725160154-f9f6568126ec h1:O8c7pFFK0imuHH5JBqv5smlbVoFn4CZKGjtvCQKu1WE=
github.com/charmbracelet/x/errors v0.0.0-20240725160154-f9f6568126ec/go.mod h1:2P0UgXMEa6TsToMSuFqKFQR+fZTO9CNGUNokkPatT/0=
-github.com/charmbracelet/x/exp/golden v0.0.0-20240815200342-61de596daa2b h1:MnAMdlwSltxJyULnrYbkZpp4k58Co7Tah3ciKhSNo0Q=
-github.com/charmbracelet/x/exp/golden v0.0.0-20240815200342-61de596daa2b/go.mod h1:wDlXFlCrmJ8J+swcL/MnGUuYnqgQdW9rhSD61oNMb6U=
-github.com/charmbracelet/x/input v0.3.1 h1:TE4s3fTRj+OUpJ86dKphrN99+NgBnto//EkWncMJQIg=
-github.com/charmbracelet/x/input v0.3.1/go.mod h1:4w9jS/NW62WrHSdmjbpzydvnbqkd+mtyK8WOWbHCdvs=
+github.com/charmbracelet/x/exp/golden v0.0.0-20250207160936-21c02780d27a h1:FsHEJ52OC4VuTzU8t+n5frMjLvpYWEznSr/u8tnkCYw=
+github.com/charmbracelet/x/exp/golden v0.0.0-20250207160936-21c02780d27a/go.mod h1:wDlXFlCrmJ8J+swcL/MnGUuYnqgQdW9rhSD61oNMb6U=
+github.com/charmbracelet/x/input v0.3.4 h1:Mujmnv/4DaitU0p+kIsrlfZl/UlmeLKw1wAP3e1fMN0=
+github.com/charmbracelet/x/input v0.3.4/go.mod h1:JI8RcvdZWQIhn09VzeK3hdp4lTz7+yhiEdpEQtZN+2c=
github.com/charmbracelet/x/term v0.2.1 h1:AQeHeLZ1OqSXhrAWpYUtZyX1T3zVxfpZuEQMIQaGIAQ=
github.com/charmbracelet/x/term v0.2.1/go.mod h1:oQ4enTYFV7QN4m0i9mzHrViD7TQKvNEEkHUMCmsxdUg=
github.com/charmbracelet/x/termios v0.1.0 h1:y4rjAHeFksBAfGbkRDmVinMg7x7DELIGAFbdNvxg97k=
@@ -84,8 +92,8 @@ github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66D
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic=
github.com/go-git/go-git/v5 v5.14.0 h1:/MD3lCrGjCen5WfEAzKg00MJJffKhC8gzS80ycmCi60=
github.com/go-git/go-git/v5 v5.14.0/go.mod h1:Z5Xhoia5PcWA3NF8vRLURn9E5FRhSl7dGj9ItW3Wk5k=
-github.com/go-jose/go-jose/v3 v3.0.4 h1:Wp5HA7bLQcKnf6YYao/4kpRpVMp/yf6+pJKV8WFSaNY=
-github.com/go-jose/go-jose/v3 v3.0.4/go.mod h1:5b+7YgP7ZICgJDBdfjZaIt+H/9L9T/YQrVfLAMboGkQ=
+github.com/go-jose/go-jose/v3 v3.0.3 h1:fFKWeig/irsp7XD2zBxvnmA/XaRWp5V3CBsZXJF7G7k=
+github.com/go-jose/go-jose/v3 v3.0.3/go.mod h1:5b+7YgP7ZICgJDBdfjZaIt+H/9L9T/YQrVfLAMboGkQ=
github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4=
github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs=
github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y=
@@ -228,8 +236,8 @@ go.uber.org/automaxprocs v1.6.0/go.mod h1:ifeIMSnPZuznNm6jmdzmU3/bfk01Fe2fotchwE
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
-golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34=
-golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc=
+golang.org/x/crypto v0.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs=
+golang.org/x/crypto v0.35.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ=
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8=
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
@@ -241,8 +249,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
-golang.org/x/net v0.36.0 h1:vWF2fRbw4qslQsQzgFqZff+BItCvGFQqKzKIzx1rmoA=
-golang.org/x/net v0.36.0/go.mod h1:bFmbeoIPfrw4sMHNhb4J9f6+tPziuGjq7Jk/38fxi1I=
+golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8=
+golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk=
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.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -3,7 +3,6 @@ package cmd
import (
"fmt"
- "github.com/charmbracelet/lipgloss"
"github.com/charmbracelet/soft-serve/git"
"github.com/charmbracelet/soft-serve/pkg/backend"
"github.com/charmbracelet/soft-serve/pkg/ui/common"
@@ -12,12 +11,12 @@ import (
)
// blobCommand returns a command that prints the contents of a file.
-func blobCommand(renderer *lipgloss.Renderer) *cobra.Command {
+func blobCommand() *cobra.Command {
var linenumber bool
var color bool
var raw bool
- styles := styles.DefaultStyles(renderer)
+ styles := styles.DefaultStyles()
cmd := &cobra.Command{
Use: "blob REPOSITORY [REFERENCE] [PATH]",
Aliases: []string{"cat", "show"},
@@ -6,7 +6,6 @@ import (
"time"
gansi "github.com/charmbracelet/glamour/ansi"
- "github.com/charmbracelet/lipgloss"
"github.com/charmbracelet/soft-serve/git"
"github.com/charmbracelet/soft-serve/pkg/backend"
"github.com/charmbracelet/soft-serve/pkg/ui/common"
@@ -15,7 +14,7 @@ import (
)
// commitCommand returns a command that prints the contents of a commit.
-func commitCommand(renderer *lipgloss.Renderer) *cobra.Command {
+func commitCommand() *cobra.Command {
var color bool
var patchOnly bool
@@ -55,7 +54,7 @@ func commitCommand(renderer *lipgloss.Renderer) *cobra.Command {
return err
}
- commonStyle := styles.DefaultStyles(renderer)
+ commonStyle := styles.DefaultStyles()
style := commonStyle.Log
s := strings.Builder{}
@@ -4,14 +4,13 @@ import (
"fmt"
"strings"
- "github.com/charmbracelet/lipgloss"
"github.com/charmbracelet/soft-serve/pkg/backend"
"github.com/charmbracelet/soft-serve/pkg/proto"
"github.com/spf13/cobra"
)
// RepoCommand returns a command for managing repositories.
-func RepoCommand(renderer *lipgloss.Renderer) *cobra.Command {
+func RepoCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "repo",
Aliases: []string{"repos", "repository", "repositories"},
@@ -19,10 +18,10 @@ func RepoCommand(renderer *lipgloss.Renderer) *cobra.Command {
}
cmd.AddCommand(
- blobCommand(renderer),
+ blobCommand(),
branchCommand(),
collabCommand(),
- commitCommand(renderer),
+ commitCommand(),
createCommand(),
deleteCommand(),
descriptionCommand(),
@@ -2,7 +2,6 @@ package ssh
import (
"fmt"
- "os"
"time"
"github.com/charmbracelet/log"
@@ -14,9 +13,7 @@ import (
"github.com/charmbracelet/soft-serve/pkg/sshutils"
"github.com/charmbracelet/soft-serve/pkg/store"
"github.com/charmbracelet/ssh"
- "github.com/charmbracelet/wish"
- bm "github.com/charmbracelet/wish/bubbletea"
- "github.com/muesli/termenv"
+ "github.com/charmbracelet/wish/v2"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
"github.com/spf13/cobra"
@@ -91,12 +88,6 @@ func CommandMiddleware(sh ssh.Handler) ssh.Handler {
ctx := s.Context()
cfg := config.FromContext(ctx)
- renderer := bm.MakeRenderer(s)
- if testrun, ok := os.LookupEnv("SOFT_SERVE_NO_COLOR"); ok && testrun == "1" {
- // Disable colors when running tests.
- renderer.SetColorProfile(termenv.Ascii)
- }
-
args := s.Command()
cliCommandCounter.WithLabelValues(cmd.CommandName(args)).Inc()
rootCmd := &cobra.Command{
@@ -111,7 +102,7 @@ func CommandMiddleware(sh ssh.Handler) ssh.Handler {
cmd.GitUploadPackCommand(),
cmd.GitUploadArchiveCommand(),
cmd.GitReceivePackCommand(),
- cmd.RepoCommand(renderer),
+ cmd.RepoCommand(),
cmd.SettingsCommand(),
cmd.UserCommand(),
cmd.InfoCommand(),
@@ -4,16 +4,16 @@ import (
"os"
"time"
- tea "github.com/charmbracelet/bubbletea"
+ tea "github.com/charmbracelet/bubbletea/v2"
+ "github.com/charmbracelet/colorprofile"
"github.com/charmbracelet/soft-serve/pkg/access"
"github.com/charmbracelet/soft-serve/pkg/backend"
"github.com/charmbracelet/soft-serve/pkg/config"
"github.com/charmbracelet/soft-serve/pkg/proto"
"github.com/charmbracelet/soft-serve/pkg/ui/common"
"github.com/charmbracelet/ssh"
- "github.com/charmbracelet/wish"
- bm "github.com/charmbracelet/wish/bubbletea"
- "github.com/muesli/termenv"
+ "github.com/charmbracelet/wish/v2"
+ bm "github.com/charmbracelet/wish/v2/bubbletea"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
)
@@ -54,15 +54,6 @@ func SessionHandler(s ssh.Session) *tea.Program {
}
}
- renderer := bm.MakeRenderer(s)
- if testrun, ok := os.LookupEnv("SOFT_SERVE_NO_COLOR"); ok && testrun == "1" {
- // Disable colors when running tests.
- renderer.SetColorProfile(termenv.Ascii)
- }
-
- c := common.NewCommon(ctx, renderer, pty.Window.Width, pty.Window.Height)
- c.SetValue(common.ConfigKey, cfg)
- m := NewUI(c, initialRepo)
opts := bm.MakeOptions(s)
opts = append(opts,
tea.WithAltScreen(),
@@ -70,6 +61,15 @@ func SessionHandler(s ssh.Session) *tea.Program {
tea.WithMouseCellMotion(),
tea.WithContext(ctx),
)
+
+ if testrun, ok := os.LookupEnv("SOFT_SERVE_NO_COLOR"); ok && testrun == "1" {
+ // Disable colors when running tests.
+ opts = append(opts, tea.WithColorProfile(colorprofile.NoTTY))
+ }
+
+ c := common.NewCommon(ctx, pty.Window.Width, pty.Window.Height)
+ c.SetValue(common.ConfigKey, cfg)
+ m := NewUI(c, initialRepo)
p := tea.NewProgram(m, opts...)
tuiSessionCounter.WithLabelValues(initialRepo, pty.Term).Inc()
@@ -16,11 +16,10 @@ import (
"github.com/charmbracelet/soft-serve/pkg/db"
"github.com/charmbracelet/soft-serve/pkg/proto"
"github.com/charmbracelet/soft-serve/pkg/store"
- "github.com/charmbracelet/soft-serve/pkg/ui/common"
"github.com/charmbracelet/ssh"
- "github.com/charmbracelet/wish"
- bm "github.com/charmbracelet/wish/bubbletea"
- rm "github.com/charmbracelet/wish/recover"
+ "github.com/charmbracelet/wish/v2"
+ bm "github.com/charmbracelet/wish/v2/bubbletea"
+ rm "github.com/charmbracelet/wish/v2/recover"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
gossh "golang.org/x/crypto/ssh"
@@ -71,7 +70,7 @@ func NewSSHServer(ctx context.Context) (*SSHServer, error) {
rm.MiddlewareWithLogger(
logger,
// BubbleTea middleware.
- bm.MiddlewareWithProgramHandler(SessionHandler, common.DefaultColorProfile),
+ bm.MiddlewareWithProgramHandler(SessionHandler),
// CLI middleware.
CommandMiddleware,
// Logging middleware.
@@ -3,10 +3,10 @@ package ssh
import (
"errors"
- "github.com/charmbracelet/bubbles/key"
- "github.com/charmbracelet/bubbles/list"
- tea "github.com/charmbracelet/bubbletea"
- "github.com/charmbracelet/lipgloss"
+ "github.com/charmbracelet/bubbles/v2/key"
+ "github.com/charmbracelet/bubbles/v2/list"
+ tea "github.com/charmbracelet/bubbletea/v2"
+ "github.com/charmbracelet/lipgloss/v2"
"github.com/charmbracelet/soft-serve/git"
"github.com/charmbracelet/soft-serve/pkg/proto"
"github.com/charmbracelet/soft-serve/pkg/ui/common"
@@ -203,16 +203,13 @@ func (ui *UI) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
// Always show the footer on selection page.
ui.showFooter = true
}
- case tea.MouseMsg:
- if msg.Action != tea.MouseActionPress {
- break
- }
- switch msg.Button {
- case tea.MouseButtonLeft:
- switch {
- case ui.common.Zone.Get("footer").InBounds(msg):
- cmds = append(cmds, footer.ToggleFooterCmd)
- }
+ case tea.MouseClickMsg:
+ switch msg.Mouse().Button {
+ case tea.MouseLeft:
+ // switch {
+ // case ui.common.Zone.Get("footer").InBounds(msg):
+ // cmds = append(cmds, footer.ToggleFooterCmd)
+ // }
}
}
case footer.ToggleFooterMsg:
@@ -5,7 +5,6 @@ import (
"fmt"
"github.com/alecthomas/chroma/v2/lexers"
- "github.com/charmbracelet/lipgloss"
"github.com/charmbracelet/log"
"github.com/charmbracelet/soft-serve/git"
"github.com/charmbracelet/soft-serve/pkg/backend"
@@ -14,7 +13,6 @@ import (
"github.com/charmbracelet/soft-serve/pkg/ui/styles"
"github.com/charmbracelet/ssh"
zone "github.com/lrstanley/bubblezone"
- "github.com/muesli/termenv"
)
type contextKey struct {
@@ -34,27 +32,23 @@ type Common struct {
Styles *styles.Styles
KeyMap *keymap.KeyMap
Zone *zone.Manager
- Renderer *lipgloss.Renderer
- Output *termenv.Output
Logger *log.Logger
HideCloneCmd bool
}
// NewCommon returns a new Common struct.
-func NewCommon(ctx context.Context, out *lipgloss.Renderer, width, height int) Common {
+func NewCommon(ctx context.Context, width, height int) Common {
if ctx == nil {
ctx = context.TODO()
}
return Common{
- ctx: ctx,
- Width: width,
- Height: height,
- Renderer: out,
- Output: out.Output(),
- Styles: styles.DefaultStyles(out),
- KeyMap: keymap.DefaultKeyMap(),
- Zone: zone.New(),
- Logger: log.FromContext(ctx).WithPrefix("ui"),
+ ctx: ctx,
+ Width: width,
+ Height: height,
+ Styles: styles.DefaultStyles(),
+ KeyMap: keymap.DefaultKeyMap(),
+ Zone: zone.New(),
+ Logger: log.FromContext(ctx).WithPrefix("ui"),
}
}
@@ -1,13 +1,14 @@
package common
import (
- "github.com/charmbracelet/bubbles/help"
- tea "github.com/charmbracelet/bubbletea"
+ "github.com/charmbracelet/bubbles/v2/help"
+ tea "github.com/charmbracelet/bubbletea/v2"
)
// Component represents a Bubble Tea model that implements a SetSize function.
type Component interface {
tea.Model
+ tea.ViewModel
help.KeyMap
SetSize(width, height int)
}
@@ -3,7 +3,7 @@ package common
import (
"errors"
- tea "github.com/charmbracelet/bubbletea"
+ tea "github.com/charmbracelet/bubbletea/v2"
)
// ErrMissingRepo indicates that the requested repository could not be found.
@@ -1,13 +1,14 @@
package common
import (
+ "github.com/charmbracelet/colorprofile"
gansi "github.com/charmbracelet/glamour/ansi"
"github.com/charmbracelet/glamour/styles"
"github.com/muesli/termenv"
)
// DefaultColorProfile is the default color profile used by the SSH server.
-var DefaultColorProfile = termenv.ANSI256
+var DefaultColorProfile = colorprofile.ANSI256
func strptr(s string) *string {
return &s
@@ -39,7 +40,7 @@ func StyleRenderer() gansi.RenderContext {
// DefaultColorProfile and styles.
func StyleRendererWithStyles(styles gansi.StyleConfig) gansi.RenderContext {
return gansi.NewRenderContext(gansi.Options{
- ColorProfile: DefaultColorProfile,
+ ColorProfile: termenv.ANSI256,
Styles: styles,
})
}
@@ -6,10 +6,10 @@ import (
"sync"
"github.com/alecthomas/chroma/v2/lexers"
- tea "github.com/charmbracelet/bubbletea"
+ tea "github.com/charmbracelet/bubbletea/v2"
"github.com/charmbracelet/glamour"
gansi "github.com/charmbracelet/glamour/ansi"
- "github.com/charmbracelet/lipgloss"
+ "github.com/charmbracelet/lipgloss/v2"
"github.com/charmbracelet/soft-serve/pkg/ui/common"
vp "github.com/charmbracelet/soft-serve/pkg/ui/components/viewport"
"github.com/muesli/termenv"
@@ -110,7 +110,7 @@ func (r *Code) Init() tea.Cmd {
if r.sidenote != "" {
lines := strings.Split(r.sidenote, "\n")
- sideNoteWidth := int(math.Ceil(float64(r.Model.Width) * r.SideNotePercent))
+ sideNoteWidth := int(math.Ceil(float64(r.Model.Width()) * r.SideNotePercent))
for i, l := range lines {
lines[i] = common.TruncateString(l, sideNoteWidth)
}
@@ -121,7 +121,7 @@ func (r *Code) Init() tea.Cmd {
// https://github.com/muesli/reflow/issues/43
//
// TODO: solve this upstream in Glamour/Reflow.
- content = r.common.Renderer.NewStyle().Width(w).Render(content)
+ content = lipgloss.NewStyle().Width(w).Render(content)
r.Viewport.Model.SetContent(content)
@@ -169,26 +169,6 @@ func (r *Code) HalfViewUp() {
r.Viewport.HalfViewUp()
}
-// ViewUp moves the viewport up by a page.
-func (r *Code) ViewUp() []string {
- return r.Viewport.ViewUp()
-}
-
-// ViewDown moves the viewport down by a page.
-func (r *Code) ViewDown() []string {
- return r.Viewport.ViewDown()
-}
-
-// LineUp moves the viewport up by the given number of lines.
-func (r *Code) LineUp(n int) []string {
- return r.Viewport.LineUp(n)
-}
-
-// LineDown moves the viewport down by the given number of lines.
-func (r *Code) LineDown(n int) []string {
- return r.Viewport.LineDown(n)
-}
-
// ScrollPercent returns the viewport's scroll percentage.
func (r *Code) ScrollPercent() float64 {
return r.Viewport.ScrollPercent()
@@ -1,10 +1,10 @@
package footer
import (
- "github.com/charmbracelet/bubbles/help"
- "github.com/charmbracelet/bubbles/key"
- tea "github.com/charmbracelet/bubbletea"
- "github.com/charmbracelet/lipgloss"
+ "github.com/charmbracelet/bubbles/v2/help"
+ "github.com/charmbracelet/bubbles/v2/key"
+ tea "github.com/charmbracelet/bubbletea/v2"
+ "github.com/charmbracelet/lipgloss/v2"
"github.com/charmbracelet/soft-serve/pkg/ui/common"
)
@@ -3,7 +3,7 @@ package header
import (
"strings"
- tea "github.com/charmbracelet/bubbletea"
+ tea "github.com/charmbracelet/bubbletea/v2"
"github.com/charmbracelet/soft-serve/pkg/ui/common"
)
@@ -3,9 +3,9 @@ package selector
import (
"sync"
- "github.com/charmbracelet/bubbles/key"
- "github.com/charmbracelet/bubbles/list"
- tea "github.com/charmbracelet/bubbletea"
+ "github.com/charmbracelet/bubbles/v2/key"
+ "github.com/charmbracelet/bubbles/v2/list"
+ tea "github.com/charmbracelet/bubbletea/v2"
"github.com/charmbracelet/soft-serve/pkg/ui/common"
)
@@ -230,29 +230,27 @@ func (s *Selector) Init() tea.Cmd {
func (s *Selector) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
cmds := make([]tea.Cmd, 0)
switch msg := msg.(type) {
- case tea.MouseMsg:
- if msg.Action != tea.MouseActionPress {
- break
- }
- switch msg.Button {
- case tea.MouseButtonWheelUp:
+ case tea.MouseClickMsg:
+ m := msg.Mouse()
+ switch m.Button {
+ case tea.MouseWheelUp:
s.CursorUp()
- case tea.MouseButtonWheelDown:
+ case tea.MouseWheelDown:
s.CursorDown()
- case tea.MouseButtonLeft:
- curIdx := s.Index()
- for i, item := range s.Items() {
- item, _ := item.(IdentifiableItem)
- // Check each item to see if it's in bounds.
- if item != nil && s.common.Zone.Get(item.ID()).InBounds(msg) {
- if i == curIdx {
- cmds = append(cmds, s.SelectItemCmd)
- } else {
- s.Select(i)
- }
- break
- }
- }
+ case tea.MouseLeft:
+ // curIdx := s.Index()
+ // for i, item := range s.Items() {
+ // item, _ := item.(IdentifiableItem)
+ // // Check each item to see if it's in bounds.
+ // if item != nil && s.common.Zone.Get(item.ID()).InBounds(msg) {
+ // if i == curIdx {
+ // cmds = append(cmds, s.SelectItemCmd)
+ // } else {
+ // s.Select(i)
+ // }
+ // break
+ // }
+ // }
}
case tea.KeyMsg:
filterState := s.FilterState()
@@ -1,10 +1,10 @@
package statusbar
import (
- tea "github.com/charmbracelet/bubbletea"
- "github.com/charmbracelet/lipgloss"
+ tea "github.com/charmbracelet/bubbletea/v2"
+ "github.com/charmbracelet/lipgloss/v2"
"github.com/charmbracelet/soft-serve/pkg/ui/common"
- "github.com/muesli/reflow/truncate"
+ "github.com/charmbracelet/x/ansi"
)
// Model is a status bar model.
@@ -75,12 +75,12 @@ func (s *Model) View() string {
}
branch := st.StatusBarBranch.Render(s.extra)
maxWidth := s.common.Width - w(key) - w(info) - w(branch) - w(help)
- v := truncate.StringWithTail(s.value, uint(maxWidth-st.StatusBarValue.GetHorizontalFrameSize()), "…") //nolint:gosec
+ v := ansi.Truncate(s.value, maxWidth-st.StatusBarValue.GetHorizontalFrameSize(), "…")
value := st.StatusBarValue.
Width(maxWidth).
Render(v)
- return s.common.Renderer.NewStyle().MaxWidth(s.common.Width).
+ return lipgloss.NewStyle().MaxWidth(s.common.Width).
Render(
lipgloss.JoinHorizontal(lipgloss.Top,
key,
@@ -3,8 +3,8 @@ package tabs
import (
"strings"
- tea "github.com/charmbracelet/bubbletea"
- "github.com/charmbracelet/lipgloss"
+ tea "github.com/charmbracelet/bubbletea/v2"
+ "github.com/charmbracelet/lipgloss/v2"
"github.com/charmbracelet/soft-serve/pkg/ui/common"
)
@@ -63,18 +63,15 @@ func (t *Tabs) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
t.activeTab = (t.activeTab - 1 + len(t.tabs)) % len(t.tabs)
cmds = append(cmds, t.activeTabCmd)
}
- case tea.MouseMsg:
- if msg.Action != tea.MouseActionPress {
- break
- }
+ case tea.MouseClickMsg:
switch msg.Button {
- case tea.MouseButtonLeft:
- for i, tab := range t.tabs {
- if t.common.Zone.Get(tab).InBounds(msg) {
- t.activeTab = i
- cmds = append(cmds, t.activeTabCmd)
- }
- }
+ case tea.MouseLeft:
+ // for i, tab := range t.tabs {
+ // if t.common.Zone.Get(tab).InBounds(msg) {
+ // t.activeTab = i
+ // cmds = append(cmds, t.activeTabCmd)
+ // }
+ // }
}
case SelectTabMsg:
tab := int(msg)
@@ -109,7 +106,7 @@ func (t *Tabs) View() string {
s.WriteString(sep.String())
}
}
- return t.common.Renderer.NewStyle().
+ return lipgloss.NewStyle().
MaxWidth(t.common.Width).
Render(s.String())
}
@@ -1,9 +1,9 @@
package viewport
import (
- "github.com/charmbracelet/bubbles/key"
- "github.com/charmbracelet/bubbles/viewport"
- tea "github.com/charmbracelet/bubbletea"
+ "github.com/charmbracelet/bubbles/v2/key"
+ "github.com/charmbracelet/bubbles/v2/viewport"
+ tea "github.com/charmbracelet/bubbletea/v2"
"github.com/charmbracelet/soft-serve/pkg/ui/common"
)
@@ -15,7 +15,9 @@ type Viewport struct {
// New returns a new Viewport.
func New(c common.Common) *Viewport {
- vp := viewport.New(c.Width, c.Height)
+ vp := viewport.New()
+ vp.SetWidth(c.Width)
+ vp.SetHeight(c.Height)
vp.MouseWheelEnabled = true
return &Viewport{
common: c,
@@ -26,8 +28,8 @@ func New(c common.Common) *Viewport {
// SetSize implements common.Component.
func (v *Viewport) SetSize(width, height int) {
v.common.SetSize(width, height)
- v.Model.Width = width
- v.Model.Height = height
+ v.Model.SetWidth(width)
+ v.Model.SetHeight(height)
}
// Init implements tea.Model.
@@ -81,26 +83,6 @@ func (v *Viewport) HalfViewUp() {
v.Model.HalfViewUp()
}
-// ViewUp moves the viewport up by a page.
-func (v *Viewport) ViewUp() []string {
- return v.Model.ViewUp()
-}
-
-// ViewDown moves the viewport down by a page.
-func (v *Viewport) ViewDown() []string {
- return v.Model.ViewDown()
-}
-
-// LineUp moves the viewport up by the given number of lines.
-func (v *Viewport) LineUp(n int) []string {
- return v.Model.LineUp(n)
-}
-
-// LineDown moves the viewport down by the given number of lines.
-func (v *Viewport) LineDown(n int) []string {
- return v.Model.LineDown(n)
-}
-
// ScrollPercent returns the viewport's scroll percentage.
func (v *Viewport) ScrollPercent() float64 {
return v.Model.ScrollPercent()
@@ -1,6 +1,6 @@
package keymap
-import "github.com/charmbracelet/bubbles/key"
+import "github.com/charmbracelet/bubbles/v2/key"
// KeyMap is a map of key bindings for the UI.
type KeyMap struct {
@@ -7,9 +7,9 @@ import (
"strings"
gitm "github.com/aymanbagabas/git-module"
- "github.com/charmbracelet/bubbles/key"
- "github.com/charmbracelet/bubbles/spinner"
- tea "github.com/charmbracelet/bubbletea"
+ "github.com/charmbracelet/bubbles/v2/key"
+ "github.com/charmbracelet/bubbles/v2/spinner"
+ tea "github.com/charmbracelet/bubbletea/v2"
"github.com/charmbracelet/soft-serve/git"
"github.com/charmbracelet/soft-serve/pkg/proto"
"github.com/charmbracelet/soft-serve/pkg/ui/common"
@@ -6,10 +6,10 @@ import (
"io/fs"
"strings"
- "github.com/charmbracelet/bubbles/key"
- "github.com/charmbracelet/bubbles/list"
- tea "github.com/charmbracelet/bubbletea"
- "github.com/charmbracelet/lipgloss"
+ "github.com/charmbracelet/bubbles/v2/key"
+ "github.com/charmbracelet/bubbles/v2/list"
+ tea "github.com/charmbracelet/bubbletea/v2"
+ "github.com/charmbracelet/lipgloss/v2"
"github.com/charmbracelet/soft-serve/git"
"github.com/charmbracelet/soft-serve/pkg/ui/common"
"github.com/dustin/go-humanize"
@@ -139,7 +139,7 @@ func (d FileItemDelegate) Render(w io.Writer, m list.Model, index int, listItem
name = nameStyle.Render(name)
size = sizeStyle.Render(size)
modeStr := modeStyle.Render(mode.String())
- truncate := d.common.Renderer.NewStyle().MaxWidth(m.Width() -
+ truncate := lipgloss.NewStyle().MaxWidth(m.Width() -
s.Selector.GetHorizontalFrameSize() -
s.Selector.GetWidth())
//nolint:errcheck
@@ -5,11 +5,11 @@ import (
"strings"
"time"
- "github.com/charmbracelet/bubbles/key"
- "github.com/charmbracelet/bubbles/spinner"
- tea "github.com/charmbracelet/bubbletea"
+ "github.com/charmbracelet/bubbles/v2/key"
+ "github.com/charmbracelet/bubbles/v2/spinner"
+ tea "github.com/charmbracelet/bubbletea/v2"
gansi "github.com/charmbracelet/glamour/ansi"
- "github.com/charmbracelet/lipgloss"
+ "github.com/charmbracelet/lipgloss/v2"
"github.com/charmbracelet/soft-serve/git"
"github.com/charmbracelet/soft-serve/pkg/proto"
"github.com/charmbracelet/soft-serve/pkg/ui/common"
@@ -6,10 +6,10 @@ import (
"strings"
"time"
- "github.com/charmbracelet/bubbles/key"
- "github.com/charmbracelet/bubbles/list"
- tea "github.com/charmbracelet/bubbletea"
- "github.com/charmbracelet/lipgloss"
+ "github.com/charmbracelet/bubbles/v2/key"
+ "github.com/charmbracelet/bubbles/v2/list"
+ tea "github.com/charmbracelet/bubbletea/v2"
+ "github.com/charmbracelet/lipgloss/v2"
"github.com/charmbracelet/soft-serve/git"
"github.com/charmbracelet/soft-serve/pkg/ui/common"
"github.com/muesli/reflow/truncate"
@@ -4,9 +4,9 @@ import (
"fmt"
"path/filepath"
- "github.com/charmbracelet/bubbles/key"
- "github.com/charmbracelet/bubbles/spinner"
- tea "github.com/charmbracelet/bubbletea"
+ "github.com/charmbracelet/bubbles/v2/key"
+ "github.com/charmbracelet/bubbles/v2/spinner"
+ tea "github.com/charmbracelet/bubbletea/v2"
"github.com/charmbracelet/soft-serve/pkg/backend"
"github.com/charmbracelet/soft-serve/pkg/proto"
"github.com/charmbracelet/soft-serve/pkg/ui/common"
@@ -5,9 +5,9 @@ import (
"sort"
"strings"
- "github.com/charmbracelet/bubbles/key"
- "github.com/charmbracelet/bubbles/spinner"
- tea "github.com/charmbracelet/bubbletea"
+ "github.com/charmbracelet/bubbles/v2/key"
+ "github.com/charmbracelet/bubbles/v2/spinner"
+ tea "github.com/charmbracelet/bubbletea/v2"
"github.com/charmbracelet/soft-serve/git"
"github.com/charmbracelet/soft-serve/pkg/proto"
"github.com/charmbracelet/soft-serve/pkg/ui/common"
@@ -6,10 +6,10 @@ import (
"strings"
"time"
- "github.com/charmbracelet/bubbles/key"
- "github.com/charmbracelet/bubbles/list"
- tea "github.com/charmbracelet/bubbletea"
- "github.com/charmbracelet/lipgloss"
+ "github.com/charmbracelet/bubbles/v2/key"
+ "github.com/charmbracelet/bubbles/v2/list"
+ tea "github.com/charmbracelet/bubbletea/v2"
+ "github.com/charmbracelet/lipgloss/v2"
"github.com/charmbracelet/soft-serve/git"
"github.com/charmbracelet/soft-serve/pkg/ui/common"
"github.com/dustin/go-humanize"
@@ -4,15 +4,14 @@ import (
"fmt"
"strings"
- "github.com/charmbracelet/bubbles/help"
- "github.com/charmbracelet/bubbles/key"
- "github.com/charmbracelet/bubbles/spinner"
- tea "github.com/charmbracelet/bubbletea"
- "github.com/charmbracelet/lipgloss"
+ "github.com/charmbracelet/bubbles/v2/help"
+ "github.com/charmbracelet/bubbles/v2/key"
+ "github.com/charmbracelet/bubbles/v2/spinner"
+ tea "github.com/charmbracelet/bubbletea/v2"
+ "github.com/charmbracelet/lipgloss/v2"
"github.com/charmbracelet/soft-serve/git"
"github.com/charmbracelet/soft-serve/pkg/proto"
"github.com/charmbracelet/soft-serve/pkg/ui/common"
- "github.com/charmbracelet/soft-serve/pkg/ui/components/footer"
"github.com/charmbracelet/soft-serve/pkg/ui/components/selector"
"github.com/charmbracelet/soft-serve/pkg/ui/components/statusbar"
"github.com/charmbracelet/soft-serve/pkg/ui/components/tabs"
@@ -177,29 +176,26 @@ func (r *Repo) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
if cmd != nil {
cmds = append(cmds, cmd)
}
- if r.selectedRepo != nil {
- urlID := fmt.Sprintf("%s-url", r.selectedRepo.Name())
- cmd := r.common.CloneCmd(r.common.Config().SSH.PublicURL, r.selectedRepo.Name())
- if msg, ok := msg.(tea.MouseMsg); ok && r.common.Zone.Get(urlID).InBounds(msg) {
- cmds = append(cmds, copyCmd(cmd, "Command copied to clipboard"))
- }
- }
+ // if r.selectedRepo != nil {
+ // urlID := fmt.Sprintf("%s-url", r.selectedRepo.Name())
+ // cmd := r.common.CloneCmd(r.common.Config().SSH.PublicURL, r.selectedRepo.Name())
+ // if msg, ok := msg.(tea.MouseMsg); ok && r.common.Zone.Get(urlID).InBounds(msg) {
+ // cmds = append(cmds, copyCmd(cmd, "Command copied to clipboard"))
+ // }
+ // }
switch msg := msg.(type) {
- case tea.MouseMsg:
- if msg.Action != tea.MouseActionPress {
- break
- }
+ case tea.MouseClickMsg:
switch msg.Button {
- case tea.MouseButtonLeft:
- switch {
- case r.common.Zone.Get("repo-help").InBounds(msg):
- cmds = append(cmds, footer.ToggleFooterCmd)
- }
- case tea.MouseButtonRight:
- switch {
- case r.common.Zone.Get("repo-main").InBounds(msg):
- cmds = append(cmds, goBackCmd)
- }
+ case tea.MouseLeft:
+ // switch {
+ // case r.common.Zone.Get("repo-help").InBounds(msg):
+ // cmds = append(cmds, footer.ToggleFooterCmd)
+ // }
+ case tea.MouseRight:
+ // switch {
+ // case r.common.Zone.Get("repo-main").InBounds(msg):
+ // cmds = append(cmds, goBackCmd)
+ // }
}
}
switch msg := msg.(type) {
@@ -212,7 +208,7 @@ func (r *Repo) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
case CopyMsg:
txt := msg.Text
if cfg := r.common.Config(); cfg != nil {
- r.common.Output.Copy(txt)
+ cmds = append(cmds, tea.SetClipboard(txt))
}
r.statusbar.SetStatus("", msg.Message, "", "")
case ReadmeMsg:
@@ -326,7 +322,7 @@ func (r *Repo) headerView() string {
if r.selectedRepo == nil {
return ""
}
- truncate := r.common.Renderer.NewStyle().MaxWidth(r.common.Width)
+ truncate := lipgloss.NewStyle().MaxWidth(r.common.Width)
header := r.selectedRepo.ProjectName()
if header == "" {
header = r.selectedRepo.Name()
@@ -4,10 +4,10 @@ import (
"fmt"
gitm "github.com/aymanbagabas/git-module"
- "github.com/charmbracelet/bubbles/key"
- "github.com/charmbracelet/bubbles/spinner"
- tea "github.com/charmbracelet/bubbletea"
- "github.com/charmbracelet/lipgloss"
+ "github.com/charmbracelet/bubbles/v2/key"
+ "github.com/charmbracelet/bubbles/v2/spinner"
+ tea "github.com/charmbracelet/bubbletea/v2"
+ "github.com/charmbracelet/lipgloss/v2"
"github.com/charmbracelet/soft-serve/git"
"github.com/charmbracelet/soft-serve/pkg/proto"
"github.com/charmbracelet/soft-serve/pkg/ui/common"
@@ -5,9 +5,9 @@ import (
"io"
gitm "github.com/aymanbagabas/git-module"
- "github.com/charmbracelet/bubbles/key"
- "github.com/charmbracelet/bubbles/list"
- tea "github.com/charmbracelet/bubbletea"
+ "github.com/charmbracelet/bubbles/v2/key"
+ "github.com/charmbracelet/bubbles/v2/list"
+ tea "github.com/charmbracelet/bubbletea/v2"
"github.com/charmbracelet/soft-serve/pkg/ui/common"
)
@@ -7,10 +7,10 @@ import (
"strings"
"time"
- "github.com/charmbracelet/bubbles/key"
- "github.com/charmbracelet/bubbles/list"
- tea "github.com/charmbracelet/bubbletea"
- "github.com/charmbracelet/lipgloss"
+ "github.com/charmbracelet/bubbles/v2/key"
+ "github.com/charmbracelet/bubbles/v2/list"
+ tea "github.com/charmbracelet/bubbletea/v2"
+ "github.com/charmbracelet/lipgloss/v2"
"github.com/charmbracelet/soft-serve/pkg/proto"
"github.com/charmbracelet/soft-serve/pkg/ui/common"
"github.com/dustin/go-humanize"
@@ -139,8 +139,10 @@ func (d *ItemDelegate) Update(msg tea.Msg, m *list.Model) tea.Cmd {
switch {
case key.Matches(msg, d.common.KeyMap.Copy):
d.copiedIdx = idx
- d.common.Output.Copy(item.Command())
- return m.SetItem(idx, item)
+ return tea.Batch(
+ tea.SetClipboard(item.Command()),
+ m.SetItem(idx, item),
+ )
}
}
return nil
@@ -4,10 +4,10 @@ import (
"fmt"
"sort"
- "github.com/charmbracelet/bubbles/key"
- "github.com/charmbracelet/bubbles/list"
- tea "github.com/charmbracelet/bubbletea"
- "github.com/charmbracelet/lipgloss"
+ "github.com/charmbracelet/bubbles/v2/key"
+ "github.com/charmbracelet/bubbles/v2/list"
+ tea "github.com/charmbracelet/bubbletea/v2"
+ "github.com/charmbracelet/lipgloss/v2"
"github.com/charmbracelet/soft-serve/pkg/access"
"github.com/charmbracelet/soft-serve/pkg/backend"
"github.com/charmbracelet/soft-serve/pkg/ui/common"
@@ -51,7 +51,7 @@ func New(c common.Common) *Selection {
ts[i] = b.String()
}
t := tabs.New(c, ts)
- t.TabSeparator = c.Renderer.NewStyle()
+ t.TabSeparator = lipgloss.NewStyle()
t.TabInactive = c.Styles.TopLevelNormalTab
t.TabActive = c.Styles.TopLevelActiveTab
t.TabDot = c.Styles.TopLevelActiveTabDot
@@ -289,15 +289,15 @@ func (s *Selection) View() string {
wm, hm := s.getMargins()
switch s.activePane {
case selectorPane:
- ss := s.common.Renderer.NewStyle().
+ ss := lipgloss.NewStyle().
Width(s.common.Width - wm).
Height(s.common.Height - hm)
view = ss.Render(s.selector.View())
case readmePane:
- rs := s.common.Renderer.NewStyle().
+ rs := lipgloss.NewStyle().
Height(s.common.Height - hm)
status := fmt.Sprintf("☰ %.f%%", s.readme.ScrollPercent()*100)
- readmeStatus := s.common.Renderer.NewStyle().
+ readmeStatus := lipgloss.NewStyle().
Align(lipgloss.Right).
Width(s.common.Width - wm).
Foreground(s.common.Styles.InactiveBorderColor).
@@ -1,7 +1,9 @@
package styles
import (
- "github.com/charmbracelet/lipgloss"
+ "image/color"
+
+ "github.com/charmbracelet/lipgloss/v2"
)
// XXX: For now, this is in its own package so that it can be shared between
@@ -9,8 +11,8 @@ import (
// Styles defines styles for the UI.
type Styles struct {
- ActiveBorderColor lipgloss.Color
- InactiveBorderColor lipgloss.Color
+ ActiveBorderColor color.Color
+ InactiveBorderColor color.Color
App lipgloss.Style
ServerName lipgloss.Style
@@ -165,7 +167,7 @@ type Styles struct {
}
// DefaultStyles returns default styles for the UI.
-func DefaultStyles(r *lipgloss.Renderer) *Styles {
+func DefaultStyles() *Styles {
highlightColor := lipgloss.Color("210")
highlightColorDim := lipgloss.Color("174")
selectorColor := lipgloss.Color("167")
@@ -176,10 +178,10 @@ func DefaultStyles(r *lipgloss.Renderer) *Styles {
s.ActiveBorderColor = lipgloss.Color("62")
s.InactiveBorderColor = lipgloss.Color("241")
- s.App = r.NewStyle().
+ s.App = lipgloss.NewStyle().
Margin(1, 2)
- s.ServerName = r.NewStyle().
+ s.ServerName = lipgloss.NewStyle().
Height(1).
MarginLeft(1).
MarginBottom(1).
@@ -188,29 +190,29 @@ func DefaultStyles(r *lipgloss.Renderer) *Styles {
Foreground(lipgloss.Color("229")).
Bold(true)
- s.TopLevelNormalTab = r.NewStyle().
+ s.TopLevelNormalTab = lipgloss.NewStyle().
MarginRight(2)
s.TopLevelActiveTab = s.TopLevelNormalTab.
Foreground(lipgloss.Color("36"))
- s.TopLevelActiveTabDot = r.NewStyle().
+ s.TopLevelActiveTabDot = lipgloss.NewStyle().
Foreground(lipgloss.Color("36"))
- s.RepoSelector.Normal.Base = r.NewStyle().
+ s.RepoSelector.Normal.Base = lipgloss.NewStyle().
PaddingLeft(1).
Border(lipgloss.Border{Left: " "}, false, false, false, true).
Height(3)
- s.RepoSelector.Normal.Title = r.NewStyle().Bold(true)
+ s.RepoSelector.Normal.Title = lipgloss.NewStyle().Bold(true)
- s.RepoSelector.Normal.Desc = r.NewStyle().
+ s.RepoSelector.Normal.Desc = lipgloss.NewStyle().
Foreground(lipgloss.Color("243"))
- s.RepoSelector.Normal.Command = r.NewStyle().
+ s.RepoSelector.Normal.Command = lipgloss.NewStyle().
Foreground(lipgloss.Color("132"))
- s.RepoSelector.Normal.Updated = r.NewStyle().
+ s.RepoSelector.Normal.Updated = lipgloss.NewStyle().
Foreground(lipgloss.Color("243"))
s.RepoSelector.Active.Base = s.RepoSelector.Normal.Base.
@@ -229,78 +231,78 @@ func DefaultStyles(r *lipgloss.Renderer) *Styles {
s.RepoSelector.Active.Command = s.RepoSelector.Normal.Command.
Foreground(lipgloss.Color("204"))
- s.MenuItem = r.NewStyle().
+ s.MenuItem = lipgloss.NewStyle().
PaddingLeft(1).
Border(lipgloss.Border{
Left: " ",
}, false, false, false, true).
Height(3)
- s.MenuLastUpdate = r.NewStyle().
+ s.MenuLastUpdate = lipgloss.NewStyle().
Foreground(lipgloss.Color("241")).
Align(lipgloss.Right)
- s.Repo.Base = r.NewStyle()
+ s.Repo.Base = lipgloss.NewStyle()
- s.Repo.Title = r.NewStyle().
+ s.Repo.Title = lipgloss.NewStyle().
Padding(0, 2)
- s.Repo.Command = r.NewStyle().
+ s.Repo.Command = lipgloss.NewStyle().
Foreground(lipgloss.Color("168"))
- s.Repo.Body = r.NewStyle().
+ s.Repo.Body = lipgloss.NewStyle().
Margin(1, 0)
- s.Repo.Header = r.NewStyle().
+ s.Repo.Header = lipgloss.NewStyle().
MaxHeight(2).
Border(lipgloss.NormalBorder(), false, false, true, false).
BorderForeground(lipgloss.Color("236"))
- s.Repo.HeaderName = r.NewStyle().
+ s.Repo.HeaderName = lipgloss.NewStyle().
Foreground(lipgloss.Color("212")).
Bold(true)
- s.Repo.HeaderDesc = r.NewStyle().
+ s.Repo.HeaderDesc = lipgloss.NewStyle().
Foreground(lipgloss.Color("243"))
- s.Footer = r.NewStyle().
+ s.Footer = lipgloss.NewStyle().
MarginTop(1).
Padding(0, 1).
Height(1)
- s.Branch = r.NewStyle().
+ s.Branch = lipgloss.NewStyle().
Foreground(lipgloss.Color("203")).
Background(lipgloss.Color("236")).
Padding(0, 1)
- s.HelpKey = r.NewStyle().
+ s.HelpKey = lipgloss.NewStyle().
Foreground(lipgloss.Color("241"))
- s.HelpValue = r.NewStyle().
+ s.HelpValue = lipgloss.NewStyle().
Foreground(lipgloss.Color("239"))
- s.HelpDivider = r.NewStyle().
+ s.HelpDivider = lipgloss.NewStyle().
Foreground(lipgloss.Color("237")).
SetString(" • ")
- s.URLStyle = r.NewStyle().
+ s.URLStyle = lipgloss.NewStyle().
MarginLeft(1).
Foreground(lipgloss.Color("168"))
- s.Error = r.NewStyle().
+ s.Error = lipgloss.NewStyle().
MarginTop(2)
- s.ErrorTitle = r.NewStyle().
+ s.ErrorTitle = lipgloss.NewStyle().
Foreground(lipgloss.Color("230")).
Background(lipgloss.Color("204")).
Bold(true).
Padding(0, 1)
- s.ErrorBody = r.NewStyle().
+ s.ErrorBody = lipgloss.NewStyle().
Foreground(lipgloss.Color("252")).
MarginLeft(2)
- s.LogItem.Normal.Base = r.NewStyle().
+ s.LogItem.Normal.Base = lipgloss.NewStyle().
Border(lipgloss.Border{
Left: " ",
}, false, false, false, true).
@@ -315,113 +317,113 @@ func DefaultStyles(r *lipgloss.Renderer) *Styles {
s.LogItem.Active.Hash = s.LogItem.Normal.Hash.
Foreground(hashColor)
- s.LogItem.Active.Hash = r.NewStyle().
+ s.LogItem.Active.Hash = lipgloss.NewStyle().
Bold(true).
Foreground(highlightColor)
- s.LogItem.Normal.Title = r.NewStyle().
+ s.LogItem.Normal.Title = lipgloss.NewStyle().
Foreground(lipgloss.Color("105"))
- s.LogItem.Active.Title = r.NewStyle().
+ s.LogItem.Active.Title = lipgloss.NewStyle().
Foreground(highlightColor).
Bold(true)
- s.LogItem.Normal.Desc = r.NewStyle().
+ s.LogItem.Normal.Desc = lipgloss.NewStyle().
Foreground(lipgloss.Color("246"))
- s.LogItem.Active.Desc = r.NewStyle().
+ s.LogItem.Active.Desc = lipgloss.NewStyle().
Foreground(lipgloss.Color("95"))
s.LogItem.Active.Keyword = s.LogItem.Active.Desc.
Foreground(highlightColorDim)
- s.LogItem.Normal.Hash = r.NewStyle().
+ s.LogItem.Normal.Hash = lipgloss.NewStyle().
Foreground(hashColor)
- s.LogItem.Active.Hash = r.NewStyle().
+ s.LogItem.Active.Hash = lipgloss.NewStyle().
Foreground(highlightColor)
- s.Log.Commit = r.NewStyle().
+ s.Log.Commit = lipgloss.NewStyle().
Margin(0, 2)
- s.Log.CommitHash = r.NewStyle().
+ s.Log.CommitHash = lipgloss.NewStyle().
Foreground(hashColor).
Bold(true)
- s.Log.CommitBody = r.NewStyle().
+ s.Log.CommitBody = lipgloss.NewStyle().
MarginTop(1).
MarginLeft(2)
- s.Log.CommitStatsAdd = r.NewStyle().
+ s.Log.CommitStatsAdd = lipgloss.NewStyle().
Foreground(lipgloss.Color("42")).
Bold(true)
- s.Log.CommitStatsDel = r.NewStyle().
+ s.Log.CommitStatsDel = lipgloss.NewStyle().
Foreground(lipgloss.Color("203")).
Bold(true)
- s.Log.Paginator = r.NewStyle().
+ s.Log.Paginator = lipgloss.NewStyle().
Margin(0).
Align(lipgloss.Center)
- s.Ref.Normal.Item = r.NewStyle()
+ s.Ref.Normal.Item = lipgloss.NewStyle()
- s.Ref.ItemSelector = r.NewStyle().
+ s.Ref.ItemSelector = lipgloss.NewStyle().
Foreground(selectorColor).
SetString("> ")
- s.Ref.Active.Item = r.NewStyle().
+ s.Ref.Active.Item = lipgloss.NewStyle().
Foreground(highlightColorDim)
- s.Ref.Normal.Base = r.NewStyle()
+ s.Ref.Normal.Base = lipgloss.NewStyle()
- s.Ref.Active.Base = r.NewStyle()
+ s.Ref.Active.Base = lipgloss.NewStyle()
- s.Ref.Normal.ItemTag = r.NewStyle().
+ s.Ref.Normal.ItemTag = lipgloss.NewStyle().
Foreground(lipgloss.Color("39"))
- s.Ref.Active.ItemTag = r.NewStyle().
+ s.Ref.Active.ItemTag = lipgloss.NewStyle().
Bold(true).
Foreground(highlightColor)
- s.Ref.Active.Item = r.NewStyle().
+ s.Ref.Active.Item = lipgloss.NewStyle().
Bold(true).
Foreground(highlightColor)
- s.Ref.Normal.ItemDesc = r.NewStyle().
+ s.Ref.Normal.ItemDesc = lipgloss.NewStyle().
Faint(true)
- s.Ref.Active.ItemDesc = r.NewStyle().
+ s.Ref.Active.ItemDesc = lipgloss.NewStyle().
Foreground(highlightColor).
Faint(true)
- s.Ref.Normal.ItemHash = r.NewStyle().
+ s.Ref.Normal.ItemHash = lipgloss.NewStyle().
Foreground(hashColor).
Bold(true)
- s.Ref.Active.ItemHash = r.NewStyle().
+ s.Ref.Active.ItemHash = lipgloss.NewStyle().
Foreground(highlightColor).
Bold(true)
s.Ref.Paginator = s.Log.Paginator
- s.Ref.Selector = r.NewStyle()
+ s.Ref.Selector = lipgloss.NewStyle()
s.Tree.Selector = s.Tree.Normal.FileName.
Width(1).
Foreground(selectorColor)
- s.Tree.Normal.FileName = r.NewStyle().
+ s.Tree.Normal.FileName = lipgloss.NewStyle().
MarginLeft(1)
s.Tree.Active.FileName = s.Tree.Normal.FileName.
Bold(true).
Foreground(highlightColor)
- s.Tree.Normal.FileDir = r.NewStyle().
+ s.Tree.Normal.FileDir = lipgloss.NewStyle().
Foreground(lipgloss.Color("39"))
- s.Tree.Active.FileDir = r.NewStyle().
+ s.Tree.Active.FileDir = lipgloss.NewStyle().
Foreground(highlightColor)
s.Tree.Normal.FileMode = s.Tree.Active.FileName.
@@ -437,87 +439,87 @@ func DefaultStyles(r *lipgloss.Renderer) *Styles {
s.Tree.Active.FileSize = s.Tree.Normal.FileName.
Foreground(highlightColorDim)
- s.Tree.FileContent = r.NewStyle()
+ s.Tree.FileContent = lipgloss.NewStyle()
s.Tree.Paginator = s.Log.Paginator
- s.Tree.Blame.Hash = r.NewStyle().
+ s.Tree.Blame.Hash = lipgloss.NewStyle().
Foreground(hashColor).
Bold(true)
- s.Tree.Blame.Message = r.NewStyle()
+ s.Tree.Blame.Message = lipgloss.NewStyle()
- s.Tree.Blame.Who = r.NewStyle().
+ s.Tree.Blame.Who = lipgloss.NewStyle().
Faint(true)
- s.Spinner = r.NewStyle().
+ s.Spinner = lipgloss.NewStyle().
MarginTop(1).
MarginLeft(2).
Foreground(lipgloss.Color("205"))
- s.SpinnerContainer = r.NewStyle()
+ s.SpinnerContainer = lipgloss.NewStyle()
- s.NoContent = r.NewStyle().
+ s.NoContent = lipgloss.NewStyle().
MarginTop(1).
MarginLeft(2).
Foreground(lipgloss.Color("242"))
- s.StatusBar = r.NewStyle().
+ s.StatusBar = lipgloss.NewStyle().
Height(1)
- s.StatusBarKey = r.NewStyle().
+ s.StatusBarKey = lipgloss.NewStyle().
Bold(true).
Padding(0, 1).
Background(lipgloss.Color("206")).
Foreground(lipgloss.Color("228"))
- s.StatusBarValue = r.NewStyle().
+ s.StatusBarValue = lipgloss.NewStyle().
Padding(0, 1).
Background(lipgloss.Color("235")).
Foreground(lipgloss.Color("243"))
- s.StatusBarInfo = r.NewStyle().
+ s.StatusBarInfo = lipgloss.NewStyle().
Padding(0, 1).
Background(lipgloss.Color("212")).
Foreground(lipgloss.Color("230"))
- s.StatusBarBranch = r.NewStyle().
+ s.StatusBarBranch = lipgloss.NewStyle().
Padding(0, 1).
Background(lipgloss.Color("62")).
Foreground(lipgloss.Color("230"))
- s.StatusBarHelp = r.NewStyle().
+ s.StatusBarHelp = lipgloss.NewStyle().
Padding(0, 1).
Background(lipgloss.Color("237")).
Foreground(lipgloss.Color("243"))
- s.Tabs = r.NewStyle().
+ s.Tabs = lipgloss.NewStyle().
Height(1)
- s.TabInactive = r.NewStyle()
+ s.TabInactive = lipgloss.NewStyle()
- s.TabActive = r.NewStyle().
+ s.TabActive = lipgloss.NewStyle().
Underline(true).
Foreground(lipgloss.Color("36"))
- s.TabSeparator = r.NewStyle().
+ s.TabSeparator = lipgloss.NewStyle().
SetString("│").
Padding(0, 1).
Foreground(lipgloss.Color("238"))
- s.Code.LineDigit = r.NewStyle().Foreground(lipgloss.Color("239"))
+ s.Code.LineDigit = lipgloss.NewStyle().Foreground(lipgloss.Color("239"))
- s.Code.LineBar = r.NewStyle().Foreground(lipgloss.Color("236"))
+ s.Code.LineBar = lipgloss.NewStyle().Foreground(lipgloss.Color("236"))
- s.Stash.Normal.Message = r.NewStyle().MarginLeft(1)
+ s.Stash.Normal.Message = lipgloss.NewStyle().MarginLeft(1)
s.Stash.Active.Message = s.Stash.Normal.Message.Foreground(selectorColor)
- s.Stash.Title = r.NewStyle().
+ s.Stash.Title = lipgloss.NewStyle().
Foreground(hashColor).
Bold(true)
- s.Stash.Selector = r.NewStyle().
+ s.Stash.Selector = lipgloss.NewStyle().
Width(1).
Foreground(selectorColor)