Open
Conversation
Contributor
Author
|
dc95318 to
794dac8
Compare
e831e1e to
a859f42
Compare
a859f42 to
2c0f518
Compare
2c0f518 to
25bbaff
Compare
25bbaff to
0cec858
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.21.1-0.20250623103423-23b8fd6302d7→v2.1.0v1.3.10→v2.0.2v0.10.0→v2.0.0v0.8.0→v2.0.3v1.1.1-0.20250404203927-76690c660834→v2.0.2v2.7.1→v3.30.0Release Notes
charmbracelet/bubbles (github.com/charmbracelet/bubbles)
v2.1.0Compare Source
Shrink ’n’ grow your textareas
The update adds a new feature to automatically resize your
textareavertically as its content changes.Piece of cake, right?
Enjoy! 💘
Changelog
New!
f1daacf: feat(textarea): dynamic height (#910) (@meowgorithm)Thoughts? Questions? We love hearing from you. Feel free to reach out on X, Discord, Slack, The Fediverse, Bluesky.
v2.0.0Compare Source
Bubbles v2 is here! 🫧
We're thrilled to share Bubbles v2 with you! This release accompanies Bubble Tea v2 and Lip Gloss v2 and brings a ton of consistency, new features, and quality-of-life improvements across every component. Catch 'em all:
You can also check the Upgrade Guide for more info.
There are a lot of changes in here, but we've found upgrading pretty easy, especially with a linter. Read on for the full breakdown!
🏠 New Home
Bubbles v2 now lives at
charm.land:All sub-packages follow the same pattern:
charm.land/bubbles/v2/viewport,charm.land/bubbles/v2/list, etc.🎨 Light and Dark Styles
Some Bubbles, like
help, offer default styles for both light and dark backgrounds. Since Lip Gloss v2 removesAdaptiveColor, choosing light or dark is now a manual process. You've got a couple of options.🎩 The Best Way
Have Bubble Tea query the background color for you. This properly queries the correct inputs and outputs, and happens in lockstep with your application:
If you're using Wish you must do it this way to get the background color of the client.
🤠 The Quick Way
Use the
compatpackage 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 won't detect the client's background:👀 Or Just Pick One
This pattern applies to
help,list,textarea, andtextinput.🔑 The Init You Know and Love is Back
After experimenting with a few different forms of
Initduring the alphas, we decided the v1 signature was the right call after all.Initwas a bit too redundant for our tastes given that initialization already happens inNew:✨ The Big Highlights
Getters and Setters Everywhere
All components now use getter/setter methods instead of exported
WidthandHeightfields. This lets us do internal bookkeeping when things change, and it makes the API consistent across every Bubble:Affected:
filepicker,help,progress,table,textinput,viewport.Functional Options
Constructors now use the functional options pattern instead of positional args or separate constructor functions:
DefaultKeyMap is a Function Now
All
DefaultKeyMappackage-level variables are now functions, so you get fresh values every time:Real Cursor Support 🖱️
Both
textareaandtextinputnow support real terminal cursors! The feature is opt-in, so by default your programs will continue to use the easy-breezy virtual cursor. SetVirtualCursortofalseand useModel.Cursor()for the real deal. Check out the textarea and textinput examples to see it in action.Cleaned House 🧹
All previously deprecated symbols have been removed:
NewModelvariants — just useNewspinner.Tick()— useModel.Tick()insteadpaginator.UsePgUpPgDownKeysand friends — customizeKeyMapdirectlyfilepicker.DefaultStylesWithRenderer()— Lip Gloss is pure now, useDefaultStyles()viewport.HighPerformanceRendering— no longer neededruneutilandmemoizationpackages moved tointernal/(they were never meant for public use anyway)What's Changed: the Laundry List
🔮 Cursor
Model.Blinkrenamed toModel.IsBlinkedfor clarityModel.BlinkCmd()renamed toModel.Blink()📂 Filepicker
DefaultStylesWithRenderer()removed — Lip Gloss is pure now, so just useDefaultStyles()Model.Heightbroken intoSetHeight(int)/Height() int❓ Help
Model.Widthbroken intoSetWidth(int)/Width() intDefaultStyles(isDark bool),DefaultDarkStyles(), andDefaultLightStyles()🥕 List
DefaultStyles()andNewDefaultItemStyles()now take anisDark boolparameterStyles.FilterPromptandStyles.FilterCursorhave been consolidated intoStyles.Filter(atextinput.Styles)GlobalIndexhelper added📄 Paginator
DefaultKeyMapvariable →DefaultKeyMap()functionUsePgUpPgDownKeys,UseLeftRightKeys, etc.) removed — customizeKeyMapdirectly🌈 Progress
This one got the biggest makeover!
WithGradient/WithScaledGradient→WithColors(...color.Color)— pass 2+ colors for blendingWithSolidFill(string)→WithColors(color)— pass a single color for a solid fillWithDefaultGradient()→WithDefaultBlend()WithScaled(bool)to scale the blend to fit only the filled portionWithColorFunc(func(total, current float64) color.Color)for fully dynamic coloringWithColorProfileremoved — Bubble Tea handles this automatically nowModel.FullColorandModel.EmptyColorchanged fromstringtoimage/color.ColorModel.Widthbroken intoSetWidth(int)/Width() intModel.Updatenow returnsModelinstead oftea.Model🌀 Spinner
Tick()package-level function removed — useModel.Tick()instead⏱️ Stopwatch
NewWithInterval(d)removed — useNew(WithInterval(d))instead🔢 Table
Model.Width/Model.Heightreplaced with getter/setter methodsansi.Truncateinstead ofrunewidth.Truncate✏️ Textarea
The big change here is real cursor support — but that's opt-in, so by default your programs will keep using the virtual cursor.
DefaultKeyMapvariable →DefaultKeyMap()functionPageUp/PageDownkey bindingsModel.FocusedStyle/Model.BlurredStyle→Model.Styles.Focused/Model.Styles.BlurredStyletype renamed toStyleState; newStylesstruct groupsFocused,Blurred, andCursorModel.SetCursorrenamed toModel.SetCursorColumnModel.Cursoris nowfunc() *tea.Cursorfor real cursor supportModel.VirtualCursorbool added — set tofalsewhen using a real cursorDefaultStyles(isDark bool),DefaultDarkStyles(),DefaultLightStyles()Column(),ScrollYOffset(),ScrollPosition(),MoveToBeginning(),MoveToEnd()SetPromptFunc📜 Textinput
Most of the changes here bring
textinputto parity withtextarea, including real cursor support. Styling has been consolidated into aStylesstruct withFocusedandBlurredstates:DefaultKeyMapvariable →DefaultKeyMap()functionModel.Widthbroken intoSetWidth(int)/Width() intModel.PromptStyle→StyleState.PromptModel.TextStyle→StyleState.TextModel.PlaceholderStyle→StyleState.PlaceholderModel.CompletionStyle→StyleState.SuggestionModel.Cursoris nowfunc() *tea.Cursorfor real cursor supportModel.VirtualCursor()/SetVirtualCursor(bool)addedModel.Styles()/SetStyles(Styles)addedDefaultStyles(isDark bool),DefaultDarkStyles(),DefaultLightStyles()⏲️ Timer
NewWithInterval(timeout, interval)removed — useNew(timeout, WithInterval(interval))📦 Viewport
viewportgot a ton of love in v2. Let's dive in!Breaking changes:
New(width, height int)→New(...Option)withWithWidth/WithHeightModel.Width,Model.Height,Model.YOffsetreplaced with getter/setter methodsHighPerformanceRenderingremovedShiny new features:
You can now scroll horizontally with the left and right arrow keys, and set up a custom gutter column for things like line numbers:
Highlight parts of what's being viewed with regex:
Let viewport handle soft wrapping for you:
Or, if you need fine control, use
SetContentLineswith "virtual lines" containing\n— they're treated as soft wraps automatically.Also new:
GetContent()to retrieve contentFillHeightto pad the viewport with empty linesStyleLineFuncfor per-line stylingHighlightStyleandSelectedHighlightStylefor highlight appearanceChangelog
Fixed
ansi.Truncateinstead ofrunewidth.Truncate(#884) (@jedevc)Docs
Other stuff
💝 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-rc.1Compare Source
This is the first step towards the final v2.0.0 release. In this release, we've introduced a variety of changes to expose more functionality from Bubbles and have fixed numerous issues!
This release now uses the
charm.land/*domain for imports 🖥️Progress 🌈
Special thanks to the legendary @lrstanley for his outstanding work on improving the blend algorithm in the Progress Bubble.
Textarea ✍️
You can now use
PageUp,PageDown,ScrollYOffset,ScrollPosition,MoveToBeginning, andMoveToEnd, along with numerous bug fixes!Viewport 📜
The Viewport Bubble now supports horizontal mouse wheel scrolling, thanks to @UnseenBook.
Table 🔢
This release includes a critical out-of-bound fix by @s0ders.
Changelog
New!
faa17cb: feat(progress): support multiple stops and improved blend algorithm (#838) (@lrstanley)bc03e71: feat(textarea): add PageUp & PageDown support (#844) (@lrstanley)c690ea5: feat(textarea): add ScrollYOffset and ScrollPosition methods (@lrstanley)a4c42b5: feat(textarea): add focus status to setPromptFunc (#797) (@meowgorithm)696244a: feat(textarea): expose MoveToBegin and MoveToEnd methods (#809) (@aymanbagabas)1e2ffbb: feat(textarea): get the word under the cursor (#814) (@caarlos0)a0a432e: feat(viewport): horizontal scroll with mouse wheel (@UnseenBook)ea344ab: feat(viewport): horizontal scroll with mouse wheel (#761) (@UnseenBook)dff42dd: feat: update keybindings in list setSize method (@Broderick-Westrope)Fixed
f2434c3: Revert "fix(viewport): normalize method names" (@caarlos0)c376ce3: fix(cursor): fix data race on blinkTag (#784) (@DryHumour)ba5555a: fix(cursor): set ID on virutal cursors (@meowgorithm)c2223a7: fix(list): ensure correct cursor positions with page/cursor methods (#831) (#837) (@lrstanley)11d52ca: fix(table): preventing cursor from being out-of-bounds. (@s0ders)b3f0c9e: fix(textarea): cursorline now fills the line when a placeholder is present (@meowgorithm)50038eb: fix(textarea): ensure cursor is always in view (#840) (@lrstanley)c4068c6: fix(textarea): ensure viewport content is set during update (@aymanbagabas)8b55efb: fix(textarea): placeholder with chinese chars (#767) (@caarlos0)bb1d1d2: fix(textarea): suppress blink messages when real cursor is active (@meowgorithm)86f3326: fix(textarea): update tests to reflect changes in textarea content (@aymanbagabas)efdc0e8: fix(textarea): use pointer receiver for Model methods (@aymanbagabas)49ff5c0: fix(textinput): improve placeholder (#768) (@caarlos0)c7f889e: fix(viewport): normalize method names (@caarlos0)39668ec: fix(viewport): normalize method names (#763) (@caarlos0)bd2a5b0: fix: golangci-lint 2 fixes (#769) (@caarlos0)b1cef26: fix: normalize yoffset (@caarlos0)84fd71d: fix: use charm.land import path for bubbletea (@aymanbagabas)7c44f63: v1: fix(list): ensure correct cursor positions with page/cursor methods (#831) (@lrstanley)Docs
7fcf75d: docs(readme): update footer image and copyright date (@meowgorithm)d4feefe: docs: remove Charm Cloud reference (#785) (@ShalokShalom)Other stuff
6f4a536: Update viewport/viewport.go (@caarlos0)daab808: ci: sync dependabot config (#786) (@charmcli)4b2d311: ci: sync dependabot config (#835) (@charmcli)cce8481: ci: sync golangci-lint config (#770) (@github-actions[bot])8562e90: ci: sync golangci-lint config (#781) (@github-actions[bot])b531de8: fix!(textarea): virtual cursor blink (@meowgorithm)8e84f33: fix!(textinput): cursor fixes and improvements (@meowgorithm)d42b7c4: fix(textarea/tests): update tests per API changes (@meowgorithm)56bbc4a: fix(textinput,textarea): don't draw real cusor when blurred (@meowgorithm)538d39c: refactor(help): use setter/getter for help width (@aymanbagabas)7445f97: refactor(viewport): softwrap; improve perf; various bug fixes (#823) (@lrstanley)da0b892: refactor: migrate imports to charm.land/lipgloss (@aymanbagabas)07735d1: refactor: update module path to charm.land (@aymanbagabas)e8fcfc5: refactor: use msg.Content for PasteMsg in textinput and textarea (@aymanbagabas)f54a125: test(table): improve table unit tests (#601) (@Broderick-Westrope)Thoughts? Questions? We love hearing from you. Feel free to reach out on X, Discord, Slack, The Fediverse, Bluesky.
v2.0.0-beta.1Compare Source
Ready for Bubbles v2 Beta?
We're excited to share Bubbles
v2.0.0-beta.1with 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.1versions of Bubble Tea and Lip Gloss.# Collect them all go get github.com/charmbracelet/bubbletea@v2.0.0-beta.1 go get github.com/charmbracelet/bubbles@v2.0.0-beta.1 go get github.com/charmbracelet/lipgloss@v2.0.0-beta.1Let’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.Initis a bit too redundant for our tastes given that initialization is already happening inNew. Note that this change is in alignment with current shape ofInitin 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.FilterCursorandStyles.FilterPrompthave been removed and consolidated into the newStyles.Filter👟 Progress
Model.EmptyColorandModel.FullColormembers have been changed fromstringtoimage/color.ColorModel.Updatenow returns aModelinstead of atea.ModelWithColorProfilehas been removed (Bubble Tea now manages this automatically)WithSolidFillnow takes ancolor.Color(from theimagepackage) instead of astring✏️ Textarea
The big change to
textareais 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
textareaseethe v2 textarea example.
Model.Cursoris now a function that returns a*tea.Cursor(formerly, it was the virtual cursor model)Model.SetCursorhas been renamed toModel.SetCursorColumnCursorStylehas been added to define the cursor styleModel.VirtualCursor(abool) has been added to define whether the textarea should render a virtual cursor; set tofalsewhen using a real cursorStyles.Cursorhas been added to define the cursor style📜 Textinput
Most of the changes in
textinputare to bring it to parity withtextarea,including support for a real cursor. For an example illustrating the use of
textinputwith a real cursor seethe v2 textinput example.
Most styling has been moved into
StyleStatewhich contains styling forfocused and blurred states.
Model.CompletionStylehas been moved toStylesState.SuggestionModel.PlaceholderStylehas been moved toStylesState.PlaceholderModel.PromptStylehas been and moved toStyleState.PromptModel.TextStylehas been moved toStyleState.TextCursorStylehas been added to define the cursor styleModel.VirtualCursorwas added; use it to disable the virtual cursorModel.Styles(andStyles) was added to house all styling.StyleStatewas added to manage styling for focused and blurred statesModel.Cursoris now afunc() *tea.Cursorfor real cursor support (formerly, it was the virtual cursor model)DefaultStyleshas been addedDefaultDarkStyleshas been addedDefaultLightStyleshas been added📦 Viewport
The new
viewportnow 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
SetContentLinesmethod. This method allows you to set "virtual lines", which may contain\nin 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.2Compare 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
compatpackage 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
compatpackage 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.Heighthas been broken into a getter and setter; useModel.SetHeight(int)andModel.Height() intinsteadHelp
helpnow 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
DefaultKeyMapis now a function:func DefaultKeyMap() KeyMapProgress
Model.Widthhas been broken into a getter and setter; useModel.SetWidth(int)andModel.Width() intinsteadStopwatch
NewWithInterval(time.Duration)has been removed. Pass anOptiontoNew()instead:New(WithInterval(time.Duration))Table
Model.Widthhas been broken into a getter and setter; useModel.SetWidth(int)andModel.Width() intinsteadModel.Heighthas been broken into a getter and setter; useModel.SetHeight(int)andModel.Height() intinsteadTextarea
DefaultKeyMapis now a function:func DefaultKeyMap() KeyMapModel.FocusedStyleandModel.BlurredStylehave been replaced byModel.Styles.FocusedandModel.Styles.BlurredDefaultStyles() (blurred, focused Style)is nowDefaultStyles(isDark bool) Styles. Seehelpabove for an example on how to work with this.Textinput
DefaultKeyMapis now a function:func DefaultKeyMap() KeyMapModel.Widthhas been broken into a getter and setter; useModel.SetWidth(int)andModel.Width() intinsteadTimer
NewWithInterval(time.Duration)has been removed. Pass anOptiontoNew()instead:New(time.Duration, WithInterval(time.Duration))Viewport
Model.WidthandModel.Heighthave 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 • نحنُ نحب المصادر المفتوحة
v2.0.0-alpha.1Compare Source
Changelog
New Features
d019ed3: feat(list): add SetFilterText and SetFilterState (#335) (@taigrr)0fdf5f5: feat: use bubbletea/v2 (@aymanbagabas)Bug fixes
9589cbc: fix: lint issues and disable predeclared linter (#614) (@aymanbagabas)f81fd52: fix: spacebar keybinding is now "space" instead of a literal space (@aymanbagabas)Dependency updates
1797ac2: feat(deps): bump github.com/charmbracelet/bubbletea from 1.1.0 to 1.1.1 (#611) (@dependabot[bot])c1199d7: feat(deps): bump github.com/charmbracelet/x/ansi from 0.2.3 to 0.3.0 (#613) (@dependabot[bot])d3ac47d: feat(deps): bump github.com/charmbracelet/x/ansi from 0.3.0 to 0.3.1 (#615) (@dependabot[bot])ed14316: feat(deps): bump github.com/charmbracelet/x/ansi from 0.3.1 to 0.3.2 (#618) (@dependabot[bot])Other work
8972b56: feat!: make Init return the model (@aymanbagabas)a93bfef: feat!: use bubbletea@v2-exp (@aymanbagabas)a2602f8: feat!: v2: move to v2 module (@aymanbagabas)Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or on Discord.
v1.0.0Compare Source
This is just an honorary release of Bubbles v1. Stay tuned for the next major version 🫧
Changelog
Fixed
d016636: fix: changed 'recieve' to 'receive' for 100% quality of Go Report Card (#881) (@Atennop1)Thoughts? Questions? We love hearing from you. Feel free to reach out on X, Discord, Slack, The Fediverse, Bluesky.
charmbracelet/bubbletea (github.com/charmbracelet/bubbletea)
v2.0.2Compare Source
This release contains a small patch fixing a rendering that might affect Wish users running on Unix platforms.
Changelog
Fixed
f25595a: fix(renderer): use mapNl optimization when not on Windows and no PTY input (#1615) (@aymanbagabas)Thoughts? Questions? We love hearing from you. Feel free to reach out on X, Discord, Slack, The Fediverse, Bluesky.
v2.0.1Compare Source
A small patch release to fix opening the proper default stdin file for input.
Changelog
Fixed
110a919: fix(examples): add mConfiguration
📅 Schedule: Branch creation - "before 6am on Monday" in timezone Europe/Amsterdam, Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.
This PR was generated by Mend Renovate. View the repository job log.