-
Notifications
You must be signed in to change notification settings - Fork 14k
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
SQL Lab editor shortcuts override other common shortcuts #9990
Comments
Issue-Label Bot is automatically applying the label Links: app homepage, dashboard and code for this bot. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue |
Do not close, please |
Related: #12429 |
@john-bodley My instinct would be yes, as it can be quite annoying. @betodealmeida @eschutho any thoughts here? |
@yousoph has done some investigation into this and we've made some small changes, but yes, they shouldn't conflict. |
Seeing this on Superset 1.4.2 with both Firefox 98.0.2 and Chromium 100.0.4896.60 on Linux/Gnome. Ctrl+X and Ctrl+F shortcuts are silently ignored. Repro steps are straightforward:
To be honest I wonder if this is only affecting a small subset of users because the lack of a cut shortcut in particular makes the in-Superset SQL editor fairly unusable for me. As such I'd have expected more noise on this issue if it were more widespread. I've gotten to where I just do my primary editing in a separate text editor, since the ability to cut text comes up pretty often for me when constructing a query. My RSI is bad enough without needing to right-click to cut text. |
It looks like the source of the problem is that Ctrl+X is being overridden to instead be "stop query": superset/superset-frontend/src/SqlLab/components/SqlEditor/index.jsx Lines 344 to 347 in 02ef9ca
I think it'd make sense to just pick a different shortcut for that so that cutting text isn't broken in the editor. Alt+X is available? Unrelated to this issue, but there's a similar override for Ctrl+R in the same file that conflicts with the common browser shortcut for reloading the page: superset/superset-frontend/src/SqlLab/components/SqlEditor/index.jsx Lines 312 to 319 in 02ef9ca
I don't see the override that's breaking Ctrl+F in there, it might be in a different component. |
Talked with someone else about this issue and they hadn't had any problems because they're using Superset on a Mac. So Cmd+X to cut for example works fine for them, but anyone on Windows or Linux is probably seeing this problem. |
I've figured out a quick hack that fixes The example provided here just switches the errant
After restarting the Superset container/process to have the above edit, and then reloading the frontend in my browser (Ctrl+Shift+R to ensure the static assets are redownloaded), cutting/pasting text is no longer broken in the SQL Lab editor on Linux/Windows. It might be possible to do something similar to unbreak other standard shortcuts as desired. For me specifically, getting cut/paste functionality unbroken quickly was important for my own sanity. I imagine I'm not the only one so hopefully this is helpful for anyone else who's been encountering the issue over the last several months. |
Thank you for the finding this issue. We've done some workarounds for shortcuts in Windows vs Mac, and I agree that this is an important shortcut for Windows users. @yousoph do you think someone can look into this? |
⌘ + return makes sense to me for run query If we move Mac shortcuts from Ctrl to ⌘, I think the shortcuts that would conflict are:
Would it make sense to add ⌘ shortcuts onto the existing Ctrl ones for Mac? ie for Run query, users could use ⌘ + return or Ctrl + return and for new tab, users could use Ctrl + t or ⌘ + q? |
I'd opt for introducing new shortcuts while keeping the old ones working. As long as the old shortcuts don't conflict in any way, it does not harm keeping them. And users will be happy, as they don't need to change habits and muscle memory. |
Per above, standard shortcuts like |
I am closing this for now as it seems that most issues have been resolved. Contributions are welcome to iterate on these controls more if necessary. Thanks all! |
The keyboard shortcuts in the "SQL Editor" view cause issues while editing because they override common text editing and browser shortcut conventions. I've had issues with them in Chromium and Firefox on Linux, and a colleague has had issues in Safari on a mac as well as well.
On Chrome:
Control-X is usually "cut" in a text box, in the editor it has been overridden to stop the query.
Control-F (find) is overridden and I have no idea what it was changed to (I don't see it documented)
Also, the "Keyboard Shortcuts" widget says that Control-T should open a new query tab but it actually opens a new browser tab so whatever override is attempted there doesn't work - but overriding standard browser shortcuts doesn't seem great so I would argue this is a feature, not a bug.
On Safari:
On safari Cmd-X still works for "cut" so presumably the shortcuts treat control and command differently. Cmd-F (find) is still broken.
Just for completeness the following work as expected:
Control-C (copy), Control-V (paste), Control-Z (undo), Control-Y (redo), Control-A (select all), Control-/ (comment code)
Suggested Fix
Any of the following would be good:
Server Environment
Superset 0.36.0
Python 3.6.9
Flask 1.1.2
Werkzeug 1.0.1
Browser
Chromium on Linux, Version 83.0.4103.61
Checklist
The text was updated successfully, but these errors were encountered: