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

chore(sqllab): Add shortcuts for switching tabs #30173

Merged

Conversation

justinpark
Copy link
Member

SUMMARY

This commit adds keyboard shortcuts (ctrl + [ and ctrl + ]) for switching SQL editor tabs.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

shortcut-switching-tabs.mov

TESTING INSTRUCTIONS

Go to SQL Lab and hit ctrl + [ and ctrl + ] for testing

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@dosubot dosubot bot added change:frontend Requires changing the frontend sqllab Namespace | Anything related to the SQL Lab labels Sep 6, 2024
@@ -51,6 +53,8 @@ export const KEY_MAP = {
[KeyboardShortcut.CtrlT]: userOS !== 'Windows' ? t('New tab') : undefined,
[KeyboardShortcut.CtrlP]: t('Previous Line'),
[KeyboardShortcut.CtrlShiftF]: t('Format SQL'),
[KeyboardShortcut.CtrlLeft]: t('Switch to the previous tab'),
[KeyboardShortcut.CtrlRight]: t('Switch to the next tab'),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed for this PR, but do you think it's worth adding a section somewhere on the docs site about keyboard shortcuts?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: The key mapping on this section has been implemented to be automatically added to the Keyboard Shortcut menu.
Screenshot 2024-09-06 at 10 24 31 AM

@michael-s-molina
Copy link
Member

michael-s-molina commented Sep 6, 2024

@eschutho mentioned that need to check if this is overriding a browser shortcut.

@eschutho
Copy link
Member

eschutho commented Sep 7, 2024

/testenv up

Copy link
Contributor

github-actions bot commented Sep 7, 2024

@eschutho Ephemeral environment spinning up at http://52.32.124.90:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

@eschutho
Copy link
Member

eschutho commented Sep 7, 2024

@fisjac tested in a windows machine and it looks fine. "for windows it's alt + left/right arrows to navigate history"

@justinpark justinpark merged commit f553344 into apache:master Sep 16, 2024
36 of 37 checks passed
Copy link
Contributor

Ephemeral environment shutdown and build artifacts deleted.

@justinpark
Copy link
Member Author

@sadpandajoe Could you include this in version 4.1?

@sadpandajoe sadpandajoe added the v4.1 Label added by the release manager to track PRs to be included in the 4.1 branch label Sep 16, 2024
sadpandajoe pushed a commit that referenced this pull request Sep 16, 2024
@github-actions github-actions bot added 🍒 4.1.0 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels labels Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels change:frontend Requires changing the frontend size/L sqllab Namespace | Anything related to the SQL Lab v4.1 Label added by the release manager to track PRs to be included in the 4.1 branch 🍒 4.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants