Skip to content

v0.19.0

Compare
Choose a tag to compare
@github-actions github-actions released this 20 Aug 20:13
· 33 commits to master since this release

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.

p := progress.New(progress.WithFillCharacters('>', '.'))

progress bar example

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.

// Render a table with its help.
t := table.New()
view := t.View() + "\n" + t.HelpView()

Accessing columns

You can also now get the table's columns (this already existed for rows).

package table

// Columns returns the current columns.
func (m Model) Columns() []Column

List: page navigation is fixed!

Previously, list.NextPage() and list.PrevPage() didn't work because the methods did not have pointer receivers. We've fixed this…by making them pointer receivers!

⚠️ Note that this is a minor API change and you might need to update your app to pass a pointer receiver to your model rather than a copy. Details in #458.

package progress

// NextPage moves to the next page, if available.
func (m *Model) NextPage()

// PrevPage moves to the previous page, if available.
func (m *Model) PrevPage()

What’s Changed

Changed

  • Textarea: Improve setting width by @mikelorant in #496
  • Textinput: fix out of range panic if no matched suggestions by @rdnt in #473
  • List: Fix no-op list pagination functions by @nekopy in #458
  • Table: Clarify position constant in JoinHorizontal by @aditipatelpro in #577
  • Progress: make full/empty fill characters configurable by @rwinkhart in #409
  • Dependencies: switch to x/ansi for text manipulation by @aymanbagabas in #505

Added

Fixed

  • Table: Render Row Tests by @maaslalani in #487
  • Table: Only render columns with a positive width by @fabio42 in #465
  • Table: Fix inheritence of SelectedStyle in StyleFunc by @gabrielfu in #539
  • Table: Don't include header height in the total table size by @prgres in #434
  • Table: Fix premature viewport scroll by @dzeleniak in #429
  • Textarea: Fix end of buffer character by @mikelorant in #491
  • Textarea: Set textarea default EndOfBufferCharacter to ' ' by @blvrd in #510
  • Textarea: End of Buffer alignment by @maaslalani in #486
  • Textinput: don't block input on validation by @GabrielNagy in #185
  • Viewport: Fix division by zero in scrollpercentage by @zMoooooritz in #494
  • Help: Fix centering by @gabe565 in #516
  • Progress: Stop spring defaults from overriding WithStringOptions by @nervo in #540
  • Cursor: Make SetMode method in cursor library handle invalid mode values correctly by @anirudhaCodes in #477

Test coverage ✅

New Contributors

Full Changelog: v0.18.0...v0.19.0


The Charm logo

Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or on Discord.