elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.63k stars 8.22k forks source link

[Canvas] Expression Editor/Autocomplete Improvements #51514

Closed cqliu1 closed 1 year ago

cqliu1 commented 4 years ago

Switching to using the Monaco editor has vastly improvement the UX around editing expressions in the Canvas. There are a few additional improvements I'd like for us to consider/implement.

Expression editor

Autocomplete

Syntax highlighting

elasticmachine commented 4 years ago

Pinging @elastic/kibana-canvas (Team:Canvas)

poffdeluxe commented 4 years ago

Adding a line item to fix the proper sorting issue that Wylie found. Functions are sorted by the autocomplete lib to display functions that expect the previous functions return type. Args and arg values also have some sorting logic from autocomplete lib. By default, Monaco will sort results alphabetically by the suggestion label unless you pass in a value to sortText (https://microsoft.github.io/monaco-editor/api/interfaces/monaco.languages.completionitem.html#sorttext)

wylieconlon commented 4 years ago

I found some other issues that I am hacking on a solution for:

poffdeluxe commented 4 years ago

@cqliu1 Interested in your perspective on Wylie's last point regarding the filtering. Obviously there can be a ton of results returned for suggestions but would filtering and hiding functions/args hamper someone's expression dev flow?

timductive commented 4 years ago

Example of the autocomplete being used due to whitelist issue: https://discuss.elastic.co/t/visualizations-functions-in-canvas/214909/2

ThomThomson commented 1 year ago

Closing this for now. If we prioritize the usability of expressions in the Canvas editing capabilities in the future we can re-open.