bitfocus / companion

Bitfocus Companion enables the reasonably priced Elgato Streamdeck and other controllers to be a professional shotbox surface for an increasing amount of different presentation switchers, video playback software and broadcast equipment.
http://bitfocus.io/companion
Other
1.46k stars 489 forks source link

Update value of static-text fields in actions and feedbacks via learn callback #2888

Closed phillipivan closed 3 weeks ago

phillipivan commented 4 weeks ago

Is this a feature relevant to companion itself, and not a module?

Is there an existing issue for this?

Describe the feature

I have some feedbacks where I would use a static text field to return some information to the user about the selected options. However returning a value to a static-text field does not work. I can do this via a textinput field, however this presents a confusing user experience, where an input field is not used for an input at all.

Thinking about this, it would probably be better to be able to do this via the subscribe callback so it is updated automatically, but that is much further from existing companion workflows.

Usecases

Returning contextual information to the user based on the selected options of an action or feedback, such as names associated with certain parameter selections.

dnmeid commented 3 weeks ago

There are already two aproaches for it:

  1. If you want to show context sensitive information which is not completely unknown in advance but is some text of a predefined set of texts, you can use the isVisible function with static-text. Then you can dynamically change which text is shown.
  2. If you need complete control of the text shown, you can simply update it and push action/feedback definitions again. This can even be done from learn callback or from subscribe or based upon data received even without user interaction.
Julusian commented 3 weeks ago

I would be open to having a way or a variant of static-text thag can render an expression. Not with support for variables, just the options object

@dnmeid i can see some value in this, to show a message which is variable depending on the selected options. Maybe it could often be achievable with isVisible, but I csn imagine that sometimes that will lead to tens or maybe hundreds of almost always hidden fields

Your option 2 doesn't really work, as different uses of an action could have different options so should show different messages

dnmeid commented 3 weeks ago

I'm also open for more dynamic control of action/feedback/config/... definitions. Especially updating only parts and not everything. With my option 2 I assume, that all usages of an action have the same options, so all should give the same hint for a given combination of options. So basically it is again a lot of isVisibles but with an update of the text whenever you change the options. I think this is a frontend problem and should not be solved in backend.

phillipivan commented 3 weeks ago

Neither of the proposed solutions would work in this case. For the following reasons:

(A) I cannot reliably know the answer ahead of time - a query is made of a cloud service during the learn callback.

(B) if I could / did, there would likely be an impractical number for isVisible (100s or 1000s in a bigger system).

(C) Since the answer is dependent on other options configured in the action, returning the same static-text value to all instances of an action would be nonsensical.

I will persist returning the name to a textinput field, but I think this is a backend limitation and a suboptimal solution for the user.