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

Add multiple select (WIP need to refresh content) #4

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

BarnabeD
Copy link

This PR add multi-select option with multiple: true option on SelectPrompt.

Need attention :

  • I don't fully understand the Render class, with the stack_frame and slots. On each response, @content.reset! is called in the loop, but the prepare_content in SelectPrompt isn't recall to update the selected/unselected state of each option.
  • Other point requiring validation : the symbol for unselected options. I don't like it too much.

@fractaledmind
Copy link
Owner

Yes, the current implementation is not amenable to this feature yet, and a refactor will be needed.

The current implementation treats screen as mostly static with only the bottom few lines ("slots") as dynamic. So, prepare_content sets up the initial, static slots and the loop in ask simply reprints the static lines and then recomputes and rerenders the later dynamic slots. We will need to make the render loop take into account all slots. This will be a larger refactor, but will open up many new possibilities. You can take a stab at it if you'd like. I won't be able to focus on this until after RubyConf in November.

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.

2 participants