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
selectionprompt were not correctly re-drawn. - Improved performance for
selectionprompts 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 inChoiceobjects anymore and now the actual value of the the selected choice is returned. Migration instructions can be found below.selection: A new option calledLoopCursorwas 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.Modelnow 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
FilterorSelectedChoiceStylenow 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: Thetextinputprompt 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: TheValidatefunction 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 customValidatefunction. Thank you @fiws for this feature.- The default wrap mode is now the new
Truncatemode because of weird ANSI color glitches that can occur with theWordWrapmode 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
MaxWidthoptions 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.