Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: TabbedScrollableSelectPrompt #135

Closed

Conversation

ProjektGopher
Copy link
Contributor

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:

  • Adds support for ESCAPE, SHIFT_UP, and SHIFT_DOWN Keys.
  • Adds the ability to specify the character to be used in DrawsBoxes::pad(), maintaining backwards compatibility by setting a default of ' '.
  • Moves three methods for working with strings from the DrawsBoxes trait into another dedicated HandlesStrings trait which is then consumed by the DrawsTabs 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 the DrawsScrollbars 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.

Copy link

Thanks for submitting a PR!

In order to review and merge PRs most efficiently, we require that all PRs grant maintainer edit access before we review them. For information on how to do this, see the relevant GitHub documentation. Additionally, GitHub doesn't allow maintainer permissions from organization accounts. Please resubmit this PR from a personal GitHub account with maintainer permissions enabled.

@github-actions github-actions bot closed this Apr 14, 2024
@ProjektGopher ProjektGopher deleted the feature/tabbedscrollableselect branch May 2, 2024 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant