framework icon indicating copy to clipboard operation
framework copied to clipboard

Don't use a select widget to select from >10 projects

Open mythmon opened this issue 1 year ago • 4 comments
trafficstars

This should help when deploying projects to workspaces with many projects.

mythmon avatar Jun 28 '24 20:06 mythmon

Can I see a screenshot of what this looks like?

mbostock avatar Jun 29 '24 13:06 mbostock

first step second step
first-step screenshot

I'm not sure we need to list all the names like this, as the list might expand into the hundreds or thousands. If we do list them, they should be ordered alphabetically.

Fil avatar Jun 30 '24 11:06 Fil

This PR allowed me to redeploy a project, so fixes the issue I had. 👍

Fil avatar Jun 30 '24 11:06 Fil

The UI that I'd really like to have (for both cases) would show a partial list, and allow filtering it by typing. Then once you've narrowed it down you could use arrow keys to select one. Sort of like fzf.

Given that we require them to type a valid slug, I wanted some way to convey the available options. I agree that this version of the UI definitely isn't very elegant in that regard. Maybe we could print the URL to the workspace's project listing instead?

Sorting them would be a good improvement. If we want to keep the list in the CLI, I'll add that.

mythmon avatar Jul 01 '24 17:07 mythmon

I just noticed this appears to be fixed in the top-of-trunk version of clack, but that version has not yet been published to npm?

https://github.com/bombshell-dev/clack/pull/174

But despite not happening automatically, it looks like in the latest released version we are using, it can be set manually, so maybe we should just set it to Math.max(process.stdout.rows - 4, 0) as above?

https://github.com/bombshell-dev/clack/releases/tag/%40clack%2Fprompts%400.7.0

mbostock avatar Aug 28 '24 19:08 mbostock

Thanks for the review! I didn't realize that was a built-in Clack option. It might take me a little bit to get back to this though.

mythmon avatar Aug 28 '24 19:08 mythmon

All good @mythmon. I put up #1618 and if you don’t have time, hopefully @Fil can review.

mbostock avatar Aug 28 '24 20:08 mbostock

Closing in favor of #1618

mythmon avatar Aug 28 '24 22:08 mythmon