jlandersen / vscode-kafka

Apache Kafka® extension for Visual Studio Code
MIT License
96 stars 33 forks source link

Use Webview to manage cluster settings #88

Closed angelozerr closed 3 years ago

angelozerr commented 3 years ago

In vscode-kafka, we need to manage UI input forms for :

image

image

To manage that we must use Webview API because vscode doesn't provide some UI forms toolkit (perhaps in the future? see https://github.com/microsoft/vscode/issues/94741).

UI input forms requires databinding between UI and TS model and validation for TS model.

There are several solutions:

@jlandersen @fbricon have you some opinions about that?

fbricon commented 3 years ago

I think either Angular or React would be fine, but I'm not familiar with any of them. However, we can get some help from fellow Red Hatters on react-based webviews if needed, so I'd prolly use that. Unless @jlandersen has a strong preference for another solution.

jlandersen commented 3 years ago

A webview based form would be nice for managing clusters. Personally i'd prefer avoiding bundling up a framework in the extension - well aware it might be a bit awful to work with depending on the complexity.

How do we imagine this will look like? If it is restricted to input cluster address, name and optionally SASL parameters then I would imagine this being managable.

fbricon commented 3 years ago

We'll also need to handle SSL configuration: selecting CA, CE, Perm files. If we add JAAS config, and open up the cluster config to 3rd party extensions (providing AWS, confluent or red hat specific options) the simple wizard workflow doesn't scale. No framework means data binding is going to be a headache

angelozerr commented 3 years ago

Personally i'd prefer avoiding bundling up a framework in the extension

I understand your fear, but IMHO I think it will simplify the code for databinding, validation support and when we will need complex UI (ex : list of items with add/remove item).

Using react in vscode is not an experimentation because:

jlandersen commented 3 years ago

Personally i'd prefer avoiding bundling up a framework in the extension

I understand your fear, but IMHO I think it will simplify the code for databinding, validation support and when we will need complex UI (ex : list of items with add/remove item).

Using react in vscode is not an experimentation because:

* vscode-sqltools is a great sample

* Red Hat have skills about using react in vscode (see https://github.com/redhat-developer/vscode-openshift-tools for instance).

Thanks for the links - I looked over them and it seems manageable and I recognize we can utilize this for other things than just clusters in the future (like creating a consumer we discussed in #69). Aside from vanilla JS/HTML I do prefer react and worked with it plenty of times, so let's move forward with that.

angelozerr commented 3 years ago

Aside from vanilla JS/HTML I do prefer react and worked with it plenty of times, so let's move forward with that.

Great!

I will work on this.

fbricon commented 3 years ago

Here's the latest UI

Screenshot 2021-07-06 at 19 44 16

Still room for improvement, but we'll take care of that in later PRs