Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(playground): add new query button #4135

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

hulxv
Copy link
Contributor

@hulxv hulxv commented Jan 25, 2024

Preview

InShot_20240125_180706597

Close #3631

@hulxv hulxv force-pushed the playground-new-query-btn branch from 71e404d to 7eb2755 Compare January 25, 2024 16:14
@max-sixty
Copy link
Member

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...

@hulxv
Copy link
Contributor Author

hulxv commented Jan 26, 2024

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

@max-sixty
Copy link
Member

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...

@hulxv
Copy link
Contributor Author

hulxv commented Feb 1, 2024

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.

@max-sixty
Copy link
Member

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...

@hulxv
Copy link
Contributor Author

hulxv commented Feb 3, 2024

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

@max-sixty
Copy link
Member

Yes, tabs could be good!

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

@hulxv
Copy link
Contributor Author

hulxv commented Feb 7, 2024

(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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

playground could have a "blank" template as well
2 participants