fix(deps): update module github.com/charmbracelet/bubbles to v2 #279
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
v0.20.1-0.20250320170029-54f28b650198
->v2.0.0-beta.1
Release Notes
charmbracelet/bubbles (github.com/charmbracelet/bubbles)
v2.0.0-beta.1
Compare Source
Ready for Bubbles v2 Beta?
We're excited to share Bubbles
v2.0.0-beta.1
with you! This release builds on the last alpha release and includes a few more API changes and improvements. As usual, the upgrade path is pretty straightforward, but let us know if you have any questions.Bear in mind you’ll want to use this updates alongside
v2.0.0-beta.1
versions of Bubble Tea and Lip Gloss.Let’s dive in!
The Init you know and love is back
After spending time with many different forms of
Init
, we've decided the v1 signature is the right way to go after all.Init
is a bit too redundant for our tastes given that initialization is already happening inNew
. Note that this change is in alignment with current shape ofInit
in Bubble Tea.What’s Changed?
In general, we've made a lot of small changes to Bubbles for consistency and future proofing. There are a lot of changes here, but we've found upgrading pretty easy regardless. If you're having trouble with anything let us know in the discussions.
🥕 List
Styles.FilterCursor
andStyles.FilterPrompt
have been removed and consolidated into the newStyles.Filter
👟 Progress
Model.EmptyColor
andModel.FullColor
members have been changed fromstring
toimage/color.Color
Model.Update
now returns aModel
instead of atea.Model
WithColorProfile
has been removed (Bubble Tea now manages this automatically)WithSolidFill
now takes ancolor.Color
(from theimage
package) instead of astring
✏️ Textarea
The big change to
textarea
is that you now have the option to use a real cursor per Bubble Teav2.0.0-beta1
. The feature is opt-in, so by default if you don't do anything your programs will continue to use the easy-breezy virtual cursor.To get an idea of how to use a real cursor with
textarea
seethe v2 textarea example.
Model.Cursor
is now a function that returns a*tea.Cursor
(formerly, it was the virtual cursor model)Model.SetCursor
has been renamed toModel.SetCursorColumn
CursorStyle
has been added to define the cursor styleModel.VirtualCursor
(abool
) has been added to define whether the textarea should render a virtual cursor; set tofalse
when using a real cursorStyles.Cursor
has been added to define the cursor style📜 Textinput
Most of the changes in
textinput
are to bring it to parity withtextarea
,including support for a real cursor. For an example illustrating the use of
textinput
with a real cursor seethe v2 textinput example.
Most styling has been moved into
StyleState
which contains styling forfocused and blurred states.
Model.CompletionStyle
has been moved toStylesState.Suggestion
Model.PlaceholderStyle
has been moved toStylesState.Placeholder
Model.PromptStyle
has been and moved toStyleState.Prompt
Model.TextStyle
has been moved toStyleState.Text
CursorStyle
has been added to define the cursor styleModel.VirtualCursor
was added; use it to disable the virtual cursorModel.Styles
(andStyles
) was added to house all styling.StyleState
was added to manage styling for focused and blurred statesModel.Cursor
is now afunc() *tea.Cursor
for real cursor support (formerly, it was the virtual cursor model)DefaultStyles
has been addedDefaultDarkStyles
has been addedDefaultLightStyles
has been added📦 Viewport
The new
viewport
now supports horizontal scrolling as well as setting a custom gutter column! You can also now scroll horizontally with the left and right arrow keys. Finally, you can now highlight parts of what's being viewed based on regex.You may now also let viewport do the soft wrapping for you:
But, if you need more fine control on soft wrapping, you can also use the
SetContentLines
method. This method allows you to set "virtual lines", which may contain\n
in them. These lines are automatically treated as soft wraps, and scrolling also takes then into consideration.Like details?
Here’s the full changelog since v2.0.0-alpha.2
💝 That’s a wrap!
Feel free to reach out, ask questions, give feedback, and let us know how it's going. We’d love to know what you think.
Part of Charm.
Charm热爱开源 • Charm loves open source • نحنُ نحب المصادر المفتوحة
v2.0.0-alpha.2
Compare Source
Smells like Bubbles v2 Alpha 2!
Thanks for trying out Bubbles
v2.0.0-alpha.2
! This release was designed to work with Bubble Tea and Lip Gloss v2 alphas with the same tag, so make sure you catch ’em all:There are a lot of small API changes in this release, around two general ideas:
We've found upgrading pretty easy, especially with a linter, but let us know how it goes for you. Read on for the breakdown.
A Note on Light and Dark Styles
Some Bubbles, like
help
, offer defaults for light and dark background colors. Selecting one or the other now a manual process, and you have two options.🎩 The Best Way
Ideally, you have Bubble Tea query the background color for you. This means that you'll be properly querying the correct input and outputs with your program, and the query will happen in lockstep with the application.
If you're using Wish you must do it this way in to get the background color of the client.
🤠 The Quick Way
The quick way is to use detect the background color via the
compat
package in Lip Gloss. It's less recommended because it contains blocking I/O that operates independently of Bubble Tea and, when used with Wish it will not return the background color of the client (because it's running locally on the server).For details on the
compat
package see the Lip Gloss v2.0.0-alpha.2 release notes.👀 Also Note
You can also just apply defaults manually.
What’s Changed: the Laundry List
Filepicker
DefaultStylesWithRenderer()
. Lip Gloss is pure now, so just useDefaultStyles()
.Model.Height
has been broken into a getter and setter; useModel.SetHeight(int)
andModel.Height() int
insteadHelp
help
now defaults to using colors for dark backgrounds. You can manually change them withDefaultLightStyles()
andDefaultDarkStyles()
:Or, just detect the background color and apply the appropriate set of styles accordingly:
List
DefaultStyles()
now takes a boolean to determine whether it should be rendered with light or dark styles:DefaultStyles(isDark bool)
DefaultItemStyles()
now takes a boolean to determine whether it should be rendered with light or dark styles:DefaultItemStyles(isDark bool)
Paginator
DefaultKeyMap
is now a function:func DefaultKeyMap() KeyMap
Progress
Model.Width
has been broken into a getter and setter; useModel.SetWidth(int)
andModel.Width() int
insteadStopwatch
NewWithInterval(time.Duration)
has been removed. Pass anOption
toNew()
instead:New(WithInterval(time.Duration))
Table
Model.Width
has been broken into a getter and setter; useModel.SetWidth(int)
andModel.Width() int
insteadModel.Height
has been broken into a getter and setter; useModel.SetHeight(int)
andModel.Height() int
insteadTextarea
DefaultKeyMap
is now a function:func DefaultKeyMap() KeyMap
Model.FocusedStyle
andModel.BlurredStyle
have been replaced byModel.Styles.Focused
andModel.Styles.Blurred
DefaultStyles() (blurred, focused Style)
is nowDefaultStyles(isDark bool) Styles
. Seehelp
above for an example on how to work with this.Textinput
DefaultKeyMap
is now a function:func DefaultKeyMap() KeyMap
Model.Width
has been broken into a getter and setter; useModel.SetWidth(int)
andModel.Width() int
insteadTimer
NewWithInterval(time.Duration)
has been removed. Pass anOption
toNew()
instead:New(time.Duration, WithInterval(time.Duration))
Viewport
Model.Width
andModel.Height
have been replaced with getters and setters:New()
doesn’t have deafult args anymore:New(width, height int)
is nowNew(...Option)
. To set an initial width and height do one of the following:Changelog
New Contributors
Full Changelog: charmbracelet/bubbles@v2.0.0-alpha.1...v2.0.0-alpha.2
💝 That’s a wrap!
Feel free to reach out, ask questions, give feedback, and let us know how it's going. We’d love to know what you think.
Part of Charm.
Charm热爱开源 • Charm loves open source • نحنُ نحب المصادر المفتوحة
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.