Skip to content

Commit 40091c1

Browse files
authored
feat: migrate charmbracelet/bubbles to v2 (charm.land/bubbles/v2) (#21520)
1 parent ef76aff commit 40091c1

10 files changed

Lines changed: 246 additions & 154 deletions

File tree

go.mod

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ module github.com/github/gh-aw
33
go 1.25.0
44

55
require (
6-
github.com/charmbracelet/bubbles v1.0.0
7-
github.com/charmbracelet/bubbletea v1.3.10
6+
charm.land/bubbles/v2 v2.0.0
7+
charm.land/bubbletea/v2 v2.0.2
8+
charm.land/lipgloss/v2 v2.0.2
89
github.com/charmbracelet/huh v0.8.0
9-
github.com/charmbracelet/lipgloss v1.1.1-0.20250319133953-166f707985bc
1010
github.com/charmbracelet/x/exp/golden v0.0.0-20251215102626-e0db08df7383
1111
github.com/cli/go-gh/v2 v2.13.0
1212
github.com/creack/pty v1.1.24
@@ -33,22 +33,27 @@ require (
3333
github.com/anthropics/anthropic-sdk-go v1.26.0 // indirect
3434
github.com/atotto/clipboard v0.1.4 // indirect
3535
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
36-
github.com/aymanbagabas/go-udiff v0.3.1 // indirect
36+
github.com/aymanbagabas/go-udiff v0.4.1 // indirect
3737
github.com/bmatcuk/doublestar/v4 v4.10.0 // indirect
3838
github.com/catppuccin/go v0.3.0 // indirect
3939
github.com/ccojocar/zxcvbn-go v1.0.4 // indirect
4040
github.com/cespare/xxhash/v2 v2.3.0 // indirect
41-
github.com/charmbracelet/colorprofile v0.4.1 // indirect
41+
github.com/charmbracelet/bubbles v1.0.0 // indirect
42+
github.com/charmbracelet/bubbletea v1.3.10 // indirect
43+
github.com/charmbracelet/colorprofile v0.4.2 // indirect
4244
github.com/charmbracelet/harmonica v0.2.0 // indirect
45+
github.com/charmbracelet/lipgloss v1.1.1-0.20250319133953-166f707985bc // indirect
46+
github.com/charmbracelet/ultraviolet v0.0.0-20260205113103-524a6607adb8 // indirect
4347
github.com/charmbracelet/x/ansi v0.11.6 // indirect
4448
github.com/charmbracelet/x/cellbuf v0.0.15 // indirect
4549
github.com/charmbracelet/x/exp/strings v0.0.0-20251106172358-54469c29c2bc // indirect
4650
github.com/charmbracelet/x/term v0.2.2 // indirect
51+
github.com/charmbracelet/x/termios v0.1.1 // indirect
52+
github.com/charmbracelet/x/windows v0.2.2 // indirect
4753
github.com/cli/safeexec v1.0.1 // indirect
4854
github.com/cli/shurcooL-graphql v0.0.4 // indirect
49-
github.com/clipperhouse/displaywidth v0.9.0 // indirect
50-
github.com/clipperhouse/stringish v0.1.1 // indirect
51-
github.com/clipperhouse/uax29/v2 v2.6.0 // indirect
55+
github.com/clipperhouse/displaywidth v0.11.0 // indirect
56+
github.com/clipperhouse/uax29/v2 v2.7.0 // indirect
5257
github.com/davecgh/go-spew v1.1.1 // indirect
5358
github.com/dlclark/regexp2 v1.11.5 // indirect
5459
github.com/dustin/go-humanize v1.0.1 // indirect
@@ -70,7 +75,7 @@ require (
7075
github.com/mattn/go-colorable v0.1.14 // indirect
7176
github.com/mattn/go-isatty v0.0.20 // indirect
7277
github.com/mattn/go-localereader v0.0.1 // indirect
73-
github.com/mattn/go-runewidth v0.0.19 // indirect
78+
github.com/mattn/go-runewidth v0.0.20 // indirect
7479
github.com/mattn/go-shellwords v1.0.12 // indirect
7580
github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect
7681
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect
@@ -103,7 +108,7 @@ require (
103108
golang.org/x/net v0.51.0 // indirect
104109
golang.org/x/oauth2 v0.34.0 // indirect
105110
golang.org/x/sync v0.19.0 // indirect
106-
golang.org/x/sys v0.41.0 // indirect
111+
golang.org/x/sys v0.42.0 // indirect
107112
golang.org/x/telemetry v0.0.0-20260209163413-e7419c687ee4 // indirect
108113
golang.org/x/text v0.34.0 // indirect
109114
golang.org/x/tools v0.42.0 // indirect

go.sum

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
charm.land/bubbles/v2 v2.0.0 h1:tE3eK/pHjmtrDiRdoC9uGNLgpopOd8fjhEe31B/ai5s=
2+
charm.land/bubbles/v2 v2.0.0/go.mod h1:rCHoleP2XhU8um45NTuOWBPNVHxnkXKTiZqcclL/qOI=
3+
charm.land/bubbletea/v2 v2.0.2 h1:4CRtRnuZOdFDTWSff9r8QFt/9+z6Emubz3aDMnf/dx0=
4+
charm.land/bubbletea/v2 v2.0.2/go.mod h1:3LRff2U4WIYXy7MTxfbAQ+AdfM3D8Xuvz2wbsOD9OHQ=
5+
charm.land/lipgloss/v2 v2.0.2 h1:xFolbF8JdpNkM2cEPTfXEcW1p6NRzOWTSamRfYEw8cs=
6+
charm.land/lipgloss/v2 v2.0.2/go.mod h1:KjPle2Qd3YmvP1KL5OMHiHysGcNwq6u83MUjYkFvEkM=
17
cloud.google.com/go v0.121.2 h1:v2qQpN6Dx9x2NmwrqlesOt3Ys4ol5/lFZ6Mg1B7OJCg=
28
cloud.google.com/go v0.121.2/go.mod h1:nRFlrHq39MNVWu+zESP2PosMWA0ryJw8KUBZ2iZpxbw=
39
cloud.google.com/go/auth v0.16.5 h1:mFWNQ2FEVWAliEQWpAdH80omXFokmrnbDhUS9cBywsI=
@@ -14,8 +20,8 @@ github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z
1420
github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI=
1521
github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k=
1622
github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8=
17-
github.com/aymanbagabas/go-udiff v0.3.1 h1:LV+qyBQ2pqe0u42ZsUEtPiCaUoqgA9gYRDs3vj1nolY=
18-
github.com/aymanbagabas/go-udiff v0.3.1/go.mod h1:G0fsKmG+P6ylD0r6N/KgQD/nWzgfnl8ZBcNLgcbrw8E=
23+
github.com/aymanbagabas/go-udiff v0.4.1 h1:OEIrQ8maEeDBXQDoGCbbTTXYJMYRCRO1fnodZ12Gv5o=
24+
github.com/aymanbagabas/go-udiff v0.4.1/go.mod h1:0L9PGwj20lrtmEMeyw4WKJ/TMyDtvAoK9bf2u/mNo3w=
1925
github.com/bmatcuk/doublestar/v4 v4.10.0 h1:zU9WiOla1YA122oLM6i4EXvGW62DvKZVxIe6TYWexEs=
2026
github.com/bmatcuk/doublestar/v4 v4.10.0/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc=
2127
github.com/catppuccin/go v0.3.0 h1:d+0/YicIq+hSTo5oPuRi5kOpqkVA5tAsU6dNhvRu+aY=
@@ -28,14 +34,16 @@ github.com/charmbracelet/bubbles v1.0.0 h1:12J8/ak/uCZEMQ6KU7pcfwceyjLlWsDLAxB5f
2834
github.com/charmbracelet/bubbles v1.0.0/go.mod h1:9d/Zd5GdnauMI5ivUIVisuEm3ave1XwXtD1ckyV6r3E=
2935
github.com/charmbracelet/bubbletea v1.3.10 h1:otUDHWMMzQSB0Pkc87rm691KZ3SWa4KUlvF9nRvCICw=
3036
github.com/charmbracelet/bubbletea v1.3.10/go.mod h1:ORQfo0fk8U+po9VaNvnV95UPWA1BitP1E0N6xJPlHr4=
31-
github.com/charmbracelet/colorprofile v0.4.1 h1:a1lO03qTrSIRaK8c3JRxJDZOvhvIeSco3ej+ngLk1kk=
32-
github.com/charmbracelet/colorprofile v0.4.1/go.mod h1:U1d9Dljmdf9DLegaJ0nGZNJvoXAhayhmidOdcBwAvKk=
37+
github.com/charmbracelet/colorprofile v0.4.2 h1:BdSNuMjRbotnxHSfxy+PCSa4xAmz7szw70ktAtWRYrY=
38+
github.com/charmbracelet/colorprofile v0.4.2/go.mod h1:0rTi81QpwDElInthtrQ6Ni7cG0sDtwAd4C4le060fT8=
3339
github.com/charmbracelet/harmonica v0.2.0 h1:8NxJWRWg/bzKqqEaaeFNipOu77YR5t8aSwG4pgaUBiQ=
3440
github.com/charmbracelet/harmonica v0.2.0/go.mod h1:KSri/1RMQOZLbw7AHqgcBycp8pgJnQMYYT8QZRqZ1Ao=
3541
github.com/charmbracelet/huh v0.8.0 h1:Xz/Pm2h64cXQZn/Jvele4J3r7DDiqFCNIVteYukxDvY=
3642
github.com/charmbracelet/huh v0.8.0/go.mod h1:5YVc+SlZ1IhQALxRPpkGwwEKftN/+OlJlnJYlDRFqN4=
3743
github.com/charmbracelet/lipgloss v1.1.1-0.20250319133953-166f707985bc h1:nFRtCfZu/zkltd2lsLUPlVNv3ej/Atod9hcdbRZtlys=
3844
github.com/charmbracelet/lipgloss v1.1.1-0.20250319133953-166f707985bc/go.mod h1:aKC/t2arECF6rNOnaKaVU6y4t4ZeHQzqfxedE/VkVhA=
45+
github.com/charmbracelet/ultraviolet v0.0.0-20260205113103-524a6607adb8 h1:eyFRbAmexyt43hVfeyBofiGSEmJ7krjLOYt/9CF5NKA=
46+
github.com/charmbracelet/ultraviolet v0.0.0-20260205113103-524a6607adb8/go.mod h1:SQpCTRNBtzJkwku5ye4S3HEuthAlGy2n9VXZnWkEW98=
3947
github.com/charmbracelet/x/ansi v0.11.6 h1:GhV21SiDz/45W9AnV2R61xZMRri5NlLnl6CVF7ihZW8=
4048
github.com/charmbracelet/x/ansi v0.11.6/go.mod h1:2JNYLgQUsyqaiLovhU2Rv/pb8r6ydXKS3NIttu3VGZQ=
4149
github.com/charmbracelet/x/cellbuf v0.0.15 h1:ur3pZy0o6z/R7EylET877CBxaiE1Sp1GMxoFPAIztPI=
@@ -52,6 +60,8 @@ github.com/charmbracelet/x/term v0.2.2 h1:xVRT/S2ZcKdhhOuSP4t5cLi5o+JxklsoEObBSg
5260
github.com/charmbracelet/x/term v0.2.2/go.mod h1:kF8CY5RddLWrsgVwpw4kAa6TESp6EB5y3uxGLeCqzAI=
5361
github.com/charmbracelet/x/termios v0.1.1 h1:o3Q2bT8eqzGnGPOYheoYS8eEleT5ZVNYNy8JawjaNZY=
5462
github.com/charmbracelet/x/termios v0.1.1/go.mod h1:rB7fnv1TgOPOyyKRJ9o+AsTU/vK5WHJ2ivHeut/Pcwo=
63+
github.com/charmbracelet/x/windows v0.2.2 h1:IofanmuvaxnKHuV04sC0eBy/smG6kIKrWG2/jYn2GuM=
64+
github.com/charmbracelet/x/windows v0.2.2/go.mod h1:/8XtdKZzedat74NQFn0NGlGL4soHB0YQZrETF96h75k=
5565
github.com/charmbracelet/x/xpty v0.1.2 h1:Pqmu4TEJ8KeA9uSkISKMU3f+C1F6OGBn8ABuGlqCbtI=
5666
github.com/charmbracelet/x/xpty v0.1.2/go.mod h1:XK2Z0id5rtLWcpeNiMYBccNNBrP2IJnzHI0Lq13Xzq4=
5767
github.com/cli/go-gh/v2 v2.13.0 h1:jEHZu/VPVoIJkciK3pzZd3rbT8J90swsK5Ui4ewH1ys=
@@ -60,12 +70,10 @@ github.com/cli/safeexec v1.0.1 h1:e/C79PbXF4yYTN/wauC4tviMxEV13BwljGj0N9j+N00=
6070
github.com/cli/safeexec v1.0.1/go.mod h1:Z/D4tTN8Vs5gXYHDCbaM1S/anmEDnJb1iW0+EJ5zx3Q=
6171
github.com/cli/shurcooL-graphql v0.0.4 h1:6MogPnQJLjKkaXPyGqPRXOI2qCsQdqNfUY1QSJu2GuY=
6272
github.com/cli/shurcooL-graphql v0.0.4/go.mod h1:3waN4u02FiZivIV+p1y4d0Jo1jc6BViMA73C+sZo2fk=
63-
github.com/clipperhouse/displaywidth v0.9.0 h1:Qb4KOhYwRiN3viMv1v/3cTBlz3AcAZX3+y9OLhMtAtA=
64-
github.com/clipperhouse/displaywidth v0.9.0/go.mod h1:aCAAqTlh4GIVkhQnJpbL0T/WfcrJXHcj8C0yjYcjOZA=
65-
github.com/clipperhouse/stringish v0.1.1 h1:+NSqMOr3GR6k1FdRhhnXrLfztGzuG+VuFDfatpWHKCs=
66-
github.com/clipperhouse/stringish v0.1.1/go.mod h1:v/WhFtE1q0ovMta2+m+UbpZ+2/HEXNWYXQgCt4hdOzA=
67-
github.com/clipperhouse/uax29/v2 v2.6.0 h1:z0cDbUV+aPASdFb2/ndFnS9ts/WNXgTNNGFoKXuhpos=
68-
github.com/clipperhouse/uax29/v2 v2.6.0/go.mod h1:Wn1g7MK6OoeDT0vL+Q0SQLDz/KpfsVRgg6W7ihQeh4g=
73+
github.com/clipperhouse/displaywidth v0.11.0 h1:lBc6kY44VFw+TDx4I8opi/EtL9m20WSEFgwIwO+UVM8=
74+
github.com/clipperhouse/displaywidth v0.11.0/go.mod h1:bkrFNkf81G8HyVqmKGxsPufD3JhNl3dSqnGhOoSD/o0=
75+
github.com/clipperhouse/uax29/v2 v2.7.0 h1:+gs4oBZ2gPfVrKPthwbMzWZDaAFPGYK72F0NJv2v7Vk=
76+
github.com/clipperhouse/uax29/v2 v2.7.0/go.mod h1:EFJ2TJMRUaplDxHKj1qAEhCtQPW2tJSwu5BF98AuoVM=
6977
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
7078
github.com/creack/pty v1.1.24 h1:bJrF4RRfyJnbTJqzRLHzcGaZK1NeM5kTC9jGgovnR1s=
7179
github.com/creack/pty v1.1.24/go.mod h1:08sCNb52WyoAwi2QDyzUCTgcvVFhUzewun7wtTfvcwE=
@@ -142,8 +150,8 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE
142150
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
143151
github.com/mattn/go-localereader v0.0.1 h1:ygSAOl7ZXTx4RdPYinUpg6W99U8jWvWi9Ye2JC/oIi4=
144152
github.com/mattn/go-localereader v0.0.1/go.mod h1:8fBrzywKY7BI3czFoHkuzRoWE9C+EiG4R1k4Cjx5p88=
145-
github.com/mattn/go-runewidth v0.0.19 h1:v++JhqYnZuu5jSKrk9RbgF5v4CGUjqRfBm05byFGLdw=
146-
github.com/mattn/go-runewidth v0.0.19/go.mod h1:XBkDxAl56ILZc9knddidhrOlY5R/pDhgLpndooCuJAs=
153+
github.com/mattn/go-runewidth v0.0.20 h1:WcT52H91ZUAwy8+HUkdM3THM6gXqXuLJi9O3rjcQQaQ=
154+
github.com/mattn/go-runewidth v0.0.20/go.mod h1:XBkDxAl56ILZc9knddidhrOlY5R/pDhgLpndooCuJAs=
147155
github.com/mattn/go-shellwords v1.0.12 h1:M2zGm7EW6UQJvDeQxo4T51eKPurbeFbe8WtebGE2xrk=
148156
github.com/mattn/go-shellwords v1.0.12/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y=
149157
github.com/mitchellh/hashstructure/v2 v2.0.2 h1:vGKWl0YJqUNxE8d+h8f6NJLcCJrgbhC4NcD46KavDd4=
@@ -247,8 +255,8 @@ golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
247255
golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
248256
golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
249257
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
250-
golang.org/x/sys v0.41.0 h1:Ivj+2Cp/ylzLiEU89QhWblYnOE9zerudt9Ftecq2C6k=
251-
golang.org/x/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
258+
golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo=
259+
golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
252260
golang.org/x/telemetry v0.0.0-20260209163413-e7419c687ee4 h1:bTLqdHv7xrGlFbvf5/TXNxy/iUwwdkjhqQTJDjW7aj0=
253261
golang.org/x/telemetry v0.0.0-20260209163413-e7419c687ee4/go.mod h1:g5NllXBEermZrmR51cJDQxmJUHUOfRAaNyWBM+R+548=
254262
golang.org/x/term v0.40.0 h1:36e4zGLqU4yhjlmxEaagx2KuYbJq3EwY8K943ZsHcvg=

pkg/console/banner.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"os"
99
"strings"
1010

11-
"github.com/charmbracelet/lipgloss"
11+
lipgloss "charm.land/lipgloss/v2"
1212
"github.com/github/gh-aw/pkg/styles"
1313
)
1414

pkg/console/console.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import (
99
"strconv"
1010
"strings"
1111

12-
"github.com/charmbracelet/lipgloss"
13-
"github.com/charmbracelet/lipgloss/table"
12+
lipgloss "charm.land/lipgloss/v2"
13+
"charm.land/lipgloss/v2/table"
1414
"github.com/github/gh-aw/pkg/logger"
1515
"github.com/github/gh-aw/pkg/styles"
1616
"github.com/github/gh-aw/pkg/tty"
@@ -203,11 +203,16 @@ func RenderTable(config TableConfig) string {
203203
PaddingRight(1)
204204
}
205205

206+
borderStyle := lipgloss.NewStyle()
207+
if isTTY() {
208+
borderStyle = styles.TableBorder
209+
}
210+
206211
t := table.New().
207212
Headers(config.Headers...).
208213
Rows(allRows...).
209214
Border(styles.RoundedBorder).
210-
BorderStyle(styles.TableBorder).
215+
BorderStyle(borderStyle).
211216
StyleFunc(styleFunc)
212217

213218
output.WriteString(t.String())

pkg/console/list.go

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import (
99
"os"
1010
"strings"
1111

12-
"github.com/charmbracelet/bubbles/list"
13-
tea "github.com/charmbracelet/bubbletea"
14-
"github.com/charmbracelet/lipgloss"
12+
"charm.land/bubbles/v2/list"
13+
tea "charm.land/bubbletea/v2"
14+
lipgloss "charm.land/lipgloss/v2"
1515
"github.com/github/gh-aw/pkg/logger"
1616
"github.com/github/gh-aw/pkg/styles"
1717
"github.com/github/gh-aw/pkg/tty"
@@ -34,7 +34,7 @@ func (m listModel) Init() tea.Cmd {
3434
// Update handles messages and updates the model
3535
func (m listModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
3636
switch msg := msg.(type) {
37-
case tea.KeyMsg:
37+
case tea.KeyPressMsg:
3838
switch msg.String() {
3939
case "ctrl+c", "q", "esc":
4040
m.quitting = true
@@ -56,11 +56,13 @@ func (m listModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
5656
}
5757

5858
// View renders the list
59-
func (m listModel) View() string {
59+
func (m listModel) View() tea.View {
6060
if m.quitting {
61-
return ""
61+
return tea.View{}
6262
}
63-
return m.list.View()
63+
v := tea.NewView(m.list.View())
64+
v.AltScreen = true
65+
return v
6466
}
6567

6668
// itemDelegate is a custom delegate for list items
@@ -163,15 +165,15 @@ func ShowInteractiveList(title string, items []ListItem) (string, error) {
163165
Bold(true).
164166
Padding(0, 0, 1, 0)
165167

166-
l.Styles.FilterPrompt = lipgloss.NewStyle().
168+
l.Styles.Filter.Focused.Prompt = lipgloss.NewStyle().
167169
Foreground(styles.ColorInfo)
168-
169-
l.Styles.FilterCursor = lipgloss.NewStyle().
170-
Foreground(styles.ColorSuccess)
170+
l.Styles.Filter.Blurred.Prompt = lipgloss.NewStyle().
171+
Foreground(styles.ColorComment)
172+
l.Styles.Filter.Cursor.Color = styles.ColorSuccess
171173

172174
// Create the model and run the program
173175
m := listModel{list: l}
174-
p := tea.NewProgram(m, tea.WithAltScreen())
176+
p := tea.NewProgram(m)
175177

176178
finalModel, err := p.Run()
177179
if err != nil {

pkg/console/progress.go

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ package console
55
import (
66
"fmt"
77

8-
"github.com/charmbracelet/bubbles/progress"
8+
"charm.land/bubbles/v2/progress"
9+
lipgloss "charm.land/lipgloss/v2"
910
"github.com/github/gh-aw/pkg/logger"
1011
)
1112

@@ -19,9 +20,9 @@ var progressLog = logger.New("console:progress")
1920
// - Indeterminate: When total size is unknown (shows activity indicator)
2021
//
2122
// Visual Features:
22-
// - Scaled gradient effect from purple (#BD93F9) to cyan (#8BE9FD)
23-
// - Smooth color transitions using bubbles v0.21.0+ gradient capabilities
24-
// - Gradient scales with filled portion for enhanced visual feedback
23+
// - Scaled color blend effect from purple (#BD93F9) to cyan (#8BE9FD)
24+
// - Smooth color transitions using bubbles v2 blend capabilities
25+
// - Blend scales with filled portion for enhanced visual feedback
2526
// - Works well in both light and dark terminal themes
2627
//
2728
// The gradient provides visual appeal without affecting functionality:
@@ -39,23 +40,24 @@ type ProgressBar struct {
3940
// The progress bar automatically adapts to TTY/non-TTY environments
4041
func NewProgressBar(total int64) *ProgressBar {
4142
progressLog.Printf("Creating determinate progress bar: total=%d bytes", total)
42-
// Use scaled gradient for improved visual effect
43-
// The gradient blends from purple to cyan, creating a smooth
44-
// color transition as progress advances. WithScaledGradient
45-
// ensures the gradient scales with the filled portion for better
43+
// Use scaled color blend for improved visual effect
44+
// The blend transitions from purple to cyan, creating a smooth
45+
// color transition as progress advances. WithScaled(true)
46+
// ensures the blend scales with the filled portion for better
4647
// visual feedback.
4748
//
4849
// Color choices:
4950
// - Start (0%): #BD93F9 (purple) - vibrant, attention-grabbing
5051
// - End (100%): #8BE9FD (cyan) - cool, completion feeling
5152
// These colors work well in both light and dark terminal themes
5253
prog := progress.New(
53-
progress.WithScaledGradient("#BD93F9", "#8BE9FD"),
54+
progress.WithColors(lipgloss.Color("#BD93F9"), lipgloss.Color("#8BE9FD")),
55+
progress.WithScaled(true),
5456
progress.WithWidth(40),
5557
)
5658

5759
// Use muted color for empty portion to maintain focus on progress
58-
prog.EmptyColor = "#6272A4" // Muted purple-gray
60+
prog.EmptyColor = lipgloss.Color("#6272A4") // Muted purple-gray
5961

6062
return &ProgressBar{
6163
progress: prog,

pkg/console/spinner.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ import (
4343
"os"
4444
"sync"
4545

46-
"github.com/charmbracelet/bubbles/spinner"
47-
tea "github.com/charmbracelet/bubbletea"
46+
"charm.land/bubbles/v2/spinner"
47+
tea "charm.land/bubbletea/v2"
4848
"github.com/github/gh-aw/pkg/logger"
4949
"github.com/github/gh-aw/pkg/styles"
5050
"github.com/github/gh-aw/pkg/tty"
@@ -63,16 +63,16 @@ type spinnerModel struct {
6363
output *os.File
6464
}
6565

66-
func (m spinnerModel) Init() tea.Cmd { return m.spinner.Tick }
67-
func (m spinnerModel) View() string { return "" } // Not used with WithoutRenderer
66+
func (m spinnerModel) Init() tea.Cmd { return m.spinner.Tick }
67+
func (m spinnerModel) View() tea.View { return tea.View{} } // Not used with WithoutRenderer
6868

6969
func (m spinnerModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
7070
switch msg := msg.(type) {
7171
case updateMessageMsg:
7272
m.message = string(msg)
7373
m.render()
7474
return m, nil
75-
case tea.KeyMsg:
75+
case tea.KeyPressMsg:
7676
if msg.String() == "ctrl+c" {
7777
return m, tea.Quit
7878
}

pkg/console/spinner_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,11 @@ func TestSpinnerBubbleTeaModel(t *testing.T) {
138138
t.Error("Update should return spinnerModel")
139139
}
140140

141-
// Note: View() returns empty string with WithoutRenderer() mode
141+
// Note: View() returns an empty View with WithoutRenderer() mode
142142
// because rendering is done manually in Update() via render()
143143
view := model.View()
144-
if view != "" {
145-
t.Errorf("View should return empty string with WithoutRenderer mode, got '%s'", view)
144+
if view.Content != "" {
145+
t.Errorf("View should return empty content with WithoutRenderer mode, got '%s'", view.Content)
146146
}
147147
}
148148

0 commit comments

Comments
 (0)