Feature: TabbedScrollableSelectPrompt #136
Closed
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 includes all work to implement a new
TabbedScrollableSelectPrompt
.TabbedScrollableSelectPrompt-edit.mov
If you'd like me to extract these into separate PRs, I can do that
The first three commits are structured such that they can be
cherry-picked
and merged as separate work beforehand. They involve the following changes:ESCAPE
,SHIFT_UP
, andSHIFT_DOWN
Keys.DrawsBoxes::pad()
, maintaining backwards compatibility by setting a default of' '
.DrawsBoxes
trait into another dedicatedHandlesStrings
trait which is then consumed by theDrawsTabs
trait to avoid duplicate method name collisions.The new
DrawsTabs
trait could then be merged on it's own. It's built in a similar way to theDrawsScrollbars
trait. It can be used in any new prompts in the same way. This is the feature that ultimately enables the prompt in the example. It will also automatically scroll horizontally based on the selected tab in order to prevent overflowing and ruining the output.Finally, the final 5 commits put all of this together to create our new component. I built this component because I wanted to include some readable context for the items from which I'm selecting. I'm thrilled with this solution, and I'd like to provide it for others to use as well.