tilt
tilt copied to clipboard
Feature Request: dropdown / choice input for cmd_button
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.
I like this request! I'm going to move this to the main repo.
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:
- Updating the button spec: https://github.com/tilt-dev/tilt/blob/master/pkg/apis/core/v1alpha1/uibutton_types.go
- Running
make update-codegento generate all the new APIs from the button spec - Interpreting that spec in the React component: https://github.com/tilt-dev/tilt/blob/master/web/src/ApiButton.tsx
@nicks Thanks, that was super helpful, and was definitely enough direction for me to hack together a PR!