From 286eeed8c3f55b42ddd93cc3c628aa3662a3f67f Mon Sep 17 00:00:00 2001 From: Gabriel Malavazi Rodrigues Date: Tue, 23 Jun 2026 08:46:32 -0300 Subject: [PATCH 1/3] Add a customizable keyboard shortcut that manually triggers the Monaco suggestion widget, complementing the existing automatic completion --- src/components/ui/SqlEditorWrapper.tsx | 13 +++++++++++++ src/config/shortcuts.json | 10 ++++++++++ src/i18n/locales/de.json | 3 ++- src/i18n/locales/en.json | 3 ++- src/i18n/locales/es.json | 3 ++- src/i18n/locales/fr.json | 3 ++- src/i18n/locales/it.json | 3 ++- src/i18n/locales/ja.json | 3 ++- src/i18n/locales/ru.json | 3 ++- src/i18n/locales/zh.json | 3 ++- 10 files changed, 39 insertions(+), 8 deletions(-) diff --git a/src/components/ui/SqlEditorWrapper.tsx b/src/components/ui/SqlEditorWrapper.tsx index 4bcb8766..178f2c5d 100644 --- a/src/components/ui/SqlEditorWrapper.tsx +++ b/src/components/ui/SqlEditorWrapper.tsx @@ -5,6 +5,7 @@ import { useEditorTheme } from "../../hooks/useEditorTheme"; import { loadMonacoTheme } from "../../themes/themeUtils"; import { readText } from "@tauri-apps/plugin-clipboard-manager"; import { useSettings } from "../../hooks/useSettings"; +import { useKeybindings } from "../../hooks/useKeybindings"; import { getFontCSS } from "../../utils/settings"; interface SqlEditorWrapperProps { @@ -33,6 +34,9 @@ const SqlEditorInternal = ({ onRunRef.current = onRun; const editorTheme = useEditorTheme(); const { settings } = useSettings(); + const { matchesShortcut } = useKeybindings(); + const matchesShortcutRef = useRef(matchesShortcut); + matchesShortcutRef.current = matchesShortcut; // Dispose editor on unmount to prevent "domNode" errors from ResizeObserver // firing after the DOM container is removed (e.g., cell deletion/movement) @@ -141,6 +145,15 @@ const SqlEditorInternal = ({ } ); + // Force the suggestion widget via the user-configurable shortcut + editor.onKeyDown((e) => { + if (matchesShortcutRef.current(e.browserEvent, "trigger_suggestions")) { + e.preventDefault(); + e.stopPropagation(); + editor.trigger("keyboard", "editor.action.triggerSuggest", {}); + } + }); + if (onMount) onMount(editor, monaco); }; diff --git a/src/config/shortcuts.json b/src/config/shortcuts.json index 13f59f3b..cba5fd2a 100644 --- a/src/config/shortcuts.json +++ b/src/config/shortcuts.json @@ -158,5 +158,15 @@ "winMatch": { "ctrlKey": true, "key": "p" }, "i18nKey": "settings.shortcuts.quickNavigator", "overridable": true + }, + { + "id": "trigger_suggestions", + "category": "editor", + "defaultMac": "⌘+I", + "defaultWin": "Ctrl+Space", + "macMatch": { "metaKey": true, "key": "i" }, + "winMatch": { "ctrlKey": true, "key": " " }, + "i18nKey": "settings.shortcuts.triggerSuggestions", + "overridable": true } ] diff --git a/src/i18n/locales/de.json b/src/i18n/locales/de.json index 4f9e8bfd..a2fd9597 100644 --- a/src/i18n/locales/de.json +++ b/src/i18n/locales/de.json @@ -577,7 +577,8 @@ "notebookRunAll": "Alle Zellen ausführen", "categories_notebook": "Notebook", "pasteImportClipboard": "Aus Zwischenablage importieren", - "quickNavigator": "Schnellnavigation" + "quickNavigator": "Schnellnavigation", + "triggerSuggestions": "Vorschläge anzeigen" }, "aiActivity": "KI-Aktivität" }, diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index d2902e3c..137ae826 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -611,7 +611,8 @@ "notebookRunAll": "Run All Cells", "categories_notebook": "Notebook", "pasteImportClipboard": "Import from Clipboard", - "quickNavigator": "Quick Navigator" + "quickNavigator": "Quick Navigator", + "triggerSuggestions": "Trigger suggestions" }, "aiActivity": "AI Activity" }, diff --git a/src/i18n/locales/es.json b/src/i18n/locales/es.json index a0e913ad..cb60be8c 100644 --- a/src/i18n/locales/es.json +++ b/src/i18n/locales/es.json @@ -582,7 +582,8 @@ "notebookRunAll": "Ejecutar Todas las Celdas", "categories_notebook": "Notebook", "pasteImportClipboard": "Importar desde Portapapeles", - "quickNavigator": "Navegador rápido" + "quickNavigator": "Navegador rápido", + "triggerSuggestions": "Mostrar sugerencias" }, "aiActivity": "Actividad IA" }, diff --git a/src/i18n/locales/fr.json b/src/i18n/locales/fr.json index a3f727f6..aef87283 100644 --- a/src/i18n/locales/fr.json +++ b/src/i18n/locales/fr.json @@ -577,7 +577,8 @@ "notebookRunAll": "Exécuter toutes les cellules", "categories_notebook": "Notebook", "pasteImportClipboard": "Importer depuis le Presse-papiers", - "quickNavigator": "Navigateur rapide" + "quickNavigator": "Navigateur rapide", + "triggerSuggestions": "Afficher les suggestions" }, "aiActivity": "Activité IA" }, diff --git a/src/i18n/locales/it.json b/src/i18n/locales/it.json index 62139e2a..8675fcca 100644 --- a/src/i18n/locales/it.json +++ b/src/i18n/locales/it.json @@ -582,7 +582,8 @@ "notebookRunAll": "Esegui Tutte le Celle", "categories_notebook": "Notebook", "pasteImportClipboard": "Importa dagli Appunti", - "quickNavigator": "Navigatore rapido" + "quickNavigator": "Navigatore rapido", + "triggerSuggestions": "Mostra suggerimenti" }, "aiActivity": "Attività AI" }, diff --git a/src/i18n/locales/ja.json b/src/i18n/locales/ja.json index ff3ca732..2dc90c57 100644 --- a/src/i18n/locales/ja.json +++ b/src/i18n/locales/ja.json @@ -591,7 +591,8 @@ "notebookRunAll": "すべてのセルを実行", "categories_notebook": "ノートブック", "pasteImportClipboard": "クリップボードからインポート", - "quickNavigator": "クイックナビゲーター" + "quickNavigator": "クイックナビゲーター", + "triggerSuggestions": "候補を表示" }, "aiActivity": "AI アクティビティ" }, diff --git a/src/i18n/locales/ru.json b/src/i18n/locales/ru.json index c8ee3e7a..6d5832d9 100644 --- a/src/i18n/locales/ru.json +++ b/src/i18n/locales/ru.json @@ -572,7 +572,8 @@ "notebookRunAll": "Выполнить все ячейки", "categories_notebook": "Ноутбук", "pasteImportClipboard": "Импортировать из буфера обмена", - "quickNavigator": "Быстрый навигатор" + "quickNavigator": "Быстрый навигатор", + "triggerSuggestions": "Показать подсказки" }, "aiActivity": "Активность AI" }, diff --git a/src/i18n/locales/zh.json b/src/i18n/locales/zh.json index 55a07edb..f1d5cd4d 100644 --- a/src/i18n/locales/zh.json +++ b/src/i18n/locales/zh.json @@ -545,7 +545,8 @@ "pressKeys": "按下组合键...", "notebookRunAll": "运行所有单元格", "categories_notebook": "笔记本", - "quickNavigator": "快速导航" + "quickNavigator": "快速导航", + "triggerSuggestions": "触发建议" }, "aiActivity": "AI 活动" }, From aa35436107709ba0950e238699dd70b8a9435b7c Mon Sep 17 00:00:00 2001 From: Gabriel Malavazi Rodrigues Date: Tue, 23 Jun 2026 09:34:35 -0300 Subject: [PATCH 2/3] test ajust mock useKeybindings in SqlEditorWrapper test --- tests/components/ui/SqlEditorWrapper.test.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/components/ui/SqlEditorWrapper.test.tsx b/tests/components/ui/SqlEditorWrapper.test.tsx index e54e4478..69385454 100644 --- a/tests/components/ui/SqlEditorWrapper.test.tsx +++ b/tests/components/ui/SqlEditorWrapper.test.tsx @@ -27,6 +27,13 @@ vi.mock('../../../src/hooks/useTheme', () => ({ })), })); +// Mock useKeybindings hook +vi.mock('../../../src/hooks/useKeybindings', () => ({ + useKeybindings: vi.fn(() => ({ + matchesShortcut: vi.fn(() => false), + })), +})); + // Mock themeUtils vi.mock('../../../src/themes/themeUtils', () => ({ loadMonacoTheme: vi.fn(), From 4d870afe5af1690d2a730a1b08b0c74976734ed7 Mon Sep 17 00:00:00 2001 From: Gabriel Malavazi Rodrigues Date: Wed, 24 Jun 2026 17:13:10 -0300 Subject: [PATCH 3/3] add configurable shortcut to reload the current table Add a `refresh_table` keybinding --- src/config/shortcuts.json | 10 ++++++++++ src/i18n/locales/de.json | 3 ++- src/i18n/locales/en.json | 3 ++- src/i18n/locales/es.json | 3 ++- src/i18n/locales/fr.json | 3 ++- src/i18n/locales/it.json | 3 ++- src/i18n/locales/ja.json | 3 ++- src/i18n/locales/ru.json | 3 ++- src/i18n/locales/zh.json | 3 ++- src/pages/Editor.tsx | 11 +++++++++++ 10 files changed, 37 insertions(+), 8 deletions(-) diff --git a/src/config/shortcuts.json b/src/config/shortcuts.json index cba5fd2a..bfc3c40b 100644 --- a/src/config/shortcuts.json +++ b/src/config/shortcuts.json @@ -69,6 +69,16 @@ "i18nKey": "settings.shortcuts.saveGridChanges", "overridable": true }, + { + "id": "refresh_table", + "category": "data_grid", + "defaultMac": "⌘+R", + "defaultWin": "Ctrl+R", + "macMatch": { "metaKey": true, "key": "r" }, + "winMatch": { "ctrlKey": true, "key": "r" }, + "i18nKey": "settings.shortcuts.refreshTable", + "overridable": true + }, { "id": "tab_switcher", "category": "editor", diff --git a/src/i18n/locales/de.json b/src/i18n/locales/de.json index f1c851b0..cdbed045 100644 --- a/src/i18n/locales/de.json +++ b/src/i18n/locales/de.json @@ -581,7 +581,8 @@ "categories_notebook": "Notebook", "pasteImportClipboard": "Aus Zwischenablage importieren", "quickNavigator": "Schnellnavigation", - "triggerSuggestions": "Vorschläge anzeigen" + "triggerSuggestions": "Vorschläge anzeigen", + "refreshTable": "Tabelle aktualisieren" }, "aiActivity": "KI-Aktivität" }, diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index 485b8e79..1b788957 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -615,7 +615,8 @@ "categories_notebook": "Notebook", "pasteImportClipboard": "Import from Clipboard", "quickNavigator": "Quick Navigator", - "triggerSuggestions": "Trigger suggestions" + "triggerSuggestions": "Trigger suggestions", + "refreshTable": "Refresh table" }, "aiActivity": "AI Activity" }, diff --git a/src/i18n/locales/es.json b/src/i18n/locales/es.json index f682ecae..b9c2e6c1 100644 --- a/src/i18n/locales/es.json +++ b/src/i18n/locales/es.json @@ -586,7 +586,8 @@ "categories_notebook": "Notebook", "pasteImportClipboard": "Importar desde Portapapeles", "quickNavigator": "Navegador rápido", - "triggerSuggestions": "Mostrar sugerencias" + "triggerSuggestions": "Mostrar sugerencias", + "refreshTable": "Actualizar tabla" }, "aiActivity": "Actividad IA" }, diff --git a/src/i18n/locales/fr.json b/src/i18n/locales/fr.json index b3cfc446..5167bf01 100644 --- a/src/i18n/locales/fr.json +++ b/src/i18n/locales/fr.json @@ -581,7 +581,8 @@ "categories_notebook": "Notebook", "pasteImportClipboard": "Importer depuis le Presse-papiers", "quickNavigator": "Navigateur rapide", - "triggerSuggestions": "Afficher les suggestions" + "triggerSuggestions": "Afficher les suggestions", + "refreshTable": "Actualiser la table" }, "aiActivity": "Activité IA" }, diff --git a/src/i18n/locales/it.json b/src/i18n/locales/it.json index cb8984d2..eac901cb 100644 --- a/src/i18n/locales/it.json +++ b/src/i18n/locales/it.json @@ -586,7 +586,8 @@ "categories_notebook": "Notebook", "pasteImportClipboard": "Importa dagli Appunti", "quickNavigator": "Navigatore rapido", - "triggerSuggestions": "Mostra suggerimenti" + "triggerSuggestions": "Mostra suggerimenti", + "refreshTable": "Aggiorna tabella" }, "aiActivity": "Attività AI" }, diff --git a/src/i18n/locales/ja.json b/src/i18n/locales/ja.json index 48ffa938..a836704b 100644 --- a/src/i18n/locales/ja.json +++ b/src/i18n/locales/ja.json @@ -595,7 +595,8 @@ "categories_notebook": "ノートブック", "pasteImportClipboard": "クリップボードからインポート", "quickNavigator": "クイックナビゲーター", - "triggerSuggestions": "候補を表示" + "triggerSuggestions": "候補を表示", + "refreshTable": "テーブルを更新" }, "aiActivity": "AI アクティビティ" }, diff --git a/src/i18n/locales/ru.json b/src/i18n/locales/ru.json index b7470a17..ff132517 100644 --- a/src/i18n/locales/ru.json +++ b/src/i18n/locales/ru.json @@ -576,7 +576,8 @@ "categories_notebook": "Ноутбук", "pasteImportClipboard": "Импортировать из буфера обмена", "quickNavigator": "Быстрый навигатор", - "triggerSuggestions": "Показать подсказки" + "triggerSuggestions": "Показать подсказки", + "refreshTable": "Обновить таблицу" }, "aiActivity": "Активность AI" }, diff --git a/src/i18n/locales/zh.json b/src/i18n/locales/zh.json index fadf3371..a71318e5 100644 --- a/src/i18n/locales/zh.json +++ b/src/i18n/locales/zh.json @@ -549,7 +549,8 @@ "notebookRunAll": "运行所有单元格", "categories_notebook": "笔记本", "quickNavigator": "快速导航", - "triggerSuggestions": "触发建议" + "triggerSuggestions": "触发建议", + "refreshTable": "刷新表格" }, "aiActivity": "AI 活动" }, diff --git a/src/pages/Editor.tsx b/src/pages/Editor.tsx index e910e27d..f86b7e00 100644 --- a/src/pages/Editor.tsx +++ b/src/pages/Editor.tsx @@ -1259,6 +1259,17 @@ export const Editor = () => { } return; } + + if (matchesShortcut(e, "refresh_table")) { + const tab = tabsRef.current.find( + (t) => t.id === activeTabIdRef.current, + ); + if (tab?.activeTable) { + e.preventDefault(); + runQuery(tab.query, tab.page); + } + return; + } }; window.addEventListener("keydown", handleKeyDown); return () => window.removeEventListener("keydown", handleKeyDown);