You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Kind of related to #624 but looking to discuss what would be acceptable to add here.
Currently SelectionPrompt and MultiSelectionPrompt are cleared from the console buffer once a selection is made. When going through a number of prompts it would be quite useful to be able to maintain the choices selected on screen.
Currently this is doable but it means having to write out the title and answer after each prompt, for the simple case where you know it's just single prompts and strings a helper method that does the following is ok:
var answer = console.Prompt(prompt);
console.Write(prompt.Title + " ");
console.WriteLine(answer, new Style(foreground: Color.Blue));
But it's kinda brittle to keep it in sync with if Titles are set or not, if Titles have markdown embedded or not, if HighlightColor is set, if values aren't plain strings, etc. It would be good to have something built in to deal with all those complexities rather than it spilling out to app code.
For SelectionPrompt I could see three "modes" of what to do for when a selection is made.
The current behavior, just clear the prompt.
Simply not clearing the prompt after the selection. The set of prompts would stay on screen and the selected prompt would stay highlighted and the cursor would just re-show under the prompt.
Clear the selection prompt, but then re-print the title and selected answer using the highlight style. I expect that to look something like:
I think that might also make sense for MultiSelectionPrompt, but how to print a list of results is probably something people would more configuration control over, and the selected items might not be on the current page making option 2 a bit odd. So I think it might be best to just add this to SelectionPrompt to start.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Kind of related to #624 but looking to discuss what would be acceptable to add here.
Currently
SelectionPrompt
andMultiSelectionPrompt
are cleared from the console buffer once a selection is made. When going through a number of prompts it would be quite useful to be able to maintain the choices selected on screen.Currently this is doable but it means having to write out the title and answer after each prompt, for the simple case where you know it's just single prompts and strings a helper method that does the following is ok:
But it's kinda brittle to keep it in sync with if Titles are set or not, if Titles have markdown embedded or not, if HighlightColor is set, if values aren't plain strings, etc. It would be good to have something built in to deal with all those complexities rather than it spilling out to app code.
For
SelectionPrompt
I could see three "modes" of what to do for when a selection is made.I think that might also make sense for
MultiSelectionPrompt
, but how to print a list of results is probably something people would more configuration control over, and the selected items might not be on the current page making option 2 a bit odd. So I think it might be best to just add this toSelectionPrompt
to start.Beta Was this translation helpful? Give feedback.
All reactions