Releases: erikgeiser/promptkit
v0.9.0
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
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 inChoice
objects anymore and now the actual value of the the selected choice is returned. Migration instructions can be found below.selection
: A new option calledLoopCursor
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 withModel.Value()
andModel.ValueAsChoice()
.- Some of the function properties of the selection prompt such as
Filter
orSelectedChoiceStyle
now have a slightly different signature. Take a look at the custom selection example in which these properties are used.
v0.7.0
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
: Thetextinput
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
: TheValidate
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 customValidate
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 theWordWrap
mode selection
: The page size is now automatically adjusted to fit the terminal size if necessary
v0.6.0
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
- 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
- Fix alternative confirmation template
- Update bubbletea
- Cleaner error messages
v0.3.0
- 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
- 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
The initial release of promptkit
featuring a selection prompt and a text input.