bluerobotics / cockpit

An intuitive and customizable cross-platform ground control station for remote vehicles of all types.
https://blueos.cloud/cockpit/docs
Other
72 stars 22 forks source link

Very generic input: Custom widget creator #1418

Open ArturoManzoli opened 1 month ago

ArturoManzoli commented 1 month ago

Widget creation toolkit for parametric inputs and control via HTTP requests;

https://github.com/user-attachments/assets/0cacb58a-c908-4c26-bb13-ee149be29fe9

https://github.com/user-attachments/assets/16374de6-8f34-4763-89e7-68f404421968

Closes #1291

ArturoManzoli commented 1 month ago

Last push: Fix dropdown selector not keeping last selected option after reload

ArturoManzoli commented 3 weeks ago

Question: should we indeed separate the whole pipeline for the custom widgets from the mini-widgets?

I understand having them on a separate dropdown on the edit-menu, to make it easier for the user to understand, but I couldn't see a good reason to separate their container from the mini-widgets. Being able to mix them feels like a big feature to me, and if we separate them now, it will be difficult to merge them later.

Totally agree. Allowing the user to add custom mini-widgets to the top, bottom bar and to any other future uses for mini widgets will indeed make Cockpit a lot more powerful.

ArturoManzoli commented 3 weeks ago

4. Should we have this as a button? Is there any other usage that is not tied to a Cockpit Action Variable?

Can you give more info about it? Maybe an example of another usage so we decide if we should implement now or on the next functionalities update

ArturoManzoli commented 3 weeks ago

On last push:

https://github.com/user-attachments/assets/4511e91d-7fa5-4504-a811-5bfdc0a238c2

rafaellehmkuhl commented 3 weeks ago
  1. Should we have this as a button? Is there any other usage that is not tied to a Cockpit Action Variable?

Can you give more info about it? Maybe an example of another usage so we decide if we should implement now or on the next functionalities update

My point is that all input widgets are being created to inject variables in the data-lake, and having a button there means creating this variable is optional, when it's in fact mandatory. Those should be required fields.

rafaellehmkuhl commented 3 weeks ago

I'm not able to config the input widgets with the last PR. It was working fine in the previous version thought:

https://github.com/user-attachments/assets/62e4dc7c-a4da-4738-8806-456332689136

ArturoManzoli commented 3 weeks ago

I'm not able to config the input widgets with the last PR. It was working fine in the previous version thought:

This is something related to the instantiation of the input widget on the top and bottom bar. If you refresh the screen the config panel will open normally.

Will fix that

ArturoManzoli commented 3 weeks ago
  1. Should we have this as a button? Is there any other usage that is not tied to a Cockpit Action Variable?

Can you give more info about it? Maybe an example of another usage so we decide if we should implement now or on the next functionalities update

My point is that all input widgets are being created to inject variables in the data-lake, and having a button there means creating this variable is optional, when it's in fact mandatory. Those should be required fields.

I understand you point that the variable name is mandatory to inject data, but if the user is, at the moment, just creating the custom widget and arranging its layout? Maybe it doesn't need to be named/registered at that very moment, and the user (or even someone else) can do this data injection config on a later moment.

The blue 'create' button was thought the be spotted right away by the user and probably wont be missed out. Also, the whole process for controlling something by the input widgets will usually need some documentation reading/video tutorial for the user to fully understand its applications and usage. So, the variable creation will be something internalized by the user, I suppose.

Also, every variable injected on the data lake will take a small amount of system resources to be kept tracked or on listening mode.

Let me know your thoughts about this.

Anyway, I modified the workflow, so when an input widget is placed on the top or bottom bar, its config panel will always pop out. This way, the user will be 'invited' to configure its proprieties right away

rafaellehmkuhl commented 2 weeks ago

@ArturoManzoli it does make sense!

rafaellehmkuhl commented 1 week ago

We discussed in private and came to the conclusion that there was a missing function in the data-lake for those to work as expected. The ability to set the initial value was implemented on #1443 and will be used here.

ArturoManzoli commented 1 week ago

We discussed in private and came to the conclusion that there was a missing function in the data-lake for those to work as expected. The ability to set the initial value was implemented on #1443 and will be used here.

The modifications on the data-lake and input mini widgets are implemented. Take a look

ArturoManzoli commented 1 day ago

@rafaellehmkuhl, I had to relocate the lastValue storage location out of the mini-widget data object due to reactivity problems on some boolean vuetify components. Its working fast and reliable as I tested. Take a look and see if we need to store those values somewhere else.

rafaellehmkuhl commented 17 hours ago

@rafaellehmkuhl, I had to relocate the lastValue storage location out of the mini-widget data object due to reactivity problems on some boolean vuetify components. Its working fast and reliable as I tested. Take a look and see if we need to store those values somewhere else.

I feel like those changes are passing a lot of the responsibility that should be in the widgets themselves to the widget management store, but at the same time I don't want to postpone the merging of this feature much more.

I will perform some more tests to see if everything is working and take a look at the code again, and if everything goes right we are good to go.