zui icon indicating copy to clipboard operation
zui copied to clipboard

"from" pin causes use of "const" to generate a syntax error

Open philrz opened this issue 3 years ago • 2 comments

Repro is with Brim commit cccb040.

A community zync user inquired:

Is there a way to use const <id> = <expr> in Zui?

Of course, Zui is intended to handle any valid syntax, but indeed there's a UX challenge here. The app tries to be helpful by populating a from pin when the user clicks Query Pool, which allows them to start writing searches and aggregations right in the editor. However, if they try to kick off their Zed with something like const, they get a syntax error.

image

If they're hip to what's going on and delete the from pin and put the from in the typed Zed after the const, now it starts to work.

image

It seems that whatever we might do to address this could also relate to #2533.

philrz avatar Oct 13 '22 18:10 philrz

We were brainstorming on this topic as a team today. One idea floated is to introduce a new class of pin intended specifically to hold things like const and type. Let's call it a "Definition Pin".

It would differ from the other kinds of pins we currently have in that:

  1. They could only be placed before all the From, Time Range, and Zed Snippet pins.
  2. The app would would not automatically add | before/after them when constructing the full Zed program.

philrz avatar Nov 22 '22 19:11 philrz

I think the best we can do before the release is to provide a better Error message about the current limitations of Pins.

jameskerr avatar Jan 27 '23 23:01 jameskerr