-
Notifications
You must be signed in to change notification settings - Fork 358
Conversation
Support different behavior after a validation error in repeated prompts. Signed-off-by: Mate Ory <mate.ory@banzaicloud.com>
Recall the previous invalid input in the repeated prompt so the user doesn't have to start over typing the answer. Signed-off-by: Mate Ory <mate.ory@banzaicloud.com>
Hello @AlecAivazis, could you please check this PR? |
Hey @orymate - sorry for lagging a bit on this. I think this makes sense. Forcing the user to re-enter something they were just working on seems like a bad user experience. Overall, the code looks fine. Would you mind adding a test for this? |
Hello, |
Thanks for adding that - it looks like you changed an existing test to cover your needs which makes it hard to track test failures (since the test is really testing 2 different things). Could you move the test into another test case? |
Added separate test. |
@AlecAivazis, can I do anything more to have this merged? |
Hey @orymate! I tried to add a test that would showcase the behavior to |
@AlecAivazis, I added the manual test code |
Awesome! Thanks for adding that - worked like a charm. |
* survey: pass previous invalid value to Prompt Support different behavior after a validation error in repeated prompts. Signed-off-by: Mate Ory <mate.ory@banzaicloud.com> * editor: recall previous invalid input Recall the previous invalid input in the repeated prompt so the user doesn't have to start over typing the answer. Signed-off-by: Mate Ory <mate.ory@banzaicloud.com> * survey_test: check recalling invalid Editor input * tests: add prompt-again editor manual test
Recall the previous invalid input in the repeated Editor prompt so the user doesn't have to start over typing a long answer (for example a json structure).
Add optional PromptAgain method to Prompts to back this.