-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
pulumi new
show additional templates is unusable
#10078
Comments
It looks like like this a problem with the library we use to display choice lists. We should explore choosing a new library or dumping out of interactive mode once a certain number of options is displayed. |
Related, the length of this list causes awful flickering on re-rendering in PowerShell on Windows: |
Is causes flickering on the default terminal on Mac too. |
I have some comments on help output here https://github.com/pulumi/home/pull/2164#discussion_r912160412__ Which is also bad |
@AaronFriel @iwahbe Not sure about the flickering, the other library also had it |
@aq17 I'm OK with changing the prompt library if it flickers less. Could we do a side by side comparison? |
Can we keep the output/coloration identical to the current? |
@AaronFriel @dixler I can work on swapping the library but would we want to change it for all pulumi CLI output, or just for |
@aq17 Have you checked whether it solves the flickering issue for |
@AaronFriel the flickering issue persists even when using this other library , which leads me to believe it might not be a library specific issue... |
The flickering is a fundamental property of most terminal emulators (Including Terminal.app). They can only process so many new writes at once. It can be avoided in some cases by taking full control of the screen and using cursor manipulation instead of rewriting sections. I think the only solution here is to limit the number of templates we list one command. That being said, I'm not opposed to bumping v1 -> v2 if it fixes problems for us. |
Thanks for confirming @iwahbe , I don't believe v1->v2 changes anything of consequence then |
I think to close this out, we should pick a maximum number of templates to display and allow that to be good enough. @dixler I'm worried that the flickering is a bigger UX issue than not showing enough items, it's very distracting on Windows, it's OK in some terminals and worse in others. What do you think is a good # of templates to display, maximum? |
45, but didn't we have terminfo to dynamically determine the terminal height and change the page size to the number of rows in height? Could we put a flag to change the behavior for inefficient terminals/environments that we know of and tweak the number to make the experience less miserable for that edge case? |
I don't think we can reliably know which terms are going to be slow to render - could even depend on what other programs are running, how quick their SSH connection is if remote, etc. 45 seems like a lot, the flickering is proportional to the # of lines (or characters?) written, so rendering 5 options is much snappier than 45. |
Thanks for clarifying. I understood the question as absolute max. We have ~100 templates. It's really about the number of pages that a user will have to page through to find a template. Does 5 result pages(~20 rows) in order to view everything seems like a reasonable goal? Trying to interactively view ~100 templates is really clunky if you're going at 5 results at a time. We could also just remove the selector and reconsider the prompt, BUT there's a lot of recordings and screenshots that depend on this selector display and users say it's unsettling when demos/examples don't match up with their experience.
My suggestion is to leave the UX the same for existing CLI user or users that are in environments that are unaffected and warn that we are running this command users when we're doing this(with a toggle to disable the warning) We can identify known poorly performing terminal environments and handle the poor performers similar to our CI detection. They may run into other performance issues with rendering and it could make sense down the line to be able to use this flag. tl;dr my suggestion is:
|
Perhaps we shouldn't display anything unless a user searches, and hint that they can type a language (csharp, yaml, go...) or a provider (AWS, Azure, ...)? |
I agree that we should bias users towards search. We don't expect you to scroll through all the templates. I'm not confident that we can detect which terminals flicker, detecting terminal environments is quite difficult. |
we could prompt for multiple selectors for prefered language(or none) and then cloud provider(or none) to search/filter the examples. |
I also like that idea @AaronFriel , maybe we could display 10 or so of the most commonly used templates with no further scrolling, and change the prompt to encourage users to search for additional ones |
Could use something like https://github.com/sahilm/fuzzy to display templates and allow interactive selection. |
So afaik, you can type into the prompt for Edit: I use Fzf so I corrected myself. |
Cannot close issue without required labels: |
Closing now as original issue has been resolved – can track flickering in separate issue |
If you select "Show additional templates", you get a super long list, and trying to move the cursor beyond the top one doesn't scroll the screen so you ca't actually see what you're trying to select:
This makes it basically unusable for selecting anything that doesn't fit on the screen.
The text was updated successfully, but these errors were encountered: