Skip to content

Releases: erikgeiser/promptkit

v0.9.0

08 Aug 19:04
Compare
Choose a tag to compare

This is just a small update with some bug fixes for the selection prompt and updated dependencies.

Changelog:

  • Fixed an issue where parts of a selection prompt were not correctly re-drawn.
  • Improved performance for selection prompts with a large number of options.
  • Improved compatibility with newer https://github.com/charmbracelet/bubbletea versions.
  • Updated dependencies.

v0.8.0

13 Jan 20:01
Compare
Choose a tag to compare

As mentioned before, v0.8.0 introduces a breaking change by rewriting the selection prompt to use generics, but there are also a few other changes.

Changelog:

  • selection: The selection prompt now utilizes generics such that the choices don't have to be wrapped in Choice objects anymore and now the actual value of the the selected choice is returned. Migration instructions can be found below.
  • selection: A new option called LoopCursor was added. If enabled, the cursor now jumps to the top when pressing 'down' on the last entry and the other way around. See the custom selection prompt example for information on how to use it.
  • Fixed an issue where the wrong color profile was applied.
  • All dependencies were updated.

Migration:

  • When creating the selection prompt, instead of wrapping the choices like this
// before
selection.New("What do you pick?", selection.Choices([]string{"Horse", "Car", "Plane", "Bike"}))

they are now passed directly like this:

// now
selection.New("What do you pick?", []string{"Horse", "Car", "Plane", "Bike"})
  • The result is now directly returned, so instead of unwrapping the value from the choice object like this
// before
selected, err := sp.RunPrompt()
fmt.Println(selected.Value)

It can now be directly used instead:

// now
selected, err := sp.RunPrompt()
fmt.Println(selected)

  • selection.Model now can return both the selected choice in wrapped and unwrapped from with Model.Value() and Model.ValueAsChoice().
  • Some of the function properties of the selection prompt such as Filter or SelectedChoiceStyle now have a slightly different signature. Take a look at the custom selection example in which these properties are used.

v0.7.0

21 Jun 19:41
Compare
Choose a tag to compare

This version introduces some new features and improvements but also a few minor breaking changes. As stated in the README, this is to be expected until the release of version v1.0.0. Stay tuned for the next version, which will likely make use of generics for the selection prompt. Keep in mind that the library will require Go 1.18 from then on.

Changelog:

  • textinput: The textinput prompt now supports auto-competion. The auto-competion candidates can optionally be displayed in a custom template, see the custom textinput example for more information.
  • textinput: The Validate function now returns an error that can be displayed to the enduser to provide further information about the validation failure, see the custom textinput example for more information. This is a breaking change for users that already use a custom Validate function. Thank you @fiws for this feature.
  • The default wrap mode is now the new Truncate mode because of weird ANSI color glitches that can occur with the WordWrap mode
  • selection: The page size is now automatically adjusted to fit the terminal size if necessary

v0.6.0

28 Sep 19:13
Compare
Choose a tag to compare

This release does not change anything in promptkit but includes the updated bubbletea library that does not require a replace rule anymore. See https://github.com/charmbracelet/bubbletea/releases/tag/v0.16.0 for more information.

v0.5.0

08 Sep 18:38
Compare
Choose a tag to compare
  • Configurable wrap mode
  • MaxWidth options for use as a bubbletea model
  • Custom choice styles
  • Configurable color profile
  • Fix key map inconsistencies
  • More fitting property names

v0.4.0

11 Aug 05:51
Compare
Choose a tag to compare
  • Fix alternative confirmation template
  • Update bubbletea
  • Cleaner error messages

v0.3.0

08 Aug 19:09
Compare
Choose a tag to compare
  • Confirmation constructor now takes default value as argument
  • Unit tests
  • Fix missing input events when running multiple prompts sequentially
  • Selection: Rename .Choice() to .Value() for consistency

v0.2.0

01 Aug 15:03
Compare
Choose a tag to compare
  • Added a confirmation prompt
  • A lot of refactoring
  • Support for custom output writer and input reader
  • Support for custom template functions
  • Bug fixes

v0.1.0

30 Jul 19:40
Compare
Choose a tag to compare

The initial release of promptkit featuring a selection prompt and a text input.