Skip to content

fix(shortcuts): the reference matches the bindings; Ctrl+Enter, Shift+Alt+F and Ctrl+, work as listed (#1148) - #1261

Merged
ZhuchkaTriplesix merged 3 commits into
devfrom
issue/1148-shortcut-reference
Oct 10, 2026
Merged

ZhuchkaTriplesix merged 3 commits into
devfrom
issue/1148-shortcut-reference

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

Summary

Closes the gaps left on #1148: no test checked the shortcuts reference against the real bindings, and F5 was described as "Refresh schema". Checking it found three bindings that did not do what the app says.

Bindings

  • Ctrl/Cmd+Enter outside the editor ran the whole script. The global key handler in main_screen sent Ctrl/Cmd+Enter, Ctrl/Cmd+R and F5 to the same script run. Now Ctrl/Cmd+Enter and Ctrl/Cmd+R run the selection or the statement at the cursor, as inside the editor, and F5 / Ctrl/Cmd+Shift+Enter run the script. This uses the new SqlEditorCommandBridge.onExecuteStatement / invokeExecuteStatement, which falls back to the script run.
  • Shift+Alt+F (Format SQL) was bound nowhere, though the reference, the Format button tooltip and the palette all name it. The SQL workspace binds it.
  • Ctrl+, (Preferences) worked only through the macOS menu bar. The global handler opens Preferences on Linux and Windows.

Reference (preferences_shortcuts_section.dart)

  • F5 → an alternative of Execute all statements, and Refresh table data (table browser). Refresh schema / connection is removed: nothing refreshes the tree on F5.
  • Added Ctrl/Cmd+R (with Execute query / selection), Ctrl/Cmd+E (Toggle edit mode), Ctrl/Cmd+P (Command palette), Ctrl/Cmd+K (Quick switcher).
  • ShortcutItem.alternativeKeys: other combinations for one action, shown after "or" and matched by the keycap search (also in the Preferences search count).

Tests

  • generic_sql_workspace_shortcuts_test.dart: every SQL Editor combination in the reference is bound in the workspace; Shift+Alt+F formats the active tab.
  • sql_editor_command_bridge_test.dart: statement vs script, and the fallback.
  • preferences_shortcuts_section_test.dart: the F5 search finds Execute all statements and Refresh table data.

Not covered by the reconciliation test: the Data Grid and Navigation rows. Those are bound in the grid and in the global handler, which is a raw key handler, not a shortcut map.

Refs #1148

Test plan

  • CI: analysis and all test sections pass (no local runs, per team rule)

…ft+Alt+F formats; Ctrl+, opens Preferences (#1148)

- The global key handler sent Ctrl/Cmd+Enter, Ctrl/Cmd+R and F5 to the
  same script run. Outside the editor (results grid, toolbar) Ctrl+Enter
  now runs the selection or the statement at the cursor, as inside it;
  F5 and Ctrl/Cmd+Shift+Enter run the script. SqlEditorCommandBridge gets
  onExecuteStatement / invokeExecuteStatement for that.
- Shift+Alt+F was named in the reference, the Format button tooltip and the
  palette, but bound nowhere. The SQL workspace binds it.
- Ctrl+, worked only through the macOS menu bar; the global handler opens
  Preferences on Linux and Windows too.
…it so (#1148)

- F5 was listed as 'Refresh schema / connection'; nothing refreshes the
  tree on F5. It runs the script in the SQL editor and reloads the table
  browser: listed as an alternative of Execute all statements and as
  Refresh table data.
- Ctrl/Cmd+R is listed with Execute query / selection, Ctrl/Cmd+E (edit
  mode), Ctrl/Cmd+P (palette) and Ctrl/Cmd+K (quick switcher) are added.
- ShortcutItem.alternativeKeys: other combinations for the same action,
  shown after 'or' and found by the keycap search.
- A workspace test checks every SQL Editor combination of the reference
  against the workspace's bindings; Shift+Alt+F formats the active tab.
@github-actions github-actions Bot added enhancement New feature or request editor Code/SQL editor ux User experience, keyboard shortcuts and interactions P2 Medium priority / Parity & Refactoring labels Oct 10, 2026
…nawaited

The wrapper did not compile and took every test that loads the main screen
with it.
@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit 51145c7 into dev Oct 10, 2026
15 checks passed
@ZhuchkaTriplesix
ZhuchkaTriplesix deleted the issue/1148-shortcut-reference branch October 11, 2026 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

editor Code/SQL editor enhancement New feature or request P2 Medium priority / Parity & Refactoring ux User experience, keyboard shortcuts and interactions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant