tilt icon indicating copy to clipboard operation
tilt copied to clipboard

Feature Request: dropdown / choice input for cmd_button

Open jbadlato opened this issue 3 years ago • 3 comments

text_input gives us unlimited options, and bool_input give us the choice between two options, but it would be nice to have something in between. For my use case, I want to give the user a list of supported values in a dropdown selection.

I tried to see if this would be something easy to extend myself, but it looks pretty involved? May be interested in giving it a try if I'm wrong though.

jbadlato avatar Jul 20 '22 17:07 jbadlato

I like this request! I'm going to move this to the main repo.

nicks avatar Jul 22 '22 03:07 nicks

This might be a good external contributor issue, TBH. Maybe not a FIRST contributor issue (it touches a lot), but it's basically adding new fields to existing wiring. Here's a sample PR: https://github.com/tilt-dev/tilt/pull/4893

Don't be put off by the large diff! It's mostly generated code. The important bits are:

  1. Updating the button spec: https://github.com/tilt-dev/tilt/blob/master/pkg/apis/core/v1alpha1/uibutton_types.go
  2. Running make update-codegen to generate all the new APIs from the button spec
  3. Interpreting that spec in the React component: https://github.com/tilt-dev/tilt/blob/master/web/src/ApiButton.tsx

nicks avatar Jul 22 '22 03:07 nicks

@nicks Thanks, that was super helpful, and was definitely enough direction for me to hack together a PR!

jbadlato avatar Jul 22 '22 22:07 jbadlato