v2.2.12026-08-24
Tiny Monday bugfix
Textarea element had a bug, where you used to be able to go 1 word backwards, even if there was nothing, which resulted in the whole TUI freezing. It was now fixed by @OxQuasar!
Changelog
Fixed
* f6134114d735cf40e95c15ff62e7359e46d04fc9: fix(textarea): stop word-left at input boundary (#1036) (@OxQuasar)
Docs
* 87d445838781700cb25e3fc3a6b26006eab97b41: docs: update godoc link in readme to new package (@meowgorithm)
Other stuff
* 10489b5fafe92bfaea873297cab8ac8b5c5237f4: readme: drop tree section for now (@meowgorithm)
* 490948109eb4731927ba2f4cd464d8175a9630d7: v2.2.1 (@andrinoff)
---
<a href="https://charm.land/"><img alt="The Charm logo" src="https://stuff.charm.sh/charm-banner-next.jpg" width="400"></a>
Thoughts? Questions? We love hearing from you. Feel free to reach out on X, Discord, Slack, The Fediverse, Bluesky.
v2.2.02026-08-21
A new Bubble and some new Textarea stuff
There are a couple nice features in today's release. Let's check em out!
If a tree falls in the forest…
At last, the tree Bubble from all star contributor @dlvhdr’s is here! He built it for DiffNav and graciously contributed to Bubbles. We've been working with Dolev for a long time and were totally stoked when he offerd to contribute.
<p><img width="500" src="https://github.com/user-attachments/assets/10f36c36-4669-45ef-b957-f214ca27c34f" /></p>
Select all, ctrl+c, ctrl+v…done!
Our own @andrinoff added a bunch of awesome stuff to Textarea, including the long awaited text selection. Select, copy, and cut your way into mini text editing.
<p><img width="600" src="https://github.com/user-attachments/assets/49b241cb-468a-483a-8ace-5d0742869cd9" /></p>
For more info see the docs.
And special thanks to @zoriya for adding <kbd>ctrl+left/right</kbd> bindings.
xoxo,
Charm! 💌
Changelog
New!
* 8cea431500a8837c241cbe8ad71601aa8f00a0d9: feat(textarea): support ctrl + left/right/backspace (#1020) (@zoriya)
* 037ad37bb0aa6e8ec544df6d3af752755f0a72d9: feat: textarea selection (#1029) (@andrinoff)
* e97af08ee293131e7b71f7e3006c06a81a2584b8: feat: tree bubble (#893) (@dlvhdr)
Fixed
* 6484e49c0a051fe100cb16c0e184cabd4b53a6f0: fix(filepicker): don't blank the view when height is unset (#1026) (@andrinoff)
Other stuff
* 355f960a27f9b0bf455b3ddea66dc987db62317d: ci: sync dependabot config (#896) (@charmcli)
* ef8af03870c1817d3b0b4fa0578b661a576e0220: v2.2.0 (@andrinoff)
---
<a href="https://charm.land/"><img alt="The Charm logo" src="https://stuff.charm.sh/charm-banner-next.jpg" width="400"></a>
Thoughts? Questions? We love hearing from you. Feel free to reach out on X, Discord, Slack, The Fediverse, Bluesky.
v2.1.12026-07-04
Lil’ Textarea Fix
This is a tiny patch to fix a bug in textarea where the prompt character could be missing styling on empty lines. That’s all for now!
Thanks for using Bubbles,
Charm 🌞
Changelog
Fixed
* d2b2217d6352ce04183623d66d4266115419733c: fix(textarea): apply prompt style on all lines, including fillers (@meowgorithm)
Docs
* a13f110fba4f13ce5fe9bc7fd51619f5782077b9: docs: fix typo in README (#921) (@Rohan5commit)
---
<a href="https://charm.land/"><img alt="The Charm logo" src="https://stuff.charm.sh/charm-banner-next.jpg" width="400"></a>
Thoughts? Questions? We love hearing from you. Feel free to reach out on X, Discord, Slack, The Fediverse, Bluesky.
v2.1.02026-03-26
Shrink ’n’ grow your textareas
The update adds a new feature to automatically resize your textarea vertically as its content changes.
``go
ta := textarea.New()
ta.DynamicHeight = true // Enable dynamic resizing
ta.MinHeight = 3 // Minimum visible rows
ta.MaxHeight = 10 // Maximum visible rows
ta.MaxContentHeight = 20 // Maximum rows of content
``
Piece of cake, right?
<p><img width="500" src="https://github.com/user-attachments/assets/6f990de7-833d-4742-b3de-c87ffff8b77e" /></p>
Enjoy! 💘
Changelog
New!
* f1daacfa0cfee07e31a12498078426d275aa5286: feat(textarea): dynamic height (#910) (@meowgorithm)
---
<a href="https://charm.land/"><img alt="The Charm logo" src="https://stuff.charm.sh/charm-banner-next.jpg" width="400"></a>
Thoughts? Questions? We love hearing from you. Feel free to reach out on X, Discord, Slack, The Fediverse, Bluesky.
v2.0.02026-02-24
bubbles-v2-block
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:
``sh
go get charm.land/bubbletea/v2
go get charm.land/bubbles/v2
go get charm.land/lipgloss/v2
`
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!
> [!NOTE]
> When in doubt, check the examples for reference — they've all been updated for v2.
🏠 New Home
Bubbles v2 now lives at charm.land:
`go
import "charm.land/bubbles/v2"
`
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 removes AdaptiveColor, 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:
`go
func (m model) Init() tea.Cmd {
return tea.RequestBackgroundColor
}
func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
switch msg := msg.(type) {
case tea.BackgroundColorMsg:
m.help.Styles = help.DefaultStyles(msg.IsDark())
return m, nil
}
// ...
}
`
If you're using Wish you must do it this way to get the background color of the client.
🤠 The Quick Way
Use 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 won't detect the client's background:
`go
import "charm.land/lipgloss/v2/compat"
var hasDarkBG = compat.HasDarkBackground()
h := help.New()
h.Styles = help.DefaultStyles(hasDarkBG)
`
👀 Or Just Pick One
`go
h.Styles = help.DefaultLightStyles() // light mode!
h.Styles = help.DefaultDarkStyles() // jk dark mode
`
This pattern applies to help, list, textarea, and textinput.
🔑 The Init You Know and Love is Back
After experimenting with a few different forms of Init during the alphas, we decided the v1 signature was the right call after all. Init was a bit too redundant for our tastes given that initialization already happens in New:
`go
func (m Model) Init() tea.Cmd
`
✨ The Big Highlights
Getters and Setters Everywhere
All components now use getter/setter methods instead of exported Width and Height fields. This lets us do internal bookkeeping when things change, and it makes the API consistent across every Bubble:
`go
// Before
vp.Width = 40
fmt.Println(vp.Width)
// After
vp.SetWidth(40)
fmt.Println(vp.Width())
`
Affected: filepicker, help, progress, table, textinput, viewport.
Functional Options
Constructors now use the functional options pattern instead of positional args or separate constructor functions:
`go
vp := viewport.New(viewport.WithWidth(80), viewport.WithHeight(24))
sw := stopwatch.New(stopwatch.WithInterval(500 * time.Millisecond))
t := timer.New(30time.Second, timer.WithInterval(100time.Millisecond))
`
DefaultKeyMap is a Function Now
All DefaultKeyMap package-level variables are now functions, so you get fresh values every time:
`go
km := textinput.DefaultKeyMap() // was textinput.DefaultKeyMap
km := textarea.DefaultKeyMap() // was textarea.DefaultKeyMap
km := paginator.DefaultKeyMap() // was paginator.DefaultKeyMap
`
Real Cursor Support 🖱️
Both textarea and textinput now support real terminal cursors! The feature is opt-in, so by default your programs will continue to use the easy-breezy virtual cursor. Set VirtualCursor to false and use Model.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:
- NewModel variants — just use New
- spinner.Tick() — use Model.Tick() instead
- paginator.UsePgUpPgDownKeys and friends — customize KeyMap directly
- filepicker.DefaultStylesWithRenderer() — Lip Gloss is pure now, use DefaultStyles()
- viewport.HighPerformanceRendering — no longer needed
- runeutil and memoization packages moved to internal/ (they were never meant for public use anyway)
---
What's Changed: the Laundry List
🔮 Cursor
- Model.Blink renamed to Model.IsBlinked for clarity
- Model.BlinkCmd() renamed to Model.Blink()
- Each cursor now gets a unique ID
📂 Filepicker
- DefaultStylesWithRenderer() removed — Lip Gloss is pure now, so just use DefaultStyles()
- Model.Height broken into SetHeight(int) / Height() int
❓ Help
- Model.Width broken into SetWidth(int) / Width() int
- New DefaultStyles(isDark bool), DefaultDarkStyles(), and DefaultLightStyles()
- Defaults to dark background styles out of the box
🥕 List
- DefaultStyles() and NewDefaultItemStyles() now take an isDark bool parameter
- Styles.FilterPrompt and Styles.FilterCursor have been consolidated into Styles.Filter (a textinput.Styles)
- GlobalIndex helper added
📄 Paginator
- DefaultKeyMap variable → DefaultKeyMap() function
- Deprecated fields (UsePgUpPgDownKeys, UseLeftRightKeys, etc.) removed — customize KeyMap directly
🌈 Progress
This one got the biggest makeover!
- Complete color API overhaul:
- WithGradient / WithScaledGradient → WithColors(...color.Color) — pass 2+ colors for blending
- WithSolidFill(string) → WithColors(color) — pass a single color for a solid fill
- WithDefaultGradient() → WithDefaultBlend()
- New WithScaled(bool) to scale the blend to fit only the filled portion
- New WithColorFunc(func(total, current float64) color.Color) for fully dynamic coloring
- WithColorProfile removed — Bubble Tea handles this automatically now
- Model.FullColor and Model.EmptyColor changed from string to image/color.Color
- Model.Width broken into SetWidth(int) / Width() int
- Model.Update now returns Model instead of tea.Model
- Improved blend algorithm with support for multiple color stops — special thanks to the legendary @lrstanley!
🌀 Spinner
- Tick() package-level function removed — use Model.Tick() instead
⏱️ Stopwatch
- NewWithInterval(d) removed — use New(WithInterval(d)) instead
- Debounced tick messages
🔢 Table
- Model.Width / Model.Height replaced with getter/setter methods
- Uses ansi.Truncate instead of runewidth.Truncate
- Fixed a critical out-of-bounds cursor bug — thanks @s0ders!
✏️ 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.
- DefaultKeyMap variable → DefaultKeyMap() function
- New PageUp / PageDown key bindings
- Model.FocusedStyle / Model.BlurredStyle → Model.Styles.Focused / Model.Styles.Blurred
- Style type renamed to StyleState; new Styles struct groups Focused, Blurred, and Cursor
- Mod
v1.0.02026-02-10
This is just an honorary release of Bubbles v1. Stay tuned for the next major version 🫧
Changelog
Fixed
* d0166363eb8176b331de98dba1d6e997560f216f: fix: changed 'recieve' to 'receive' for 100% quality of Go Report Card (#881) (@Atennop1)
---
<a href="https://charm.land/"><img alt="The Charm logo" src="https://stuff.charm.sh/charm-banner-next.jpg" width="400"></a>
Thoughts? Questions? We love hearing from you. Feel free to reach out on X, Discord, Slack, The Fediverse, Bluesky.
v0.21.12026-02-03
Changelog
New!
* dff42ddb7cf28f022da475c69dba2e74f75af34d: feat: update keybindings in list setSize method (@Broderick-Westrope)
Fixed
* c376ce3ef18cc26bbf1f6338cc8518ae329a18d6: fix(cursor): fix data race on blinkTag (#784) (@DryHumour)
* 11d52ca426e5c594f7c6c10766935a7f30a83225: fix(table): preventing cursor from being out-of-bounds. (@s0ders)
* 49ff5c03b7bada572da36c79269dc15ab03d569b: fix(textinput): improve placeholder (#768) (@caarlos0)
* 7c44f63d3185e6f1d795e9369ba85185e6efe956: v1: fix(list): ensure correct cursor positions with page/cursor methods (#831) (@lrstanley)
Docs
* 7fcf75da535ee7db938586044a02f0f74f40339e: docs(readme): update footer image and copyright date (@meowgorithm)
* d4feefed7d674edbfbc8f09e99c56704706038c5: docs: remove Charm Cloud reference (#785) (@ShalokShalom)
Other stuff
* daab808a4d85e0b616ca9e30c1c5d9acd365aa02: ci: sync dependabot config (#786) (@charmcli)
* 4b2d311076480670a00b3f24fd9ad280c35c7c57: ci: sync dependabot config (#835) (@charmcli)
* 8562e9075fb87edf45e99c5d63a6610254d6c6e7: ci: sync golangci-lint config (#781) (@github-actions[bot])
* f54a125f7decd8fefa0db4a0853720200d50a631: test(table): improve table unit tests (#601) (@Broderick-Westrope)
---
<a href="https://charm.land/"><img alt="The Charm logo" src="https://stuff.charm.sh/charm-banner-next.jpg" width="400"></a>
Thoughts? Questions? We love hearing from you. Feel free to reach out on X, Discord, Slack, The Fediverse, Bluesky.
v2.0.0-rc.1预发布2025-11-17
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 🖥️
``
go get charm.land/bubbles/v2@v2.0.0-rc.1
`
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 , and MoveToEnd`, 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!
* faa17cbbd67720158c9f6ba22198c215e0f84f7f: feat(progress): support multiple stops and improved blend algorithm (#838) (@lrstanley)
* bc03e71e42a9134588e049717dbc6c0430b8cad5: feat(textarea): add PageUp & PageDown support (#844) (@lrstanley)
* c690ea5e0f95d44d66a6e968b5f748f6782078f3: feat(textarea): add ScrollYOffset and ScrollPosition methods (@lrstanley)
* a4c42b5791981e61432648c46ceb3224274c134f: feat(textarea): add focus status to setPromptFunc (#797) (@meowgorithm)
* 696244a1d00760bbf1df8606ab71905b366f03bb: feat(textarea): expose MoveToBegin and MoveToEnd methods (#809) (@aymanbagabas)
* 1e2ffbbcf5c57f4c6a7483465752435250229b69: feat(textarea): get the word under the cursor (#814) (@caarlos0)
* a0a432e11dc045b7b950234436d06510ebf02fcb: feat(viewport): horizontal scroll with mouse wheel (@UnseenBook)
* ea344ab907bddf5e8f71cd73b9583b070e8f1b2f: feat(viewport): horizontal scroll with mouse wheel (#761) (@UnseenBook)
* dff42ddb7cf28f022da475c69dba2e74f75af34d: feat: update keybindings in list setSize method (@Broderick-Westrope)
Fixed
* f2434c374bd0f55ac0d5b3e8261161b97ea41a30: Revert "fix(viewport): normalize method names" (@caarlos0)
* c376ce3ef18cc26bbf1f6338cc8518ae329a18d6: fix(cursor): fix data race on blinkTag (#784) (@DryHumour)
* ba5555aa93219c1788da27ffba5e15ba26161e65: fix(cursor): set ID on virutal cursors (@meowgorithm)
* c2223a7c4f54039e525f03b03e21638aa1f67f9a: fix(list): ensure correct cursor positions with page/cursor methods (#831) (#837) (@lrstanley)
* 11d52ca426e5c594f7c6c10766935a7f30a83225: fix(table): preventing cursor from being out-of-bounds. (@s0ders)
* b3f0c9e423182d999f2824f5ceb1b56c0ef08e1c: fix(textarea): cursorline now fills the line when a placeholder is present (@meowgorithm)
* 50038ebdab1c6d5b60a5708a358c662c44963366: fix(textarea): ensure cursor is always in view (#840) (@lrstanley)
* c4068c642c90bc56ea6cd89f72a04020aa1dd049: fix(textarea): ensure viewport content is set during update (@aymanbagabas)
* 8b55efb2944ed8eb81df685f8dcfabbbf8897698: fix(textarea): placeholder with chinese chars (#767) (@caarlos0)
* bb1d1d275df7efa3a2a017daa48cb21291fdd03d: fix(textarea): suppress blink messages when real cursor is active (@meowgorithm)
* 86f33262953915d4ca1a49e7fb74eb842990600a: fix(textarea): update tests to reflect changes in textarea content (@aymanbagabas)
* efdc0e8e45beac54dc3b92aea226d2cb995ac846: fix(textarea): use pointer receiver for Model methods (@aymanbagabas)
* 49ff5c03b7bada572da36c79269dc15ab03d569b: fix(textinput): improve placeholder (#768) (@caarlos0)
* c7f889e364e15dc5b08a8c799e80164031847ab9: fix(viewport): normalize method names (@caarlos0)
* 39668ec6291e1fc3e574f30c650e1ba0801e1f6d: fix(viewport): normalize method names (#763) (@caarlos0)
* bd2a5b0c6a7abc66b8a009d2aded233e6ba02fa4: fix: golangci-lint 2 fixes (#769) (@caarlos0)
* b1cef26c7deb337c8fe0cbbe87c8d958e99a09e4: fix: normalize yoffset (@caarlos0)
* 84fd71dae6004c2c35e26511f2f0ee2250396f2a: fix: use charm.land import path for bubbletea (@aymanbagabas)
* 7c44f63d3185e6f1d795e9369ba85185e6efe956: v1: fix(list): ensure correct cursor positions with page/cursor methods (#831) (@lrstanley)
Docs
* 7fcf75da535ee7db938586044a02f0f74f40339e: docs(readme): update footer image and copyright date (@meowgorithm)
* d4feefed7d674edbfbc8f09e99c56704706038c5: docs: remove Charm Cloud reference (#785) (@ShalokShalom)
Other stuff
* 6f4a536421f3a487454c7858371c4d1464ebd544: Update viewport/viewport.go (@caarlos0)
* daab808a4d85e0b616ca9e30c1c5d9acd365aa02: ci: sync dependabot config (#786) (@charmcli)
* 4b2d311076480670a00b3f24fd9ad280c35c7c57: ci: sync dependabot config (#835) (@charmcli)
* cce848148cbea9e1bc5ca7d2c3d1ef89702db0e4: ci: sync golangci-lint config (#770) (@github-actions[bot])
* 8562e9075fb87edf45e99c5d63a6610254d6c6e7: ci: sync golangci-lint config (#781) (@github-actions[bot])
* b531de8f1cfb3551998fbb0c30ec78b7f7d1b047: fix!(textarea): virtual cursor blink (@meowgorithm)
* 8e84f33a49359719b67acadf00b42d5d7ea8acf3: fix!(textinput): cursor fixes and improvements (@meowgorithm)
* d42b7c42d5c72d789705a1d1e454dc08edafc8a7: fix(textarea/tests): update tests per API changes (@meowgorithm)
* 56bbc4a1ba66e602372dd9aa2e9b7fde49d171c7: fix(textinput,textarea): don't draw real cusor when blurred (@meowgorithm)
* 538d39c727fbee8ac5afd4b8562a8b9cc8345a23: refactor(help): use setter/getter for help width (@aymanbagabas)
* 7445f9734839ddba68c601fd89a0b3318a63a2ca: refactor(viewport): softwrap; improve perf; various bug fixes (#823) (@lrstanley)
* da0b892d17590ff24982d006f7580aba51a34573: refactor: migrate imports to charm.land/lipgloss (@aymanbagabas)
* 07735d1672c7ed7d078a7527e7204868862b0907: refactor: update module path to charm.land (@aymanbagabas)
* e8fcfc5ff743b3d85a380b858f5a76751582fc42: refactor: use msg.Content for PasteMsg in textinput and textarea (@aymanbagabas)
* f54a125f7decd8fefa0db4a0853720200d50a631: test(table): improve table unit tests (#601) (@Broderick-Westrope)
---
<a href="https://charm.land/"><img alt="The Charm logo" src="https://stuff.charm.sh/charm-banner-next.jpg" width="400"></a>
Thoughts? Questions? We love hearing from you. Feel free to reach out on X, Discord, Slack, The Fediverse, Bluesky.
v0.21.02025-04-09
Viewport improvements
Finally, viewport finally has horizontal scrolling ✨![^v1]
To enable it, use SetHorizontalStep (default in v2 will be 6).
You can also scroll manually with ScrollLeft and ScrollRight, and use
SetXOffset to scroll to a specific position (or 0 to reset):
``go
vp := viewport.New()
vp.SetHorizontalStep(10) // how many columns to scroll on each key press
vp.ScrollRight(30) // pan 30 columns to the right!
vp.ScrollLeft(10) // pan 10 columns to the left!
vp.SetXOffset(0) // back to the left edge
`
To make the API more consistent, vertical scroll functions were also renamed,
and the old ones were deprecated (and will be removed in v2):
`go
// Scroll n lines up/down:
func (m Model) LineUp(int) // deprecated
func (m Model) ScrollUp(int) // new!
func (m Model) LineDown(int) // deprecated
func (m Model) ScrollDown(int) // new!
// Scroll half page up/down:
func (m Model) HalfViewUp() []string // deprecated
func (m Model) HalfPageUp() []string // new!
func (m Model) HalfViewDown() []string // deprecated
func (m Model) HalfPageDown() []string // new!
// Scroll a full page up/down:
func (m Model) ViewUp(int) []string // deprecated
func (m Model) PageUp(int) []string // new!
func (m Model) ViewDown(int) []string // deprecated
func (m Model) PageDown(int) []string // new!
`
> [!NOTE]
> In v2, these functions will not return lines []string anymore, as it is no
> longer needed due to HighPerformanceRendering being deprecated as well.
Other improvements
The list bubble got a couple of new functions: SetFilterText,
SetFilterState, and GlobalIndex - which you can use to get the index of the
item in the unfiltered, original item list.
On textinput, you can now get the matched suggestions and more with
MatchedSuggestions and CurrentSuggestionIndex`.
To put the cherry on top, this release also includes numerous bug fixes.
You can read about each of them in the linked commits/PRs below.
[^v1]: It is disabled by default in v1, but will be enabled in v2.
Changelog
New Features
* d019ed3cc97e07dfe5e7b30ec15159033fbe6826: feat(list): add SetFilterText and SetFilterState (#335) (@taigrr)
* 171a9d61a0ce4fff88db8e16d03c3bac3f35f264: feat(list): implement GlobalIndex helper (#574) (@nobe4)
* 4382fdf1c6cfe18d34615c1e8b94b068022a461a: feat(textinput): expose matched suggestions and index (@luevano)
* 2d53a618a93c9cf2d3dd066d1b913fc6f46084cc: feat(viewport): horizontal scroll (#240) (@tty2)
* ea344ab907bddf5e8f71cd73b9583b070e8f1b2f: feat(viewport): horizontal scroll with mouse wheel (#761) (@UnseenBook)
Bug fixes
* f2434c374bd0f55ac0d5b3e8261161b97ea41a30: Revert "fix(viewport): normalize method names" (@caarlos0)
* 8101a3462fd57e0fb9409da787e10aa50341f67a: fix(ci): add lint and lint-sync workflows and update golangci.yml (#651) (@aymanbagabas)
* 54f28b650198f96080f16c0cba1e480f4457ec0a: fix(filepicker): properly scrolling filepicker (#753) (@caarlos0)
* 81d444a207009d0621988c9e08e827aa803ee04e: fix(help): wrong full help sep rendering (@luevano)
* f439d83043fc1aa8a0903429d9901c302b28e654: fix(textarea): max height should not determine max lines (@meowgorithm)
* 8b55efb2944ed8eb81df685f8dcfabbbf8897698: fix(textarea): placeholder with chinese chars (#767) (@caarlos0)
* 8624776d4572078ae6ff098d454c719047f9eb83: fix(textinput): slicing outside cap (#532) (@MikaelFangel)
* c7f889e364e15dc5b08a8c799e80164031847ab9: fix(viewport): normalize method names (@caarlos0)
* 39668ec6291e1fc3e574f30c650e1ba0801e1f6d: fix(viewport): normalize method names (#763) (@caarlos0)
* 7ab08fb438e4fa1f7968a00a345399de30d1684c: fix(viewport): scroll to last line when borders (#706) (@caarlos0)
* 730f5a29e29b13ed9d4f9f67acb1722425708524: fix: debounce stopwatch and timer (@meowgorithm)
* bd2a5b0c6a7abc66b8a009d2aded233e6ba02fa4: fix: golangci-lint 2 fixes (#769) (@caarlos0)
* 9589cbc16c537db95188cf65d64bf1825dba3d10: fix: lint issues and disable predeclared linter (#614) (@aymanbagabas)
* 398e92c5ae72b738cd6336a48c85bc21039b8cf8: fix: remove default character limit (@meowgorithm)
* 1bdd4c6fb3653943cb6941304c2c74354c4af519: fix: stopwatch.Start() (#707) (@bevicted)
* 9a262e9b0fc34b27b4f7cf7e60e2c48a7c310696: fix: use atomic for ids (#634) (@caarlos0)
Dependency updates
* 1797ac268d77f1273ba1bc6bd833f3327ce92c0f: feat(deps): bump github.com/charmbracelet/bubbletea from 1.1.0 to 1.1.1 (#611) (@dependabot[bot])
* a9b780a96c9796826dcad68ea14f5050d613b1cf: feat(deps): bump github.com/charmbracelet/lipgloss from 0.13.0 to 0.13.1 (@dependabot[bot])
* db3514caa70d35517e566e6b15beaa2c8f3fdb8c: feat(deps): bump github.com/charmbracelet/lipgloss from 0.13.1 to 1.0.0 (#655) (@dependabot[bot])
* 43aa82c87e638221a3e00affd35f300cb2901eac: feat(deps): bump github.com/charmbracelet/x/ansi (#716) (@dependabot[bot])
* c1199d7be61f7c9224759e9de6d3fc241b91d10c: feat(deps): bump github.com/charmbracelet/x/ansi from 0.2.3 to 0.3.0 (#613) (@dependabot[bot])
* d3ac47df46a7801611741e2bde7ff3422e6a8d4c: feat(deps): bump github.com/charmbracelet/x/ansi from 0.3.0 to 0.3.1 (#615) (@dependabot[bot])
* ed14316c61e956ab460707a5db7775696fb477ef: feat(deps): bump github.com/charmbracelet/x/ansi from 0.3.1 to 0.3.2 (#618) (@dependabot[bot])
Documentation updates
* cf3f46ab316fc263a88a0dfd368011f8868101f5: docs(list): fix grammar in doc comment and README (#627) (@oahshtsua)
* 9e5365e0ec0c4005efc7a3cc47f67941840e4144: docs: add example for ValidateFunc (#705) (@bashbunni)
* 87a4e45a58fa5bdad06c03c831aff90b6fe8ab25: docs: additional bubbles (#583) (@caarlos0)
* e3ce11a65f9191b02d7606bd222e3b0705737167: docs: update charm & friends blurb (#703) (@bashbunni)
* 178590b4469b2386726cff8da7c479615a746a94: docs: update contributing guidelines (#640) (@bashbunni)
Other work
* 0f9e38c9a7217bcd3d04b87c725c20047bc6aa64: Don't render suggestions when textinput is not focused. (@elProxy)
* e5296a2b0fd6b4b7db8cb54cc15b99b681b7d949: ci: fix goreleaser config (#668) (@caarlos0)
* 76433f714329061315a81c98362468def335c1dd: ci: fix linting on windows (@andreynering)
* d91c9aa894a6d861f0c139839593b53cd2b2f729: ci: rm .golangci-soft.yml (@caarlos0)
* 2f4944346fafb64706fb83d9bfdefea8e22e430c: ci: sync dependabot config (#734) (@charmcli)
* 7a6b190840c8193adddce23afa79824aac6f3442: ci: sync dependabot config (#736) (@charmcli)
* d58217bded070d5dba742eccfa9dfe2523f71ee1: ci: sync golangci-lint config (#750) (@github-actions[bot])
* cce848148cbea9e1bc5ca7d2c3d1ef89702db0e4: ci: sync golangci-lint config (#770) (@github-actions[bot])
* 0305695768261fac9cf3d55a3ac0b79542552c64: ci: test on oldstable and stable go versions, automerge dependabot (#755) (@caarlos0)
---
<a href="https://charm.sh/"><img alt="The Charm logo" src="https://stuff.charm.sh/charm-badge.jpg" width="400"></a>
Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or on Discord.
v2.0.0-beta.1预发布2025-03-26
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.
``sh
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.1
`
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 in New. Note that this change is in alignment with current shape of Init in Bubble Tea.
`go
// Before in alpha.2
func (m Model) Init() (Model, tea.Cmd)
// After
func (m Model) Init() tea.Cmd
`
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 and Styles.FilterPrompt have been removed and consolidated into the new Styles.Filter
👟 Progress
- The Model.EmptyColor and Model.FullColor members have been changed from string to image/color.Color
- Model.Update now returns a Model instead of a tea.Model
- WithColorProfile has been removed (Bubble Tea now manages this automatically)
- WithSolidFill now takes an color.Color (from the image package) instead of a string
✏️ Textarea
The big change to textarea is that you now have the option to use a real cursor per Bubble Tea v2.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 see
the 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 to Model.SetCursorColumn
- CursorStyle has been added to define the cursor style
- Model.VirtualCursor (a bool) has been added to define whether the textarea should render a virtual cursor; set to false when using a real cursor
- Styles.Cursor has been added to define the cursor style
📜 Textinput
Most of the changes in textinput are to bring it to parity with textarea,
including support for a real cursor. For an example illustrating the use of
textinput with a real cursor see
the v2 textinput example.
Most styling has been moved into StyleState which contains styling for
focused and blurred states.
- Model.CompletionStyle has been moved to StylesState.Suggestion
- Model.PlaceholderStyle has been moved to StylesState.Placeholder
- Model.PromptStyle has been and moved to StyleState.Prompt
- Model.TextStyle has been moved to StyleState.Text
- CursorStyle has been added to define the cursor style
- Model.VirtualCursor was added; use it to disable the virtual cursor
- Model.Styles (and Styles) was added to house all styling.
- StyleState was added to manage styling for focused and blurred states
- Model.Cursor is now a func() *tea.Cursor for real cursor support (formerly, it was the virtual cursor model)
- DefaultStyles has been added
- DefaultDarkStyles has been added
- DefaultLightStyles 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.
`go
vp := viewport.New()
vp.SetContent("hello world")
// Show line numbers:
vp.LeftGutterFunc = func(info viewport.GutterContext) string {
if info.Soft {
return " │ "
}
if info.Index >= info.TotalLines {
return " ~ │ "
}
return fmt.Sprintf("%4d │ ", info.Index+1)
}
// Highlight things:
vp.SetHighlights(regexp.MustCompile("hello").FindAllStringIndex(vp.GetContent(), -1))
vp.HighlightNext() // highlight and navigate to next match
vp.HighlightPrevious() // highlight and navigate to previous match
vp.ClearHighlights() // clear all highlights
`
You may now also let viewport do the soft wrapping for you:
`go
vp := viewport.New()
vp.SoftWrap = true
vp.SetContent("hello world from a very long line")
`
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.
- Discord
- Matrix
- Email
---
Part of Charm.
<a href="https://charm.sh/"><img alt="The Charm logo" src="https://stuff.charm.sh/charm-badge.jpg" width="400"></a>
Charm热爱开源 • Charm loves open source • نحنُ نحب المصادر المفتوحة