Closed stratoula closed 1 week ago
Pinging @elastic/kibana-esql (Team:ESQL)
I understand the need but not why Monaco's default doesn't cover it.
We can already label each option on the right and change the icon on the left...
@drewdaemon yes, but what if we want a different more compolicated UI? This is the investigation we want to do. What capabilities do we have? Can I have something fancier?
@stratoula sounds good. I just read
We don't want to suggest only indices but also integrations, datastreams etc.
and looked at the wireframe and I think the default can cover these cases.
Still, I see value in this investigation as a way to stake out the boundaries of the possible 👍
One quite hacky PoC from Joe https://github.com/elastic/kibana/pull/181112
Another hack could be to combine the suggestion api with the commands API:
So I investigated the different options we have with the monaco editor:
This is using on one hand the commands api to create naturally a new option in the autocomplete but unfortunately the popover should be created by hand. Also:
Note: I also investigated the overlay widget idea from Marco but widgets are not what we want. They don't act as popovers, they are overlays inside the editor so I could not make them work as we want.
SHIFT + /
to be certain that we are not interfering with user typing a queryThe 1 and 2 and 4 ideas can be seen here. They are not working prototypes, they are just the result of my research. The second approach will need additional work to make it work smoothly and bug free. The 4th is a bit cleaner and I personally like it as an idea. I also like 1 too. The 2nd and 3rd are very dirty and we need to interfere with monaco events so they are def more prune to bugs and need a lot of love.
The options above are mostly exploring how to open the custom popover. This is part of the problem, the other part is how the users is interacting with the popover, which is probably also worth some thinking.
Some considerations:
Another angle to the whole problem - can we enumerate all the features we want/need? As @drewdaemon is mentioning, you can do things like custom icons, maybe we can get by with that already?
Great discussion and research going on here.
As @drewdaemon is mentioning, you can do things like custom icons, maybe we can get by with that already?
Unfortunately, I have to throw a bit of water on my own party. I took a second look, and I don't think Monaco facilitates custom icons. Instead, it chooses from a set a predefined icons based on the kind
property (doc). Not sure if it could be hacked... (doesn't look like they're going to change this: https://github.com/microsoft/monaco-editor/issues/2654).
However, we can definitely write custom labels and descriptions for each entry which could associate datasets with integrations for example.
https://github.com/elastic/kibana/assets/315764/f8d43b2d-ddc0-484b-990b-ef500e269ede
The little documentation popover accepts markdown, so we can put a lot of formatted information in there.
Thanx Drew, it is ok. It doesnt seem we are going that way so this limitation is not so important atm
I am closing this as we investigated the things we wanted to work on with @ryankeairns and now we can move forward to the design and actual implementation. Here is the PR which all the experiments https://github.com/elastic/kibana/pull/183377
Describe the feature:
At the moment when we are suggesting indices we use the suggestions UI of the monaco api.
We want to make this component a bit more complicated. We don't want to suggest only indices but also integrations, datastreams etc.
We need somehow to make this distinction in the UI which means that the current UI of the monaco api needs to change.
Below is an idea:
The ideal scenario would be to be able to render our own UI component for the from command suggestions.
If this is not possible we could possibly define different icons to the different options and possibly different styling (?)
The purpose of this issue is to investigate the various options in order to make a decision forward.
Next steps: