prql icon indicating copy to clipboard operation
prql copied to clipboard

feat(playground): add new query button

Open hulxv opened this issue 1 year ago • 8 comments

Preview

InShot_20240125_180706597

Close #3631

hulxv avatar Jan 25 '24 16:01 hulxv

Thanks — I think this sort of thing is good.

Rather than interrupting the flow with a popup asking for a query name, how about a button for "Clear query" which clears the query and sets the name to new-N.prql, where N is a number that works.

"Clear query" (or something similar) also is clear that it's a destructive event — I can imagine clicking "New query" and not realizing my existing query is about to be deleted if I hadn't saved it...

max-sixty avatar Jan 26 '24 01:01 max-sixty

Rather than interrupting the flow with a popup asking for a query name, how about a button for "Clear query" which clears the query and sets the name to new-N.prql, where N is a number that works.

"Clear query" (or something similar) also is clear that it's a destructive event — I can imagine clicking "New query" and not realizing my existing query is about to be deleted if I hadn't saved it...

What about saving the query before clearing the query and notifying the user before that? I think it's a better experience for the user

hulxv avatar Jan 26 '24 21:01 hulxv

What about saving the query before clearing the query and notifying the user before that? I think it's a better experience for the user

I don't think we want to get in the way of the user — so we don't want a box popping up asking "Do you want to save??" — instead if the button's actions are obvious, the user can decide whether to save before clicking the button.

So I do think that "Clear query" is better than "New query" in that regard...

max-sixty avatar Jan 27 '24 01:01 max-sixty

I'm sorry for the late response. I'm away from my machine these days. So I hope you'll excuse me.

Anyway. Is "Clear query" really useful? I don't know why we would just put a button to remove queries only. The user can use ctrl + a then click backspace and all is done. But, The "New Query" button doesn't remove queries only. It's something like creating a new file. In future, We can add something like taps to switch between files to improve the user experience.

hulxv avatar Feb 01 '24 20:02 hulxv

Is "Clear query" really useful?

I think it's somewhat useful... :)

Isn't "Clear query" + "Rename" the same as "New Query"?

Minimum surprise is important — and the current "New Query" clears the existing query, which might be surprising...

max-sixty avatar Feb 02 '24 04:02 max-sixty

Isn't "Clear query" + "Rename" the same as "New Query"?

Technically, yes. but the difference is that New Query will be useful if we add taps so that the user can switch between them.

Minimum surprise is important — and the current "New Query" clears the existing query, which might be surprising...

To avoid that, I think we should work on taps

hulxv avatar Feb 03 '24 18:02 hulxv

Yes, tabs could be good!

(It does seem like a much bigger project, though...)

max-sixty avatar Feb 06 '24 18:02 max-sixty

(It does seem like a much bigger project, though...)

Yeah sure. Next week, I will try to work on it and maybe cancel this PR

hulxv avatar Feb 07 '24 16:02 hulxv