fix(deps): update module github.com/charmbracelet/bubbles to v2 #7

Open
renovate-bot wants to merge 1 commit from renovate/github.com-charmbracelet-bubbles-2.x into main
Collaborator

This PR contains the following updates:

Package Change Age Confidence
github.com/charmbracelet/bubbles v0.21.1 → v2.2.2 age confidence

⚠️ Warning

Some dependencies could not be looked up. Check the Dependency Dashboard for more information.


Release Notes

charmbracelet/bubbles (github.com/charmbracelet/bubbles)

v2.2.2

Compare Source

A big squash 🫧

A patch release with a whole lot of patches! Over 40 fixes across nearly every component, most of them from the community. Text inputs handle wide characters better, viewports respect their borders, and timers keep honest time.

Text Input

  • The cursor stays in the right place with wide characters and when the value is scrolled.
  • Shows the full placeholder when no width is set.
  • Suggestions refresh when you set the value, and completions stay within the input's width.
  • No more out-of-range suggestion index.
  • Deleting the next word stops at the end of that word.
  • The virtual cursor now uses your TextStyle.
  • Shift+Backspace deletes, too, for terminals using the kitty keyboard protocol.
  • Clipboard errors wrap the original error, so errors.Is works.

Text Area

  • Moves and deletes by whole characters, so emoji and other combined characters stay intact.
  • CharLimit counts characters, not screen width, so a CJK character no longer counts double.
  • A word that exactly fills a line stays on it.
  • The cursor can reach wrapped lines at the end of the text.
  • The view follows the cursor after SetValue.
  • Autoresize keeps the first wrapped line visible.
  • The first inserted line is counted once when measuring height.
  • Always keeps at least one column for text, even when MaxWidth is tiny.
  • The placeholder no longer renders twice.
  • Shift+Backspace and clipboard error fixes, same as Text Input.

Viewport

  • Pages by the height you can actually see when the style has a border or padding.
  • ScrollPercent accounts for borders and padding.
  • Highlights line up on content that's already styled.

Table

  • SetCursor scrolls to keep the selected row visible.
  • The view stays put when you step past the last row.
  • SetRows with no rows resets the cursor to the top.
  • Extra cells in a row are ignored instead of breaking the layout.

List

  • q and esc are back as the default quit keys.
  • Titles without a status message are no longer cut off.
  • Fuzzy matches highlight the right characters with non-English text.
  • Removing an item while filtering keeps the filtered list in sync.

Timer ⏱️

  • Calling Start more than once no longer makes the timer count down faster.
  • Leftover ticks from an earlier start are now really ignored.

Stopwatch

  • Elapsed time follows the actual clock, so slow updates can't make it fall behind.
  • New() defaults to a one-second interval, just like the docs always said.

Progress

  • Percentages out of range are clamped before animating and rendering.
  • Fixed a race in the animation.

File Picker

  • The selection stays valid while entries load.
  • No more stray extra newline.

Help

  • Short help stays within its width.
  • Full help columns are styled properly, padding included.

Tree

  • SetValue updates what's rendered.
  • SetNodes accepts a nil root.

Paginator

  • An invalid page size leaves pagination as it was instead of breaking it.

Big thanks to everyone who contributed, and an extra big welcome to the huge crowd of first-time contributors! This release is mostly yours 🫶

Read the details below 👇🏻

Have a less buggy weekend,
Charm XX 🌊

Changelog

Fixed
Other stuff

The Charm logo

Thoughts? Questions? We love hearing from you. Feel free to reach out on X, Discord, Slack, The Fediverse, Bluesky.

v2.2.1

Compare Source

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
Docs
Other stuff

The Charm logo

Thoughts? Questions? We love hearing from you. Feel free to reach out on X, Discord, Slack, The Fediverse, Bluesky.

v2.2.0

Compare Source

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.

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.

For more info see the docs.

And special thanks to @​zoriya for adding ctrl+left/right bindings.

xoxo,
Charm! 💌

Changelog

New!
Fixed
Other stuff

The Charm logo

Thoughts? Questions? We love hearing from you. Feel free to reach out on X, Discord, Slack, The Fediverse, Bluesky.

v2.1.1

Compare Source

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
Docs

The Charm logo

Thoughts? Questions? We love hearing from you. Feel free to reach out on X, Discord, Slack, The Fediverse, Bluesky.

v2.1.0

Compare Source

Shrink ’n’ grow your textareas

The update adds a new feature to automatically resize your textarea vertically as its content changes.

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?

Enjoy! 💘

Changelog

New!

The Charm logo

Thoughts? Questions? We love hearing from you. Feel free to reach out on X, Discord, Slack, The Fediverse, Bluesky.

v2.0.0

Compare Source

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:

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:

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:

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:

import "charm.land/lipgloss/v2/compat"

var hasDarkBG = compat.HasDarkBackground()

h := help.New()
h.Styles = help.DefaultStyles(hasDarkBG)
👀 Or Just Pick One
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:

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:

// 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:

vp := viewport.New(viewport.WithWidth(80), viewport.WithHeight(24))
sw := stopwatch.New(stopwatch.WithInterval(500 * time.Millisecond))
t := timer.New(30*time.Second, timer.WithInterval(100*time.Millisecond))
DefaultKeyMap is a Function Now

All DefaultKeyMap package-level variables are now functions, so you get fresh values every time:

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
  • Model.SetCursor renamed to Model.SetCursorColumn
  • Model.Cursor is now func() *tea.Cursor for real cursor support
  • Model.VirtualCursor bool added — set to false when using a real cursor
  • New DefaultStyles(isDark bool), DefaultDarkStyles(), DefaultLightStyles()
  • New methods: Column(), ScrollYOffset(), ScrollPosition(), MoveToBeginning(), MoveToEnd()
  • Focus status now passed to SetPromptFunc
📜 Textinput

Most of the changes here bring textinput to parity with textarea, including real cursor support. Styling has been consolidated into a Styles struct with Focused and Blurred states:

  • DefaultKeyMap variable → DefaultKeyMap() function
  • Model.Width broken into SetWidth(int) / Width() int
  • Model.PromptStyle → StyleState.Prompt
  • Model.TextStyle → StyleState.Text
  • Model.PlaceholderStyle → StyleState.Placeholder
  • Model.CompletionStyle → StyleState.Suggestion
  • Model.Cursor is now func() *tea.Cursor for real cursor support
  • Model.VirtualCursor() / SetVirtualCursor(bool) added
  • Model.Styles() / SetStyles(Styles) added
  • New DefaultStyles(isDark bool), DefaultDarkStyles(), DefaultLightStyles()
  • Exposed matched suggestions and suggestion index
⏲️ Timer
  • NewWithInterval(timeout, interval) removed — use New(timeout, WithInterval(interval))
  • Debounced tick messages
📦 Viewport

viewport got a ton of love in v2. Let's dive in!

Breaking changes:

  • New(width, height int) → New(...Option) with WithWidth / WithHeight
  • Model.Width, Model.Height, Model.YOffset replaced with getter/setter methods
  • HighPerformanceRendering removed

Shiny 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:

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 parts of what's being viewed with regex:

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

Let viewport handle soft wrapping for you:

vp.SoftWrap = true
vp.SetContent("hello world from a very long line")

Or, if you need fine control, use SetContentLines with "virtual lines" containing \n — they're treated as soft wraps automatically.

Also new:

  • Horizontal mouse wheel scrolling (thanks @​UnseenBook!)
  • GetContent() to retrieve content
  • FillHeight to pad the viewport with empty lines
  • StyleLineFunc for per-line styling
  • HighlightStyle and SelectedHighlightStyle for highlight appearance

Changelog

Fixed
  • f744b929dddecc7863cf78605c5bfc396d90abc3: fix(ci): use local golangci-lint config (@​aymanbagabas)
  • 251e612949595b006e0e4739029d45e32c6b34b6: fix(filepicker): fix a panic due to an unchecked assertion (#​891) (@​meowgorithm)
  • f3f0ca0fe2f05b56e5a0c69b226b4d752c5e8f4a: fix(lint): exclude var-naming rule for revive (@​aymanbagabas)
  • d004225e8c3b8c8ddb14a76a5101728d666396f3: fix(table): use ansi.Truncate instead of runewidth.Truncate (#​884) (@​jedevc)
  • 93a004ab70c8ea979940b2720b3993c8f68bf8dc: fix(viewport): optimize subline splitting by skipping lines without line endings (@​aymanbagabas)
  • d0166363eb8176b331de98dba1d6e997560f216f: fix: changed 'recieve' to 'receive' for 100% quality of Go Report Card (#​881) (@​Atennop1)
  • af98365cc63af118d838e05522f8dddf16ad827e: fix: lint issues (@​aymanbagabas)
Docs
  • c81d525337e1a059c4343cf65a02eea020470a48: docs(readme): update for v2 (#​888) (@​aymanbagabas)
  • 6a799f4d58cc0eaeab0874f4ce9c98b5a922bd01: docs(readme): update header image, minor corrections (@​meowgorithm)
  • 24081b3590e746db4efa2ec09e31a85e2c078427: docs: add v2 upgrade and changes guide (#​885) (@​aymanbagabas)
  • 3a5ea3e2eb42aa064bb4a0ffe3262cb2b8a1f19b: docs: update mascot image (@​aymanbagabas)
Other stuff
  • ae99f46cec66f45862c2d953bb1af31efdc4f073: feat(v2/textarea): expose Column(), clarify 0-indexing (#​875) (@​caarlos0)

💝 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.

The Charm logo

Charm热爱开源 • Charm loves open source • نحنُ نحب المصادر المفتوحة

v1.0.0

Compare Source

This is just an honorary release of Bubbles v1. Stay tuned for the next major version 🫧

Changelog

Fixed

The Charm logo

Thoughts? Questions? We love hearing from you. Feel free to reach out on X, Discord, Slack, The Fediverse, Bluesky.


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Enabled.

♻ 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.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate CLI.

This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [github.com/charmbracelet/bubbles](https://github.com/charmbracelet/bubbles) | `v0.21.1` → `v2.2.2` | ![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fcharmbracelet%2fbubbles/v2.2.2?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fcharmbracelet%2fbubbles/v0.21.1/v2.2.2?slim=true) | --- > ⚠️ **Warning** > > Some dependencies could not be looked up. Check the [Dependency Dashboard](issues/3) for more information. --- ### Release Notes <details> <summary>charmbracelet/bubbles (github.com/charmbracelet/bubbles)</summary> ### [`v2.2.2`](https://github.com/charmbracelet/bubbles/releases/tag/v2.2.2) [Compare Source](https://github.com/charmbracelet/bubbles/compare/v2.2.1...v2.2.2) ### A big squash 🫧 A patch release with a whole lot of patches! Over 40 fixes across nearly every component, most of them from the community. Text inputs handle wide characters better, viewports respect their borders, and timers keep honest time. #### Text Input - The cursor stays in the right place with wide characters and when the value is scrolled. - Shows the full placeholder when no width is set. - Suggestions refresh when you set the value, and completions stay within the input's width. - No more out-of-range suggestion index. - Deleting the next word stops at the end of that word. - The virtual cursor now uses your `TextStyle`. - Shift+Backspace deletes, too, for terminals using the kitty keyboard protocol. - Clipboard errors wrap the original error, so `errors.Is` works. #### Text Area - Moves and deletes by whole characters, so emoji and other combined characters stay intact. - `CharLimit` counts characters, not screen width, so a CJK character no longer counts double. - A word that exactly fills a line stays on it. - The cursor can reach wrapped lines at the end of the text. - The view follows the cursor after `SetValue`. - Autoresize keeps the first wrapped line visible. - The first inserted line is counted once when measuring height. - Always keeps at least one column for text, even when `MaxWidth` is tiny. - The placeholder no longer renders twice. - Shift+Backspace and clipboard error fixes, same as Text Input. #### Viewport - Pages by the height you can actually see when the style has a border or padding. - `ScrollPercent` accounts for borders and padding. - Highlights line up on content that's already styled. #### Table - `SetCursor` scrolls to keep the selected row visible. - The view stays put when you step past the last row. - `SetRows` with no rows resets the cursor to the top. - Extra cells in a row are ignored instead of breaking the layout. #### List - `q` and `esc` are back as the default quit keys. - Titles without a status message are no longer cut off. - Fuzzy matches highlight the right characters with non-English text. - Removing an item while filtering keeps the filtered list in sync. #### Timer ⏱️ - Calling `Start` more than once no longer makes the timer count down faster. - Leftover ticks from an earlier start are now really ignored. #### Stopwatch - Elapsed time follows the actual clock, so slow updates can't make it fall behind. - `New()` defaults to a one-second interval, just like the docs always said. #### Progress - Percentages out of range are clamped before animating and rendering. - Fixed a race in the animation. #### File Picker - The selection stays valid while entries load. - No more stray extra newline. #### Help - Short help stays within its width. - Full help columns are styled properly, padding included. #### Tree - `SetValue` updates what's rendered. - `SetNodes` accepts a `nil` root. #### Paginator - An invalid page size leaves pagination as it was instead of breaking it. Big thanks to everyone who contributed, and an extra big welcome to the huge crowd of first-time contributors! This release is mostly yours 🫶 Read the details below 👇🏻 Have a less buggy weekend, Charm XX 🌊 #### Changelog ##### Fixed - [`c94fcfd`](https://github.com/charmbracelet/bubbles/commit/c94fcfd77f0456db9b8f1f781cecea60069d06ec): fix(filepicker): keep the selection valid while entries load ([#&#8203;1093](https://github.com/charmbracelet/bubbles/issues/1093)) ([@&#8203;janearc](https://github.com/janearc)) - [`5bc76ae`](https://github.com/charmbracelet/bubbles/commit/5bc76ae889a474bf28ec1b6c5563481a48089187): fix(filepicker): remove loop iteration appending extra newline ([#&#8203;914](https://github.com/charmbracelet/bubbles/issues/914)) ([@&#8203;bntrtm](https://github.com/bntrtm)) - [`18dcd80`](https://github.com/charmbracelet/bubbles/commit/18dcd80dbec0092a7d6559fc41b69cc2089b4797): fix(help): keep the short help within its width ([#&#8203;1066](https://github.com/charmbracelet/bubbles/issues/1066)) ([@&#8203;iainlane](https://github.com/iainlane)) - [`48be6e2`](https://github.com/charmbracelet/bubbles/commit/48be6e23681186c6adb9301efb1285c0687de8ba): fix(help): style full help column padding ([#&#8203;989](https://github.com/charmbracelet/bubbles/issues/989)) ([@&#8203;Yongcheng123](https://github.com/Yongcheng123)) - [`ed22992`](https://github.com/charmbracelet/bubbles/commit/ed2299259fcc45ec7b35f8228293f11a84c0b6a1): fix(list): RemoveItem correctly updates the filtered list when a filter is active ([#&#8203;997](https://github.com/charmbracelet/bubbles/issues/997)) ([@&#8203;troclaux](https://github.com/troclaux)) - [`74a6322`](https://github.com/charmbracelet/bubbles/commit/74a6322774e1dff822429e769cc217dee6af11ba): fix(list): avoid truncating titles without status ([#&#8203;1048](https://github.com/charmbracelet/bubbles/issues/1048)) ([@&#8203;imshunsuke](https://github.com/imshunsuke)) - [`3bf6c63`](https://github.com/charmbracelet/bubbles/commit/3bf6c639823caf649b6c5f1cdaf6878ee34cc65a): fix(list): convert fuzzy match indexes from byte to rune offsets ([#&#8203;1014](https://github.com/charmbracelet/bubbles/issues/1014)) ([@&#8203;upuddu](https://github.com/upuddu)) - [`19ed085`](https://github.com/charmbracelet/bubbles/commit/19ed08517d54d611b1cd8852b00a3209408fc84f): fix(list): restore the default quit keys ([#&#8203;1046](https://github.com/charmbracelet/bubbles/issues/1046)) ([@&#8203;justadityaraj](https://github.com/justadityaraj)) - [`5629869`](https://github.com/charmbracelet/bubbles/commit/5629869592e126188c3d6b35f7f5227986ca3417): fix(paginator): leave pagination unchanged when the page size is invalid ([#&#8203;1091](https://github.com/charmbracelet/bubbles/issues/1091)) ([@&#8203;janearc](https://github.com/janearc)) - [`e04077d`](https://github.com/charmbracelet/bubbles/commit/e04077d178b7752a88ad0f687966fd10e6effd3a): fix(progress): eliminate race in nextFrame ([#&#8203;1077](https://github.com/charmbracelet/bubbles/issues/1077)) ([@&#8203;rapropos](https://github.com/rapropos)) - [`77c1de1`](https://github.com/charmbracelet/bubbles/commit/77c1de10b4a146a629e1336bdb596d843b5869d2): fix(progress): normalize percentages before animating and rendering ([#&#8203;1082](https://github.com/charmbracelet/bubbles/issues/1082)) ([@&#8203;shayanxcyber](https://github.com/shayanxcyber)) - [`7887706`](https://github.com/charmbracelet/bubbles/commit/7887706da59c5d2ae9c833c8186b2cb18ebfe1e5): fix(stopwatch): derive elapsed from wall clock ([#&#8203;1069](https://github.com/charmbracelet/bubbles/issues/1069)) ([@&#8203;TastyHeadphones](https://github.com/TastyHeadphones)) - [`2dd9752`](https://github.com/charmbracelet/bubbles/commit/2dd9752979cb7488cfa071fdbc904613b37399c4): fix(table): adjust viewport offset in SetCursor to keep cursor row visible ([#&#8203;1064](https://github.com/charmbracelet/bubbles/issues/1064)) ([@&#8203;AdamMagued](https://github.com/AdamMagued)) - [`4f8ed71`](https://github.com/charmbracelet/bubbles/commit/4f8ed715b172c58d88d266e2e225a84b88188287): fix(table): clamp cursor to 0 when SetRows is called with empty slice ([#&#8203;1003](https://github.com/charmbracelet/bubbles/issues/1003)) ([@&#8203;LeSingh1](https://github.com/LeSingh1)) - [`4c0b283`](https://github.com/charmbracelet/bubbles/commit/4c0b283992ab12ad2358043cd3ff5cd345314fda): fix(table): ignore extra cells when rendering rows ([#&#8203;1092](https://github.com/charmbracelet/bubbles/issues/1092)) ([@&#8203;janearc](https://github.com/janearc)) - [`96c3466`](https://github.com/charmbracelet/bubbles/commit/96c3466641c4e6817e32703bb02b3fffe9ca874f): fix(table): keep the viewport in place when stepping across the last row ([#&#8203;1054](https://github.com/charmbracelet/bubbles/issues/1054)) ([@&#8203;cabbagekobe](https://github.com/cabbagekobe)) - [`266927c`](https://github.com/charmbracelet/bubbles/commit/266927c8636778e6b6a283a356621a2d6762dde0): fix(textarea): count first inserted line once in content height ([#&#8203;1088](https://github.com/charmbracelet/bubbles/issues/1088)) ([@&#8203;peterolkhov](https://github.com/peterolkhov)) - [`62411cf`](https://github.com/charmbracelet/bubbles/commit/62411cfb1a404e72f5eb8159dacd9e34ed93dc52): fix(textarea): count runes, not display width, for CharLimit ([#&#8203;1008](https://github.com/charmbracelet/bubbles/issues/1008)) ([@&#8203;sueun-dev](https://github.com/sueun-dev)) - [`273e7bd`](https://github.com/charmbracelet/bubbles/commit/273e7bdc9d915b4b474492356a89362d6460843b): fix(textarea): keep a last word that exactly fills the line ([#&#8203;1070](https://github.com/charmbracelet/bubbles/issues/1070)) ([@&#8203;abdull-ah-med](https://github.com/abdull-ah-med)) - [`b2b782e`](https://github.com/charmbracelet/bubbles/commit/b2b782ecdbee73dcb9a67c356e101e2d4e381752): fix(textarea): keep one column for text when MaxWidth is too small ([#&#8203;1095](https://github.com/charmbracelet/bubbles/issues/1095)) ([@&#8203;janearc](https://github.com/janearc)) - [`b6938b6`](https://github.com/charmbracelet/bubbles/commit/b6938b654247859dfad1a769ac5307a9f623a04c): fix(textarea): navigate and delete whole graphemes ([#&#8203;1067](https://github.com/charmbracelet/bubbles/issues/1067)) ([@&#8203;rupayon123](https://github.com/rupayon123)) - [`a76b63e`](https://github.com/charmbracelet/bubbles/commit/a76b63e13250755023f99f57640af4f4e53f4e8c): fix(textarea): reach trailing wrapped cursor lines ([#&#8203;1051](https://github.com/charmbracelet/bubbles/issues/1051)) ([@&#8203;LeulTew](https://github.com/LeulTew)) - [`eea953c`](https://github.com/charmbracelet/bubbles/commit/eea953c25802fcf5367c2529546b787970efb130): fix(textarea): remove double rendering in placeholder view ([#&#8203;911](https://github.com/charmbracelet/bubbles/issues/911)) ([@&#8203;spxzx](https://github.com/spxzx)) - [`9f3f429`](https://github.com/charmbracelet/bubbles/commit/9f3f4297cab0b08ff354c99447b441640250df13): fix(textarea): reposition view after SetValue ([#&#8203;998](https://github.com/charmbracelet/bubbles/issues/998)) ([@&#8203;troclaux](https://github.com/troclaux)) - [`43e4df9`](https://github.com/charmbracelet/bubbles/commit/43e4df9de7eddb6c7ec049b65b90a81d767fed9d): fix(textinput): apply missing .TextStyle to virtualCursor ([#&#8203;967](https://github.com/charmbracelet/bubbles/issues/967)) ([@&#8203;marvinlanhenke](https://github.com/marvinlanhenke)) - [`b371c6b`](https://github.com/charmbracelet/bubbles/commit/b371c6bcbf597d776a9b85ffcc1d23dfd35eca6e): fix(textinput): cap suggestion completion to input width ([#&#8203;1055](https://github.com/charmbracelet/bubbles/issues/1055)) ([@&#8203;timatigoogl3-code](https://github.com/timatigoogl3-code)) - [`a348bd7`](https://github.com/charmbracelet/bubbles/commit/a348bd73fdc975dd3f0d4428fb4a6dd9108c6733): fix(textinput): keep suggestion index non-negative ([#&#8203;1084](https://github.com/charmbracelet/bubbles/issues/1084)) ([@&#8203;sameerihs](https://github.com/sameerihs)) - [`f9981e0`](https://github.com/charmbracelet/bubbles/commit/f9981e057a214590b5c15d3c9a114a9beee29433): fix(textinput): keep the cursor position correct for wide characters and scrolled values ([#&#8203;1087](https://github.com/charmbracelet/bubbles/issues/1087)) ([@&#8203;shounakjoshi88-a11y](https://github.com/shounakjoshi88-a11y)) - [`bf6c054`](https://github.com/charmbracelet/bubbles/commit/bf6c0542f9e4673e27ee9b9ba4b5923d5c60991e): fix(textinput): refresh suggestions when setting the value ([#&#8203;1096](https://github.com/charmbracelet/bubbles/issues/1096)) ([@&#8203;janearc](https://github.com/janearc)) - [`2ffd48b`](https://github.com/charmbracelet/bubbles/commit/2ffd48bc8bda8b27fcfdd00a32669c4286ade4a2): fix(textinput): show full placeholder when Width is not set ([#&#8203;988](https://github.com/charmbracelet/bubbles/issues/988)) ([@&#8203;troclaux](https://github.com/troclaux)) - [`8f9db15`](https://github.com/charmbracelet/bubbles/commit/8f9db15e87818a581281af4fa38b33ee3647ee5f): fix(textinput): stop forward word deletion at word boundary ([#&#8203;1058](https://github.com/charmbracelet/bubbles/issues/1058)) ([@&#8203;rupayon123](https://github.com/rupayon123)) - [`bf2f980`](https://github.com/charmbracelet/bubbles/commit/bf2f980607381f2e514a631e794c108290711ec0): fix(timer): make tag debounce actually reject stale ticks ([#&#8203;1012](https://github.com/charmbracelet/bubbles/issues/1012)) ([@&#8203;momomuchu](https://github.com/momomuchu)) - [`ee29549`](https://github.com/charmbracelet/bubbles/commit/ee29549cb4079dbe1363bcee85d6d8e1b0041259): fix(timer): prevent Start() from spawning multiple tickers ([#&#8203;922](https://github.com/charmbracelet/bubbles/issues/922)) ([@&#8203;Aliexe-code](https://github.com/Aliexe-code)) - [`d4ae900`](https://github.com/charmbracelet/bubbles/commit/d4ae90043d67fcb40ddb543920f2d4e3a7743305): fix(tree): let SetNodes accept a nil root ([#&#8203;1094](https://github.com/charmbracelet/bubbles/issues/1094)) ([@&#8203;janearc](https://github.com/janearc)) - [`65f99f0`](https://github.com/charmbracelet/bubbles/commit/65f99f0f4e4df4b7dbaf6663638e088a8a804780): fix(tree): update rendered node values in SetValue ([#&#8203;1052](https://github.com/charmbracelet/bubbles/issues/1052)) ([@&#8203;jakezwang](https://github.com/jakezwang)) - [`01b9d49`](https://github.com/charmbracelet/bubbles/commit/01b9d492686faf30e55ae433e309495ed31040ca): fix(viewport): account for the style frame in ScrollPercent ([#&#8203;1086](https://github.com/charmbracelet/bubbles/issues/1086)) ([@&#8203;yxshee](https://github.com/yxshee)) - [`8add387`](https://github.com/charmbracelet/bubbles/commit/8add387554ebd6ecffa05cbd4156ee0f374a65f5): fix(viewport): correct highlight offsets on ANSI-styled content ([#&#8203;1050](https://github.com/charmbracelet/bubbles/issues/1050)) ([@&#8203;rksharma-owg](https://github.com/rksharma-owg)) - [`8e65b5c`](https://github.com/charmbracelet/bubbles/commit/8e65b5c4ec3b668e8018f34a093ca2dd0cc93e40): fix(viewport): page by the visible height when the style has a frame ([#&#8203;1085](https://github.com/charmbracelet/bubbles/issues/1085)) ([@&#8203;yxshee](https://github.com/yxshee)) ##### Other stuff - [`4e3dc76`](https://github.com/charmbracelet/bubbles/commit/4e3dc7629da581f518450e23bfa23f80fd23be37): ci: lint ([#&#8203;1099](https://github.com/charmbracelet/bubbles/issues/1099)) ([@&#8203;andrinoff](https://github.com/andrinoff)) - [`3815b7b`](https://github.com/charmbracelet/bubbles/commit/3815b7bcb4f7d1a2c09accdca7fa268113069879): feat(textinput,textarea): add shift+backspace support ([#&#8203;972](https://github.com/charmbracelet/bubbles/issues/972)) ([@&#8203;jabagawee](https://github.com/jabagawee)) - [`0511907`](https://github.com/charmbracelet/bubbles/commit/05119079730e5caac2dc05a1ff012c53418528fb): fix(textinput,textarea): implement Unwrap on clipboard error messages ([#&#8203;1063](https://github.com/charmbracelet/bubbles/issues/1063)) ([@&#8203;AdamMagued](https://github.com/AdamMagued)) - [`99653d3`](https://github.com/charmbracelet/bubbles/commit/99653d3a24cb7f40bc00f57cd0ea92b693ccb061): textarea: keep first soft-wrapped row visible after autoresize ([#&#8203;913](https://github.com/charmbracelet/bubbles/issues/913)) ([@&#8203;yogirk](https://github.com/yogirk)) - [`0c1a491`](https://github.com/charmbracelet/bubbles/commit/0c1a4915f40343be6d6a3bb3f998db8f069d8b03): v2.2.2 ([@&#8203;andrinoff](https://github.com/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](https://x.com/charmcli), [Discord](https://charm.land/discord), [Slack](https://charm.land/slack), [The Fediverse](https://mastodon.social/@charmcli), [Bluesky](https://bsky.app/profile/charm.land). ### [`v2.2.1`](https://github.com/charmbracelet/bubbles/releases/tag/v2.2.1) [Compare Source](https://github.com/charmbracelet/bubbles/compare/v2.2.0...v2.2.1) ### 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 [@&#8203;OxQuasar](https://github.com/OxQuasar)! #### Changelog ##### Fixed - [`f613411`](https://github.com/charmbracelet/bubbles/commit/f6134114d735cf40e95c15ff62e7359e46d04fc9): fix(textarea): stop word-left at input boundary ([#&#8203;1036](https://github.com/charmbracelet/bubbles/issues/1036)) ([@&#8203;OxQuasar](https://github.com/OxQuasar)) ##### Docs - [`87d4458`](https://github.com/charmbracelet/bubbles/commit/87d445838781700cb25e3fc3a6b26006eab97b41): docs: update godoc link in readme to new package ([@&#8203;meowgorithm](https://github.com/meowgorithm)) ##### Other stuff - [`10489b5`](https://github.com/charmbracelet/bubbles/commit/10489b5fafe92bfaea873297cab8ac8b5c5237f4): readme: drop tree section for now ([@&#8203;meowgorithm](https://github.com/meowgorithm)) - [`4909481`](https://github.com/charmbracelet/bubbles/commit/490948109eb4731927ba2f4cd464d8175a9630d7): v2.2.1 ([@&#8203;andrinoff](https://github.com/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](https://x.com/charmcli), [Discord](https://charm.land/discord), [Slack](https://charm.land/slack), [The Fediverse](https://mastodon.social/@charmcli), [Bluesky](https://bsky.app/profile/charm.land). ### [`v2.2.0`](https://github.com/charmbracelet/bubbles/releases/tag/v2.2.0) [Compare Source](https://github.com/charmbracelet/bubbles/compare/v2.1.1...v2.2.0) ### 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 [@&#8203;dlvhdr](https://github.com/dlvhdr)’s is here! He built it for [DiffNav](https://github.com/dlvhdr/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 [@&#8203;andrinoff](https://github.com/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](https://pkg.go.dev/charm.land/bubbles/v2@v2.2.0/textarea). And special thanks to [@&#8203;zoriya](https://github.com/zoriya) for adding <kbd>ctrl+left/right</kbd> bindings. xoxo, Charm! 💌 #### Changelog ##### New! - [`8cea431`](https://github.com/charmbracelet/bubbles/commit/8cea431500a8837c241cbe8ad71601aa8f00a0d9): feat(textarea): support ctrl + left/right/backspace ([#&#8203;1020](https://github.com/charmbracelet/bubbles/issues/1020)) ([@&#8203;zoriya](https://github.com/zoriya)) - [`037ad37`](https://github.com/charmbracelet/bubbles/commit/037ad37bb0aa6e8ec544df6d3af752755f0a72d9): feat: textarea selection ([#&#8203;1029](https://github.com/charmbracelet/bubbles/issues/1029)) ([@&#8203;andrinoff](https://github.com/andrinoff)) - [`e97af08`](https://github.com/charmbracelet/bubbles/commit/e97af08ee293131e7b71f7e3006c06a81a2584b8): feat: tree bubble ([#&#8203;893](https://github.com/charmbracelet/bubbles/issues/893)) ([@&#8203;dlvhdr](https://github.com/dlvhdr)) ##### Fixed - [`6484e49`](https://github.com/charmbracelet/bubbles/commit/6484e49c0a051fe100cb16c0e184cabd4b53a6f0): fix(filepicker): don't blank the view when height is unset ([#&#8203;1026](https://github.com/charmbracelet/bubbles/issues/1026)) ([@&#8203;andrinoff](https://github.com/andrinoff)) ##### Other stuff - [`355f960`](https://github.com/charmbracelet/bubbles/commit/355f960a27f9b0bf455b3ddea66dc987db62317d): ci: sync dependabot config ([#&#8203;896](https://github.com/charmbracelet/bubbles/issues/896)) ([@&#8203;charmcli](https://github.com/charmcli)) - [`ef8af03`](https://github.com/charmbracelet/bubbles/commit/ef8af03870c1817d3b0b4fa0578b661a576e0220): v2.2.0 ([@&#8203;andrinoff](https://github.com/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](https://x.com/charmcli), [Discord](https://charm.land/discord), [Slack](https://charm.land/slack), [The Fediverse](https://mastodon.social/@charmcli), [Bluesky](https://bsky.app/profile/charm.land). ### [`v2.1.1`](https://github.com/charmbracelet/bubbles/releases/tag/v2.1.1) [Compare Source](https://github.com/charmbracelet/bubbles/compare/v2.1.0...v2.1.1) ### 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 - [`d2b2217`](https://github.com/charmbracelet/bubbles/commit/d2b2217d6352ce04183623d66d4266115419733c): fix(textarea): apply prompt style on all lines, including fillers ([@&#8203;meowgorithm](https://github.com/meowgorithm)) ##### Docs - [`a13f110`](https://github.com/charmbracelet/bubbles/commit/a13f110fba4f13ce5fe9bc7fd51619f5782077b9): docs: fix typo in README ([#&#8203;921](https://github.com/charmbracelet/bubbles/issues/921)) ([@&#8203;Rohan5commit](https://github.com/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](https://x.com/charmcli), [Discord](https://charm.land/discord), [Slack](https://charm.land/slack), [The Fediverse](https://mastodon.social/@charmcli), [Bluesky](https://bsky.app/profile/charm.land). ### [`v2.1.0`](https://github.com/charmbracelet/bubbles/releases/tag/v2.1.0) [Compare Source](https://github.com/charmbracelet/bubbles/compare/v2.0.0...v2.1.0) ### 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! - [`f1daacf`](https://github.com/charmbracelet/bubbles/commit/f1daacfa0cfee07e31a12498078426d275aa5286): feat(textarea): dynamic height ([#&#8203;910](https://github.com/charmbracelet/bubbles/issues/910)) ([@&#8203;meowgorithm](https://github.com/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](https://x.com/charmcli), [Discord](https://charm.land/discord), [Slack](https://charm.land/slack), [The Fediverse](https://mastodon.social/@charmcli), [Bluesky](https://bsky.app/profile/charm.land). ### [`v2.0.0`](https://github.com/charmbracelet/bubbles/releases/tag/v2.0.0) [Compare Source](https://github.com/charmbracelet/bubbles/compare/v1.0.0...v2.0.0) ![bubbles-v2-block](https://github.com/user-attachments/assets/3ac0db88-ff60-4c8b-a056-18831efcae0c) ### Bubbles v2 is here! 🫧 We're thrilled to share Bubbles v2 with you! This release accompanies [Bubble Tea v2](https://github.com/charmbracelet/bubbletea) and [Lip Gloss v2](https://github.com/charmbracelet/lipgloss) 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](UPGRADE_GUIDE_V2.md) 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](https://github.com/charmbracelet/bubbletea/tree/v2-exp/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](https://github.com/charmbracelet/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(30*time.Second, timer.WithInterval(100*time.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](https://github.com/charmbracelet/bubbletea/blob/v2-exp/examples/textarea/main.go) and [textinput](https://github.com/charmbracelet/bubbletea/blob/v2-exp/examples/textinput/main.go) 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 [@&#8203;lrstanley](https://github.com/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 [@&#8203;s0ders](https://github.com/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` - `Model.SetCursor` renamed to `Model.SetCursorColumn` - `Model.Cursor` is now `func() *tea.Cursor` for real cursor support - `Model.VirtualCursor` bool added — set to `false` when using a real cursor - New `DefaultStyles(isDark bool)`, `DefaultDarkStyles()`, `DefaultLightStyles()` - New methods: `Column()`, `ScrollYOffset()`, `ScrollPosition()`, `MoveToBeginning()`, `MoveToEnd()` - Focus status now passed to `SetPromptFunc` ##### 📜 Textinput Most of the changes here bring `textinput` to parity with `textarea`, including real cursor support. Styling has been consolidated into a `Styles` struct with `Focused` and `Blurred` states: - `DefaultKeyMap` variable → `DefaultKeyMap()` function - `Model.Width` broken into `SetWidth(int)` / `Width() int` - `Model.PromptStyle` → `StyleState.Prompt` - `Model.TextStyle` → `StyleState.Text` - `Model.PlaceholderStyle` → `StyleState.Placeholder` - `Model.CompletionStyle` → `StyleState.Suggestion` - `Model.Cursor` is now `func() *tea.Cursor` for real cursor support - `Model.VirtualCursor()` / `SetVirtualCursor(bool)` added - `Model.Styles()` / `SetStyles(Styles)` added - New `DefaultStyles(isDark bool)`, `DefaultDarkStyles()`, `DefaultLightStyles()` - Exposed matched suggestions and suggestion index ##### ⏲️ Timer - `NewWithInterval(timeout, interval)` removed — use `New(timeout, WithInterval(interval))` - Debounced tick messages ##### 📦 Viewport `viewport` got a *ton* of love in v2. Let's dive in! **Breaking changes:** - `New(width, height int)` → `New(...Option)` with `WithWidth` / `WithHeight` - `Model.Width`, `Model.Height`, `Model.YOffset` replaced with getter/setter methods - `HighPerformanceRendering` removed **Shiny 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: ```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 parts of what's being viewed with regex: ```go 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 ``` Let viewport handle soft wrapping for you: ```go vp.SoftWrap = true vp.SetContent("hello world from a very long line") ``` Or, if you need fine control, use `SetContentLines` with "virtual lines" containing `\n` — they're treated as soft wraps automatically. Also new: - Horizontal mouse wheel scrolling (thanks [@&#8203;UnseenBook](https://github.com/UnseenBook)!) - `GetContent()` to retrieve content - `FillHeight` to pad the viewport with empty lines - `StyleLineFunc` for per-line styling - `HighlightStyle` and `SelectedHighlightStyle` for highlight appearance <details> <summary> #### Changelog </summary> ##### Fixed * f744b929dddecc7863cf78605c5bfc396d90abc3: fix(ci): use local golangci-lint config (@&#8203;aymanbagabas) * 251e612949595b006e0e4739029d45e32c6b34b6: fix(filepicker): fix a panic due to an unchecked assertion (#&#8203;891) (@&#8203;meowgorithm) * f3f0ca0fe2f05b56e5a0c69b226b4d752c5e8f4a: fix(lint): exclude var-naming rule for revive (@&#8203;aymanbagabas) * d004225e8c3b8c8ddb14a76a5101728d666396f3: fix(table): use `ansi.Truncate` instead of `runewidth.Truncate` (#&#8203;884) (@&#8203;jedevc) * 93a004ab70c8ea979940b2720b3993c8f68bf8dc: fix(viewport): optimize subline splitting by skipping lines without line endings (@&#8203;aymanbagabas) * d0166363eb8176b331de98dba1d6e997560f216f: fix: changed 'recieve' to 'receive' for 100% quality of Go Report Card (#&#8203;881) (@&#8203;Atennop1) * af98365cc63af118d838e05522f8dddf16ad827e: fix: lint issues (@&#8203;aymanbagabas) ##### Docs * c81d525337e1a059c4343cf65a02eea020470a48: docs(readme): update for v2 (#&#8203;888) (@&#8203;aymanbagabas) * 6a799f4d58cc0eaeab0874f4ce9c98b5a922bd01: docs(readme): update header image, minor corrections (@&#8203;meowgorithm) * 24081b3590e746db4efa2ec09e31a85e2c078427: docs: add v2 upgrade and changes guide (#&#8203;885) (@&#8203;aymanbagabas) * 3a5ea3e2eb42aa064bb4a0ffe3262cb2b8a1f19b: docs: update mascot image (@&#8203;aymanbagabas) ##### Other stuff * ae99f46cec66f45862c2d953bb1af31efdc4f073: feat(v2/textarea): expose Column(), clarify 0-indexing (#&#8203;875) (@&#8203;caarlos0) </details> *** #### 💝 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](https://charm.land/discord) - [Matrix](https://charm.land/matrix) - [Email](mailto:vt100@&#8203;charm.land) *** Part of [Charm](https://charm.land). <a href="https://charm.land/"><img alt="The Charm logo" src="https://stuff.charm.sh/charm-badge.jpg" width="400"></a> Charm热爱开源 • Charm loves open source • نحنُ نحب المصادر المفتوحة ### [`v1.0.0`](https://github.com/charmbracelet/bubbles/releases/tag/v1.0.0) [Compare Source](https://github.com/charmbracelet/bubbles/compare/v0.21.1...v1.0.0) This is just an honorary release of Bubbles v1. Stay tuned for the next major version 🫧 #### Changelog ##### Fixed - [`d016636`](https://github.com/charmbracelet/bubbles/commit/d0166363eb8176b331de98dba1d6e997560f216f): fix: changed 'recieve' to 'receive' for 100% quality of Go Report Card ([#&#8203;881](https://github.com/charmbracelet/bubbles/issues/881)) ([@&#8203;Atennop1](https://github.com/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](https://x.com/charmcli), [Discord](https://charm.land/discord), [Slack](https://charm.land/slack), [The Fediverse](https://mastodon.social/@charmcli), [Bluesky](https://bsky.app/profile/charm.land). </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Enabled. ♻ **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. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4yNDcuMSIsInVwZGF0ZWRJblZlciI6IjQ0LjI0Ny4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
fix(deps): update module github.com/charmbracelet/bubbles to v2
Some checks failed
CI / integration-1 (pull_request) Has been skipped
CI / e2e (pull_request) Has been skipped
renovate/artifacts Artifact file update failure
CI / build (pull_request) Failing after 27s
CI / generate (pull_request) Failing after 54s
CI / integration (pull_request) Failing after 1m13s
CI / lint (pull_request) Failing after 1m3s
CI / unit (pull_request) Failing after 50s
CI / ci (pull_request) Failing after 0s
a260c960c2
renovate-bot scheduled this pull request to auto merge when all checks succeed 2026-11-29 15:13:16 +00:00
Author
Collaborator

⚠️ Artifact update problem

Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you click the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: go.sum
go: github.com/charmbracelet/bubbles/v2@v2.2.2: parsing go.mod:
	module declares its path as: charm.land/bubbles/v2
	        but was required as: github.com/charmbracelet/bubbles/v2

### ⚠️ Artifact update problem Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is. ♻ Renovate will retry this branch, including artifacts, only when one of the following happens: - any of the package files in this branch needs updating, or - the branch becomes conflicted, or - you click the rebase/retry checkbox if found above, or - you rename this PR's title to start with "rebase!" to trigger it manually The artifact failure details are included below: ##### File name: go.sum ``` go: github.com/charmbracelet/bubbles/v2@v2.2.2: parsing go.mod: module declares its path as: charm.land/bubbles/v2 but was required as: github.com/charmbracelet/bubbles/v2 ```
renovate-bot force-pushed renovate/github.com-charmbracelet-bubbles-2.x from a260c960c2
Some checks failed
CI / integration-1 (pull_request) Has been skipped
CI / e2e (pull_request) Has been skipped
renovate/artifacts Artifact file update failure
CI / build (pull_request) Failing after 27s
CI / generate (pull_request) Failing after 54s
CI / integration (pull_request) Failing after 1m13s
CI / lint (pull_request) Failing after 1m3s
CI / unit (pull_request) Failing after 50s
CI / ci (pull_request) Failing after 0s
to 0f584895ef
Some checks failed
renovate/artifacts Artifact file update failure
CI / integration-1 (pull_request) Has been skipped
CI / e2e (pull_request) Has been skipped
CI / generate (pull_request) Failing after 26s
CI / integration (pull_request) Failing after 36s
CI / build (pull_request) Failing after 20s
CI / unit (pull_request) Failing after 45s
CI / lint (pull_request) Failing after 1m3s
CI / ci (pull_request) Failing after 0s
2026-11-29 23:00:51 +00:00
Compare
Some checks failed
renovate/artifacts Artifact file update failure
CI / integration-1 (pull_request) Has been skipped
Required
Details
CI / e2e (pull_request) Has been skipped
Required
Details
CI / generate (pull_request) Failing after 26s
Required
Details
CI / integration (pull_request) Failing after 36s
Required
Details
CI / build (pull_request) Failing after 20s
Required
Details
CI / unit (pull_request) Failing after 45s
Required
Details
CI / lint (pull_request) Failing after 1m3s
Required
Details
CI / ci (pull_request) Failing after 0s
Required
Details
Some required checks were not successful.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'renovate/github.com-charmbracelet-bubbles-2.x:renovate/github.com-charmbracelet-bubbles-2.x'
git switch 'renovate/github.com-charmbracelet-bubbles-2.x'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
hmajid2301/optinix!7
No description provided.