fix(deps): update module github.com/charmbracelet/bubbles to v2#883
Open
renovate[bot] wants to merge 1 commit intomainfrom
Open
fix(deps): update module github.com/charmbracelet/bubbles to v2#883renovate[bot] wants to merge 1 commit intomainfrom
renovate[bot] wants to merge 1 commit intomainfrom
Conversation
Contributor
Author
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
v0.16.1→v2.0.0Release Notes
charmbracelet/bubbles (github.com/charmbracelet/bubbles)
v2.0.0Compare Source
Bubbles v2 is here! 🫧
We're thrilled to share Bubbles v2 with you! This release accompanies Bubble Tea v2 and Lip Gloss v2 and brings a ton of consistency, new features, and quality-of-life improvements across every component. Catch 'em all:
You can also check the Upgrade Guide for more info.
There are a lot of changes in here, but we've found upgrading pretty easy, especially with a linter. Read on for the full breakdown!
🏠 New Home
Bubbles v2 now lives at
charm.land:All sub-packages follow the same pattern:
charm.land/bubbles/v2/viewport,charm.land/bubbles/v2/list, etc.🎨 Light and Dark Styles
Some Bubbles, like
help, offer default styles for both light and dark backgrounds. Since Lip Gloss v2 removesAdaptiveColor, choosing light or dark is now a manual process. You've got a couple of options.🎩 The Best Way
Have Bubble Tea query the background color for you. This properly queries the correct inputs and outputs, and happens in lockstep with your application:
If you're using Wish you must do it this way to get the background color of the client.
🤠 The Quick Way
Use the
compatpackage in Lip Gloss. It's less recommended because it contains blocking I/O that operates independently of Bubble Tea, and when used with Wish it won't detect the client's background:👀 Or Just Pick One
This pattern applies to
help,list,textarea, andtextinput.🔑 The Init You Know and Love is Back
After experimenting with a few different forms of
Initduring the alphas, we decided the v1 signature was the right call after all.Initwas a bit too redundant for our tastes given that initialization already happens inNew:✨ The Big Highlights
Getters and Setters Everywhere
All components now use getter/setter methods instead of exported
WidthandHeightfields. This lets us do internal bookkeeping when things change, and it makes the API consistent across every Bubble:Affected:
filepicker,help,progress,table,textinput,viewport.Functional Options
Constructors now use the functional options pattern instead of positional args or separate constructor functions:
DefaultKeyMap is a Function Now
All
DefaultKeyMappackage-level variables are now functions, so you get fresh values every time:Real Cursor Support 🖱️
Both
textareaandtextinputnow support real terminal cursors! The feature is opt-in, so by default your programs will continue to use the easy-breezy virtual cursor. SetVirtualCursortofalseand useModel.Cursor()for the real deal. Check out the textarea and textinput examples to see it in action.Cleaned House 🧹
All previously deprecated symbols have been removed:
NewModelvariants — just useNewspinner.Tick()— useModel.Tick()insteadpaginator.UsePgUpPgDownKeysand friends — customizeKeyMapdirectlyfilepicker.DefaultStylesWithRenderer()— Lip Gloss is pure now, useDefaultStyles()viewport.HighPerformanceRendering— no longer neededruneutilandmemoizationpackages moved tointernal/(they were never meant for public use anyway)What's Changed: the Laundry List
🔮 Cursor
Model.Blinkrenamed toModel.IsBlinkedfor clarityModel.BlinkCmd()renamed toModel.Blink()📂 Filepicker
DefaultStylesWithRenderer()removed — Lip Gloss is pure now, so just useDefaultStyles()Model.Heightbroken intoSetHeight(int)/Height() int❓ Help
Model.Widthbroken intoSetWidth(int)/Width() intDefaultStyles(isDark bool),DefaultDarkStyles(), andDefaultLightStyles()🥕 List
DefaultStyles()andNewDefaultItemStyles()now take anisDark boolparameterStyles.FilterPromptandStyles.FilterCursorhave been consolidated intoStyles.Filter(atextinput.Styles)GlobalIndexhelper added📄 Paginator
DefaultKeyMapvariable →DefaultKeyMap()functionUsePgUpPgDownKeys,UseLeftRightKeys, etc.) removed — customizeKeyMapdirectly🌈 Progress
This one got the biggest makeover!
WithGradient/WithScaledGradient→WithColors(...color.Color)— pass 2+ colors for blendingWithSolidFill(string)→WithColors(color)— pass a single color for a solid fillWithDefaultGradient()→WithDefaultBlend()WithScaled(bool)to scale the blend to fit only the filled portionWithColorFunc(func(total, current float64) color.Color)for fully dynamic coloringWithColorProfileremoved — Bubble Tea handles this automatically nowModel.FullColorandModel.EmptyColorchanged fromstringtoimage/color.ColorModel.Widthbroken intoSetWidth(int)/Width() intModel.Updatenow returnsModelinstead oftea.Model🌀 Spinner
Tick()package-level function removed — useModel.Tick()instead⏱️ Stopwatch
NewWithInterval(d)removed — useNew(WithInterval(d))instead🔢 Table
Model.Width/Model.Heightreplaced with getter/setter methodsansi.Truncateinstead ofrunewidth.Truncate✏️ Textarea
The big change here is real cursor support — but that's opt-in, so by default your programs will keep using the virtual cursor.
DefaultKeyMapvariable →DefaultKeyMap()functionPageUp/PageDownkey bindingsModel.FocusedStyle/Model.BlurredStyle→Model.Styles.Focused/Model.Styles.BlurredStyletype renamed toStyleState; newStylesstruct groupsFocused,Blurred, andCursorModel.SetCursorrenamed toModel.SetCursorColumnModel.Cursoris nowfunc() *tea.Cursorfor real cursor supportModel.VirtualCursorbool added — set tofalsewhen using a real cursorDefaultStyles(isDark bool),DefaultDarkStyles(),DefaultLightStyles()Column(),ScrollYOffset(),ScrollPosition(),MoveToBeginning(),MoveToEnd()SetPromptFunc📜 Textinput
Most of the changes here bring
textinputto parity withtextarea, including real cursor support. Styling has been consolidated into aStylesstruct withFocusedandBlurredstates:DefaultKeyMapvariable →DefaultKeyMap()functionModel.Widthbroken intoSetWidth(int)/Width() intModel.PromptStyle→StyleState.PromptModel.TextStyle→StyleState.TextModel.PlaceholderStyle→StyleState.PlaceholderModel.CompletionStyle→StyleState.SuggestionModel.Cursoris nowfunc() *tea.Cursorfor real cursor supportModel.VirtualCursor()/SetVirtualCursor(bool)addedModel.Styles()/SetStyles(Styles)addedDefaultStyles(isDark bool),DefaultDarkStyles(),DefaultLightStyles()⏲️ Timer
NewWithInterval(timeout, interval)removed — useNew(timeout, WithInterval(interval))📦 Viewport
viewportgot a ton of love in v2. Let's dive in!Breaking changes:
New(width, height int)→New(...Option)withWithWidth/WithHeightModel.Width,Model.Height,Model.YOffsetreplaced with getter/setter methodsHighPerformanceRenderingremovedShiny new features:
You can now scroll horizontally with the left and right arrow keys, and set up a custom gutter column for things like line numbers:
Highlight parts of what's being viewed with regex:
Let viewport handle soft wrapping for you:
Or, if you need fine control, use
SetContentLineswith "virtual lines" containing\n— they're treated as soft wraps automatically.Also new:
GetContent()to retrieve contentFillHeightto pad the viewport with empty linesStyleLineFuncfor per-line stylingHighlightStyleandSelectedHighlightStylefor highlight appearanceChangelog
Fixed
ansi.Truncateinstead ofrunewidth.Truncate(#884) (@jedevc)Docs
Other stuff
💝 That's a wrap!
Feel free to reach out, ask questions, give feedback, and let us know how it's going. We'd love to know what you think.
Part of Charm.
Charm热爱开源 • Charm loves open source • نحنُ نحب المصادر المفتوحة
v1.0.0Compare Source
This is just an honorary release of Bubbles v1. Stay tuned for the next major version 🫧
Changelog
Fixed
d016636: fix: changed 'recieve' to 'receive' for 100% quality of Go Report Card (#881) (@Atennop1)Thoughts? Questions? We love hearing from you. Feel free to reach out on X, Discord, Slack, The Fediverse, Bluesky.
v0.21.1Compare Source
Changelog
New!
dff42dd: feat: update keybindings in list setSize method (@Broderick-Westrope)Fixed
c376ce3: fix(cursor): fix data race on blinkTag (#784) (@DryHumour)11d52ca: fix(table): preventing cursor from being out-of-bounds. (@s0ders)49ff5c0: fix(textinput): improve placeholder (#768) (@caarlos0)7c44f63: v1: fix(list): ensure correct cursor positions with page/cursor methods (#831) (@lrstanley)Docs
7fcf75d: docs(readme): update footer image and copyright date (@meowgorithm)d4feefe: docs: remove Charm Cloud reference (#785) (@ShalokShalom)Other stuff
daab808: ci: sync dependabot config (#786) (@charmcli)4b2d311: ci: sync dependabot config (#835) (@charmcli)8562e90: ci: sync golangci-lint config (#781) (@github-actions[bot])f54a125: test(table): improve table unit tests (#601) (@Broderick-Westrope)Thoughts? Questions? We love hearing from you. Feel free to reach out on X, Discord, Slack, The Fediverse, Bluesky.
v0.21.0Compare Source
Viewport improvements
Finally,
viewportfinally has horizontal scrolling ✨!1To enable it, use
SetHorizontalStep(default in v2 will be6).You can also scroll manually with
ScrollLeftandScrollRight, and useSetXOffsetto scroll to a specific position (or0to reset):To make the API more consistent, vertical scroll functions were also renamed,
and the old ones were deprecated (and will be removed in v2):
Other improvements
The
listbubble got a couple of new functions:SetFilterText,SetFilterState, andGlobalIndex- which you can use to get the index of theitem in the unfiltered, original item list.
On
textinput, you can now get the matched suggestions and more withMatchedSuggestionsandCurrentSuggestionIndex.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.
Changelog
New Features
d019ed3: feat(list): add SetFilterText and SetFilterState (#335) (@taigrr)171a9d6: feat(list): implement GlobalIndex helper (#574) (@nobe4)4382fdf: feat(textinput): expose matched suggestions and index (@luevano)2d53a61: feat(viewport): horizontal scroll (#240) (@tty2)ea344ab: feat(viewport): horizontal scroll with mouse wheel (#761) (@UnseenBook)Bug fixes
f2434c3: Revert "fix(viewport): normalize method names" (@caarlos0)8101a34: fix(ci): add lint and lint-sync workflows and update golangci.yml (#651) (@aymanbagabas)54f28b6: fix(filepicker): properly scrolling filepicker (#753) (@caarlos0)81d444a: fix(help): wrong full help sep rendering (@luevano)f439d83: fix(textarea): max height should not determine max lines (@meowgorithm)8b55efb: fix(textarea): placeholder with chinese chars (#767) (@caarlos0)8624776: fix(textinput): slicing outside cap (#532) (@MikaelFangel)c7f889e: fix(viewport): normalize method names (@caarlos0)39668ec: fix(viewport): normalize method names (#763) (@caarlos0)7ab08fb: fix(viewport): scroll to last line when borders (#706) (@caarlos0)730f5a2: fix: debounce stopwatch and timer (@meowgorithm)bd2a5b0: fix: golangci-lint 2 fixes (#769) (@caarlos0)9589cbc: fix: lint issues and disable predeclared linter (#614) (@aymanbagabas)398e92c: fix: remove default character limit (@meowgorithm)1bdd4c6: fix: stopwatch.Start() (#707) (@bevicted)9a262e9: fix: use atomic for ids (#634) (@caarlos0)Dependency updates
1797ac2: feat(deps): bump github.com/charmbracelet/bubbletea from 1.1.0 to 1.1.1 (#611) (@dependabot[bot])a9b780a: feat(deps): bump github.com/charmbracelet/lipgloss from 0.13.0 to 0.13.1 (@dependabot[bot])db3514c: feat(deps): bump github.com/charmbracelet/lipgloss from 0.13.1 to 1.0.0 (#655) (@dependabot[bot])43aa82c: feat(deps): bump github.com/charmbracelet/x/ansi (#716) (@dependabot[bot])c1199d7: feat(deps): bump github.com/charmbracelet/x/ansi from 0.2.3 to 0.3.0 (#613) (@dependabot[bot])d3ac47d: feat(deps): bump github.com/charmbracelet/x/ansi from 0.3.0 to 0.3.1 (#615) (@dependabot[bot])ed14316: feat(deps): bump github.com/charmbracelet/x/ansi from 0.3.1 to 0.3.2 (#618) (@dependabot[bot])Documentation updates
cf3f46a: docs(list): fix grammar in doc comment and README (#627) (@oahshtsua)9e5365e: docs: add example for ValidateFunc (#705) (@bashbunni)87a4e45: docs: additional bubbles (#583) (@caarlos0)e3ce11a: docs: update charm & friends blurb (#703) (@bashbunni)178590b: docs: update contributing guidelines (#640) (@bashbunni)Other work
0f9e38c: Don't render suggestions when textinput is not focused. (@elProxy)e5296a2: ci: fix goreleaser config (#668) (@caarlos0)76433f7: ci: fix linting on windows (@andreynering)d91c9aa: ci: rm .golangci-soft.yml (@caarlos0)2f49443: ci: sync dependabot config (#734) (@charmcli)7a6b190: ci: sync dependabot config (#736) (@charmcli)d58217b: ci: sync golangci-lint config (#750) (@github-actions[bot])cce8481: ci: sync golangci-lint config (#770) (@github-actions[bot])0305695: ci: test on oldstable and stable go versions, automerge dependabot (#755) (@caarlos0)Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or on Discord.
v0.20.0Compare Source
Focus. Breathe.
This features support for Bubble Tea's new focus-blur feature as well as a quality-of-life update to
paginator. Enjoy!Focus
You heard that right. Focus-blur window events are now enabled for
textinputandtextareawhich were recently added to Bubble Tea v1.1.0. As long asWithReportFocusis enabled in your Program you'll automatically get nicer inputs.To enable focus reporting:
Remember to stay focused and hydrated!
Paginator opts
Speaking of functional arguments,
paginatoralso received some some new quality-of-life startup options, courtesy @nervo.Of course, you can still set the values on the model directly too:
Happy paging!
Changelog
New!
d3bd075: feat(cursor): focus/blur support (#581) (@caarlos0)5110925: feat: Introduce paginator options (@nervo)Deps
3eaf8da: feat(deps): bump github.com/charmbracelet/bubbletea from 0.27.0 to 1.0.0 (#604) (@dependabot[bot])6fc27e9: feat(deps): bump github.com/charmbracelet/bubbletea from 1.0.0 to 1.1.0 (#607) (@dependabot[bot])Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or on Discord.
v0.19.0Compare Source
Bugs? Squashed (along with a few nice lil’ features).
Community-Driven Development?! Yep, the majority of the changes in this release were done by the community. Thank you all for your contributions that made this release possible.
Progress: custom chars
You can now customize the filled and empty characters of the progress bar.
Table improvements
Help is on the way
Table now includes a short and full help view so it's easier than ever to tell your users how to interact with the table.
Accessing columns
You can also now get the table's columns (this already existed for rows).
List: page navigation is fixed!
Previously,
list.NextPage()andlist.PrevPage()didn't work because the methods did not have pointer receivers. We've fixed this…by making them pointer receivers!What’s Changed
Changed
Added
Fixed
Test coverage ✅
New Contributors
Full Changelog: charmbracelet/bubbles@v0.18.0...v0.19.0
Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or on Discord.
v0.18.0Compare Source
Textarea, but faster
This release features several fixes and big performance improvements for the
textareabubble.What's Changed
New
Improved
uniseg.StringWidthby @maaslalani in #462Fixed
New Contributors
Full Changelog: charmbracelet/bubbles@v0.17.1...v0.18.0
Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or on Discord.
v0.17.1Compare Source
Bumping Bubble Tea
This is just a little update to update to the latest version of Bubble Tea.
What's Changed
Full Changelog: charmbracelet/bubbles@v0.17.0...v0.17.1
Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or on Discord.
v0.17.0Compare Source
Text input autocompletions and various improvements
Autocompletion in Text Input
So @toadle wanted
textinputs to support autocompletion in a ghost-text kind of a way. Rather than wait for us to do it he did what any dedicated open source developer would: he sent a PR! And now we can all benefit from his hard work.Autocompletion is super easy to use:
By default you can press ctrl+n and ctrl+p to cycle through suggestions, but those keybindings can be changed as you, the application developer, see fit. For details check out
textinput.SetSuggestionsand the correspondingKeyMapin the docs.Is the progress bar done yet?
@yrashk acutely noticed that to nicely transition from one state to another after an animated progress bar fills up it's helpful to know when the animated has finished animating before transitioning. To solve for this he added an
IsAnimatingmethod to theprogressmodel. Thanks, @yrashk!Changelog
New!
Improved
filterItemsby @naglis in #396Fixed
Full Changelog: charmbracelet/bubbles@v0.16.1...v0.17.0
New Contributors
Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or on Discord.
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.
Footnotes
It is disabled by default in v1, but will be enabled in v2. ↩