From 2f4f89970ca4ab14a9addc901af7390251415fd9 Mon Sep 17 00:00:00 2001 From: sergeyteleshev Date: Wed, 24 Dec 2025 15:25:20 +0100 Subject: [PATCH 1/9] dbeaver/pro#7025 moves shortcuts for data editor to plugin-data-viewer and reuses it in shortcuts helper plugin --- .../plugin-data-spreadsheet-new/src/index.ts | 1 - .../src/DATA_VIEWER_KEY_BINDINGS.ts} | 3 +-- .../TableFooterMenu/TableFooterMenuService.ts | 19 ++++++++------- .../packages/plugin-data-viewer/src/index.ts | 1 + webapp/packages/plugin-help/package.json | 2 +- .../src/Shortcuts/SHORTCUTS_DATA.ts | 23 +++++++++++-------- webapp/packages/plugin-help/tsconfig.json | 2 +- webapp/yarn.lock | 2 +- 8 files changed, 30 insertions(+), 23 deletions(-) rename webapp/packages/{plugin-data-spreadsheet-new/src/DataGrid/DATA_GRID_BINDINGS.ts => plugin-data-viewer/src/DATA_VIEWER_KEY_BINDINGS.ts} (81%) diff --git a/webapp/packages/plugin-data-spreadsheet-new/src/index.ts b/webapp/packages/plugin-data-spreadsheet-new/src/index.ts index 41f2bea246d..c465e1ac538 100644 --- a/webapp/packages/plugin-data-spreadsheet-new/src/index.ts +++ b/webapp/packages/plugin-data-spreadsheet-new/src/index.ts @@ -7,4 +7,3 @@ */ import './module.js'; -export * from './DataGrid/DATA_GRID_BINDINGS.js'; diff --git a/webapp/packages/plugin-data-spreadsheet-new/src/DataGrid/DATA_GRID_BINDINGS.ts b/webapp/packages/plugin-data-viewer/src/DATA_VIEWER_KEY_BINDINGS.ts similarity index 81% rename from webapp/packages/plugin-data-spreadsheet-new/src/DataGrid/DATA_GRID_BINDINGS.ts rename to webapp/packages/plugin-data-viewer/src/DATA_VIEWER_KEY_BINDINGS.ts index a30842c03c0..7550b3b5702 100644 --- a/webapp/packages/plugin-data-spreadsheet-new/src/DataGrid/DATA_GRID_BINDINGS.ts +++ b/webapp/packages/plugin-data-viewer/src/DATA_VIEWER_KEY_BINDINGS.ts @@ -1,13 +1,12 @@ /* * CloudBeaver - Cloud Database Manager - * Copyright (C) 2020-2024 DBeaver Corp and others + * Copyright (C) 2020-2025 DBeaver Corp and others * * Licensed under the Apache License, Version 2.0. * you may not use this file except in compliance with the License. */ import type { IKeyBinding } from '@cloudbeaver/core-view'; -/* these consts are only used for the user interface in Shortcuts popup, actual bindings in DataGridTable.tsx */ export const KEY_BINDING_REVERT_INLINE_EDITOR_CHANGES: IKeyBinding = { id: 'data-viewer-revert-inline-editor-changes', keys: ['Escape'], diff --git a/webapp/packages/plugin-data-viewer/src/TableViewer/TableFooter/TableFooterMenu/TableFooterMenuService.ts b/webapp/packages/plugin-data-viewer/src/TableViewer/TableFooter/TableFooterMenu/TableFooterMenuService.ts index 439b2a32b57..23f23384ce6 100644 --- a/webapp/packages/plugin-data-viewer/src/TableViewer/TableFooter/TableFooterMenu/TableFooterMenuService.ts +++ b/webapp/packages/plugin-data-viewer/src/TableViewer/TableFooter/TableFooterMenu/TableFooterMenuService.ts @@ -15,10 +15,6 @@ import { ACTION_SAVE, ActionService, DATA_CONTEXT_MENU, - KEY_BINDING_ADD, - KEY_BINDING_DELETE, - KEY_BINDING_DUPLICATE, - KEY_BINDING_REVERT, KeyBindingService, MenuService, type IAction, @@ -26,6 +22,13 @@ import { import { LocalizationService } from '@cloudbeaver/core-localization'; import type { IDataContextProvider } from '@cloudbeaver/core-data-context'; +import { + KEY_BINDING_ADD_NEW_ROW, + KEY_BINDING_DELETE_ROW, + KEY_BINDING_DUPLICATE_ROW, + KEY_BINDING_REVERT_INLINE_EDITOR_CHANGES, +} from '../../../DATA_VIEWER_KEY_BINDINGS.js'; + import { DatabaseEditChangeType, IDatabaseDataEditAction } from '../../../DatabaseDataModel/Actions/IDatabaseDataEditAction.js'; import { DATA_CONTEXT_DV_DDM } from '../../../DatabaseDataModel/DataContext/DATA_CONTEXT_DV_DDM.js'; import { DATA_CONTEXT_DV_DDM_RESULT_INDEX } from '../../../DatabaseDataModel/DataContext/DATA_CONTEXT_DV_DDM_RESULT_INDEX.js'; @@ -49,7 +52,7 @@ export class TableFooterMenuService { this.registerEditingActions(); this.keyBindingService.addKeyBindingHandler({ id: 'table-footer-delete', - binding: KEY_BINDING_DELETE, + binding: KEY_BINDING_DELETE_ROW, contexts: [DATA_CONTEXT_DV_DDM, DATA_CONTEXT_DV_DDM_RESULT_INDEX], isBindingApplicable(context, action) { return action === ACTION_DELETE; @@ -59,7 +62,7 @@ export class TableFooterMenuService { this.keyBindingService.addKeyBindingHandler({ id: 'table-footer-revert', - binding: KEY_BINDING_REVERT, + binding: KEY_BINDING_REVERT_INLINE_EDITOR_CHANGES, contexts: [DATA_CONTEXT_DV_DDM, DATA_CONTEXT_DV_DDM_RESULT_INDEX], isBindingApplicable(context, action) { return action === ACTION_REVERT; @@ -69,7 +72,7 @@ export class TableFooterMenuService { this.keyBindingService.addKeyBindingHandler({ id: 'table-footer-add', - binding: KEY_BINDING_ADD, + binding: KEY_BINDING_ADD_NEW_ROW, contexts: [DATA_CONTEXT_DV_DDM, DATA_CONTEXT_DV_DDM_RESULT_INDEX], isBindingApplicable(context, action) { return action === ACTION_ADD; @@ -79,7 +82,7 @@ export class TableFooterMenuService { this.keyBindingService.addKeyBindingHandler({ id: 'table-footer-duplicate', - binding: KEY_BINDING_DUPLICATE, + binding: KEY_BINDING_DUPLICATE_ROW, contexts: [DATA_CONTEXT_DV_DDM, DATA_CONTEXT_DV_DDM_RESULT_INDEX], isBindingApplicable(context, action) { return action === ACTION_DUPLICATE; diff --git a/webapp/packages/plugin-data-viewer/src/index.ts b/webapp/packages/plugin-data-viewer/src/index.ts index 153e64cc6fb..27b5e1c5e95 100644 --- a/webapp/packages/plugin-data-viewer/src/index.ts +++ b/webapp/packages/plugin-data-viewer/src/index.ts @@ -96,3 +96,4 @@ export * from './useDataViewerCopyHandler.js'; export * from './DataViewerSettingsService.js'; export * from './DATA_EDITOR_SETTINGS_GROUP.js'; export * from './MENU_DV_CONTEXT_MENU.js'; +export * from './DATA_VIEWER_KEY_BINDINGS.js'; diff --git a/webapp/packages/plugin-help/package.json b/webapp/packages/plugin-help/package.json index e4a4ab55e2a..4723b022b65 100644 --- a/webapp/packages/plugin-help/package.json +++ b/webapp/packages/plugin-help/package.json @@ -34,7 +34,7 @@ "@cloudbeaver/core-routing": "workspace:*", "@cloudbeaver/core-utils": "workspace:*", "@cloudbeaver/core-view": "workspace:*", - "@cloudbeaver/plugin-data-spreadsheet-new": "workspace:*", + "@cloudbeaver/plugin-data-viewer": "workspace:*", "@cloudbeaver/plugin-navigation-tabs": "workspace:*", "@cloudbeaver/plugin-navigation-tree": "workspace:*", "@cloudbeaver/plugin-object-viewer-nav-tree-link": "workspace:*", diff --git a/webapp/packages/plugin-help/src/Shortcuts/SHORTCUTS_DATA.ts b/webapp/packages/plugin-help/src/Shortcuts/SHORTCUTS_DATA.ts index 337c17e4429..2f9d196de2c 100644 --- a/webapp/packages/plugin-help/src/Shortcuts/SHORTCUTS_DATA.ts +++ b/webapp/packages/plugin-help/src/Shortcuts/SHORTCUTS_DATA.ts @@ -6,12 +6,20 @@ * you may not use this file except in compliance with the License. */ import { getOS, OperatingSystem } from '@cloudbeaver/core-utils'; -import { createKeyBinding, getCommonAndOSSpecificKeys, type IKeyBinding, KEY_BINDING_OPEN_IN_TAB, KEY_BINDING_REDO, KEY_BINDING_UNDO } from '@cloudbeaver/core-view'; +import { + createKeyBinding, + getCommonAndOSSpecificKeys, + type IKeyBinding, + KEY_BINDING_OPEN_IN_TAB, + KEY_BINDING_REDO, + KEY_BINDING_UNDO, +} from '@cloudbeaver/core-view'; import { KEY_BINDING_ADD_NEW_ROW, + KEY_BINDING_DELETE_ROW, KEY_BINDING_DUPLICATE_ROW, KEY_BINDING_REVERT_INLINE_EDITOR_CHANGES, -} from '@cloudbeaver/plugin-data-spreadsheet-new'; +} from '@cloudbeaver/plugin-data-viewer'; import { KEY_BINDING_COLLAPSE_ALL, KEY_BINDING_ENABLE_FILTER } from '@cloudbeaver/plugin-navigation-tree'; import { KEY_BINDING_LINK_OBJECT } from '@cloudbeaver/plugin-object-viewer-nav-tree-link'; import { @@ -53,8 +61,6 @@ const FORMAT_SHORTCUT_KEYS_MAP: Record = { right: '→', pageup: 'pageup', pagedown: 'pagedown', - del: '⌦', - delete: '⌦', }; const SOURCE_DIVIDER_REGEXP = /\+/gi; const APPLIED_DIVIDER = ' + '; @@ -72,11 +78,10 @@ export const DATA_VIEWER_SHORTCUTS: IShortcut[] = [ label: 'data_viewer_shortcut_duplicate_row', code: transformKeys(KEY_BINDING_DUPLICATE_ROW), }, - // disabled - // { - // label: 'data_viewer_shortcut_delete_row', - // code: transformKeys(KEY_BINDING_DELETE_ROW), - // }, + { + label: 'data_viewer_shortcut_delete_row', + code: transformKeys(KEY_BINDING_DELETE_ROW), + }, ]; export const SQL_EDITOR_SHORTCUTS: IShortcut[] = [ diff --git a/webapp/packages/plugin-help/tsconfig.json b/webapp/packages/plugin-help/tsconfig.json index efdc2605603..0dad48367f9 100644 --- a/webapp/packages/plugin-help/tsconfig.json +++ b/webapp/packages/plugin-help/tsconfig.json @@ -47,7 +47,7 @@ "path": "../core-view" }, { - "path": "../plugin-data-spreadsheet-new" + "path": "../plugin-data-viewer" }, { "path": "../plugin-navigation-tabs" diff --git a/webapp/yarn.lock b/webapp/yarn.lock index 5d8442e5fb5..65ab3e04895 100644 --- a/webapp/yarn.lock +++ b/webapp/yarn.lock @@ -3242,7 +3242,7 @@ __metadata: "@cloudbeaver/core-routing": "workspace:*" "@cloudbeaver/core-utils": "workspace:*" "@cloudbeaver/core-view": "workspace:*" - "@cloudbeaver/plugin-data-spreadsheet-new": "workspace:*" + "@cloudbeaver/plugin-data-viewer": "workspace:*" "@cloudbeaver/plugin-navigation-tabs": "workspace:*" "@cloudbeaver/plugin-navigation-tree": "workspace:*" "@cloudbeaver/plugin-object-viewer-nav-tree-link": "workspace:*" From 2edb5d06c50c1fcec062e057d0ea605c38ab0344 Mon Sep 17 00:00:00 2001 From: sergeyteleshev Date: Wed, 24 Dec 2025 15:41:06 +0100 Subject: [PATCH 2/9] adds save binding to data editor --- .../src/DATA_VIEWER_KEY_BINDINGS.ts | 5 +++++ .../TableFooterMenu/TableFooterMenuService.ts | 11 +++++++++++ .../plugin-help/src/Shortcuts/SHORTCUTS_DATA.ts | 5 +++++ 3 files changed, 21 insertions(+) diff --git a/webapp/packages/plugin-data-viewer/src/DATA_VIEWER_KEY_BINDINGS.ts b/webapp/packages/plugin-data-viewer/src/DATA_VIEWER_KEY_BINDINGS.ts index 7550b3b5702..fd595a5ff2c 100644 --- a/webapp/packages/plugin-data-viewer/src/DATA_VIEWER_KEY_BINDINGS.ts +++ b/webapp/packages/plugin-data-viewer/src/DATA_VIEWER_KEY_BINDINGS.ts @@ -26,3 +26,8 @@ export const KEY_BINDING_DELETE_ROW: IKeyBinding = { id: 'data-viewer-delete-row', keys: ['Delete'], }; + +export const KEY_BINDING_SAVE: IKeyBinding = { + id: 'data-viewer-save', + keys: ['mod+shift+enter'], +}; diff --git a/webapp/packages/plugin-data-viewer/src/TableViewer/TableFooter/TableFooterMenu/TableFooterMenuService.ts b/webapp/packages/plugin-data-viewer/src/TableViewer/TableFooter/TableFooterMenu/TableFooterMenuService.ts index 23f23384ce6..94faf54f733 100644 --- a/webapp/packages/plugin-data-viewer/src/TableViewer/TableFooter/TableFooterMenu/TableFooterMenuService.ts +++ b/webapp/packages/plugin-data-viewer/src/TableViewer/TableFooter/TableFooterMenu/TableFooterMenuService.ts @@ -27,6 +27,7 @@ import { KEY_BINDING_DELETE_ROW, KEY_BINDING_DUPLICATE_ROW, KEY_BINDING_REVERT_INLINE_EDITOR_CHANGES, + KEY_BINDING_SAVE, } from '../../../DATA_VIEWER_KEY_BINDINGS.js'; import { DatabaseEditChangeType, IDatabaseDataEditAction } from '../../../DatabaseDataModel/Actions/IDatabaseDataEditAction.js'; @@ -90,6 +91,16 @@ export class TableFooterMenuService { handler: this.tableFooterMenuActionHandler.bind(this), }); + this.keyBindingService.addKeyBindingHandler({ + id: 'table-footer-save', + binding: KEY_BINDING_SAVE, + contexts: [DATA_CONTEXT_DV_DDM, DATA_CONTEXT_DV_DDM_RESULT_INDEX], + isBindingApplicable(context, action) { + return action === ACTION_SAVE; + }, + handler: this.tableFooterMenuActionHandler.bind(this), + }); + this.dataViewerViewService.registerAction(ACTION_DELETE, ACTION_REVERT, ACTION_ADD, ACTION_DUPLICATE); } diff --git a/webapp/packages/plugin-help/src/Shortcuts/SHORTCUTS_DATA.ts b/webapp/packages/plugin-help/src/Shortcuts/SHORTCUTS_DATA.ts index 2f9d196de2c..3bfc27a7cc0 100644 --- a/webapp/packages/plugin-help/src/Shortcuts/SHORTCUTS_DATA.ts +++ b/webapp/packages/plugin-help/src/Shortcuts/SHORTCUTS_DATA.ts @@ -19,6 +19,7 @@ import { KEY_BINDING_DELETE_ROW, KEY_BINDING_DUPLICATE_ROW, KEY_BINDING_REVERT_INLINE_EDITOR_CHANGES, + KEY_BINDING_SAVE, } from '@cloudbeaver/plugin-data-viewer'; import { KEY_BINDING_COLLAPSE_ALL, KEY_BINDING_ENABLE_FILTER } from '@cloudbeaver/plugin-navigation-tree'; import { KEY_BINDING_LINK_OBJECT } from '@cloudbeaver/plugin-object-viewer-nav-tree-link'; @@ -82,6 +83,10 @@ export const DATA_VIEWER_SHORTCUTS: IShortcut[] = [ label: 'data_viewer_shortcut_delete_row', code: transformKeys(KEY_BINDING_DELETE_ROW), }, + { + label: 'ui_processing_save', + code: transformKeys(KEY_BINDING_SAVE), + }, ]; export const SQL_EDITOR_SHORTCUTS: IShortcut[] = [ From f2b6a3c33abf7aefcc23014651fd43add65f3cbe Mon Sep 17 00:00:00 2001 From: sergeyteleshev Date: Wed, 24 Dec 2025 15:49:55 +0100 Subject: [PATCH 3/9] adds cancel shortcut --- .../src/DATA_VIEWER_KEY_BINDINGS.ts | 5 +++++ .../TableFooterMenu/TableFooterMenuService.ts | 13 ++++++++++++- .../plugin-help/src/Shortcuts/SHORTCUTS_DATA.ts | 5 +++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/webapp/packages/plugin-data-viewer/src/DATA_VIEWER_KEY_BINDINGS.ts b/webapp/packages/plugin-data-viewer/src/DATA_VIEWER_KEY_BINDINGS.ts index fd595a5ff2c..b668c173e6b 100644 --- a/webapp/packages/plugin-data-viewer/src/DATA_VIEWER_KEY_BINDINGS.ts +++ b/webapp/packages/plugin-data-viewer/src/DATA_VIEWER_KEY_BINDINGS.ts @@ -31,3 +31,8 @@ export const KEY_BINDING_SAVE: IKeyBinding = { id: 'data-viewer-save', keys: ['mod+shift+enter'], }; + +export const KEY_BINDING_CANCEL: IKeyBinding = { + id: 'data-viewer-cancel', + keys: ['mod+escape'], +}; diff --git a/webapp/packages/plugin-data-viewer/src/TableViewer/TableFooter/TableFooterMenu/TableFooterMenuService.ts b/webapp/packages/plugin-data-viewer/src/TableViewer/TableFooter/TableFooterMenu/TableFooterMenuService.ts index 94faf54f733..231e276d154 100644 --- a/webapp/packages/plugin-data-viewer/src/TableViewer/TableFooter/TableFooterMenu/TableFooterMenuService.ts +++ b/webapp/packages/plugin-data-viewer/src/TableViewer/TableFooter/TableFooterMenu/TableFooterMenuService.ts @@ -24,6 +24,7 @@ import type { IDataContextProvider } from '@cloudbeaver/core-data-context'; import { KEY_BINDING_ADD_NEW_ROW, + KEY_BINDING_CANCEL, KEY_BINDING_DELETE_ROW, KEY_BINDING_DUPLICATE_ROW, KEY_BINDING_REVERT_INLINE_EDITOR_CHANGES, @@ -101,7 +102,17 @@ export class TableFooterMenuService { handler: this.tableFooterMenuActionHandler.bind(this), }); - this.dataViewerViewService.registerAction(ACTION_DELETE, ACTION_REVERT, ACTION_ADD, ACTION_DUPLICATE); + this.keyBindingService.addKeyBindingHandler({ + id: 'table-footer-cancel', + binding: KEY_BINDING_CANCEL, + contexts: [DATA_CONTEXT_DV_DDM, DATA_CONTEXT_DV_DDM_RESULT_INDEX], + isBindingApplicable(context, action) { + return action === ACTION_CANCEL; + }, + handler: this.tableFooterMenuActionHandler.bind(this), + }); + + this.dataViewerViewService.registerAction(ACTION_DELETE, ACTION_REVERT, ACTION_ADD, ACTION_DUPLICATE, ACTION_CANCEL); } private registerEditingActions() { diff --git a/webapp/packages/plugin-help/src/Shortcuts/SHORTCUTS_DATA.ts b/webapp/packages/plugin-help/src/Shortcuts/SHORTCUTS_DATA.ts index 3bfc27a7cc0..927e4681cf7 100644 --- a/webapp/packages/plugin-help/src/Shortcuts/SHORTCUTS_DATA.ts +++ b/webapp/packages/plugin-help/src/Shortcuts/SHORTCUTS_DATA.ts @@ -16,6 +16,7 @@ import { } from '@cloudbeaver/core-view'; import { KEY_BINDING_ADD_NEW_ROW, + KEY_BINDING_CANCEL, KEY_BINDING_DELETE_ROW, KEY_BINDING_DUPLICATE_ROW, KEY_BINDING_REVERT_INLINE_EDITOR_CHANGES, @@ -87,6 +88,10 @@ export const DATA_VIEWER_SHORTCUTS: IShortcut[] = [ label: 'ui_processing_save', code: transformKeys(KEY_BINDING_SAVE), }, + { + label: 'ui_processing_cancel', + code: transformKeys(KEY_BINDING_CANCEL), + }, ]; export const SQL_EDITOR_SHORTCUTS: IShortcut[] = [ From b0a1b77efb776d57107f31fe43d04321b9104c6c Mon Sep 17 00:00:00 2001 From: sergeyteleshev Date: Wed, 24 Dec 2025 15:52:19 +0100 Subject: [PATCH 4/9] changes save shortcut --- .../packages/plugin-data-viewer/src/DATA_VIEWER_KEY_BINDINGS.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/packages/plugin-data-viewer/src/DATA_VIEWER_KEY_BINDINGS.ts b/webapp/packages/plugin-data-viewer/src/DATA_VIEWER_KEY_BINDINGS.ts index b668c173e6b..cc4cc51719c 100644 --- a/webapp/packages/plugin-data-viewer/src/DATA_VIEWER_KEY_BINDINGS.ts +++ b/webapp/packages/plugin-data-viewer/src/DATA_VIEWER_KEY_BINDINGS.ts @@ -29,7 +29,7 @@ export const KEY_BINDING_DELETE_ROW: IKeyBinding = { export const KEY_BINDING_SAVE: IKeyBinding = { id: 'data-viewer-save', - keys: ['mod+shift+enter'], + keys: ['mod+shift+s'], }; export const KEY_BINDING_CANCEL: IKeyBinding = { From 45759c0d1f716432471208253b54072280c2bde4 Mon Sep 17 00:00:00 2001 From: naumov Date: Tue, 30 Dec 2025 14:48:13 +0100 Subject: [PATCH 5/9] dbeaver/pro#7025 change binding key --- .../packages/plugin-data-viewer/src/DATA_VIEWER_KEY_BINDINGS.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/packages/plugin-data-viewer/src/DATA_VIEWER_KEY_BINDINGS.ts b/webapp/packages/plugin-data-viewer/src/DATA_VIEWER_KEY_BINDINGS.ts index cc4cc51719c..cef790dc49a 100644 --- a/webapp/packages/plugin-data-viewer/src/DATA_VIEWER_KEY_BINDINGS.ts +++ b/webapp/packages/plugin-data-viewer/src/DATA_VIEWER_KEY_BINDINGS.ts @@ -34,5 +34,5 @@ export const KEY_BINDING_SAVE: IKeyBinding = { export const KEY_BINDING_CANCEL: IKeyBinding = { id: 'data-viewer-cancel', - keys: ['mod+escape'], + keys: ['Alt+Escape'], }; From c5b375c2cfc628860c73e90f7dab6d62a4404106 Mon Sep 17 00:00:00 2001 From: sergeyteleshev Date: Mon, 5 Jan 2026 13:49:30 +0100 Subject: [PATCH 6/9] uses mod+. shortcut for cancel action (data editor) --- webapp/packages/core-view/src/View/CaptureView.tsx | 11 ++++++++--- webapp/packages/core-view/src/View/parseHotkey.ts | 6 +++++- .../src/DATA_VIEWER_KEY_BINDINGS.ts | 4 ++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/webapp/packages/core-view/src/View/CaptureView.tsx b/webapp/packages/core-view/src/View/CaptureView.tsx index b218ba91467..3f13e1db8e5 100644 --- a/webapp/packages/core-view/src/View/CaptureView.tsx +++ b/webapp/packages/core-view/src/View/CaptureView.tsx @@ -1,6 +1,6 @@ /* * CloudBeaver - Cloud Database Manager - * Copyright (C) 2020-2025 DBeaver Corp and others + * Copyright (C) 2020-2026 DBeaver Corp and others * * Licensed under the Apache License, Version 2.0. * you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ import { getCommonAndOSSpecificKeys } from '../Action/KeyBinding/getCommonAndOSS import styles from './CaptureView.module.css'; import { CaptureViewContext } from './CaptureViewContext.js'; import type { IView } from './IView.js'; -import { parseHotkey } from './parseHotkey.js'; +import { mapShortcut, parseHotkey } from './parseHotkey.js'; import { useActiveView } from './useActiveView.js'; import { useViewContext } from './useViewContext.js'; @@ -40,7 +40,10 @@ export const CaptureView = observer>( .filter(action => action?.binding && !action.isDisabled()) .filter(Boolean) as IActionItem[]; - const keys = actionItems.map(item => getCommonAndOSSpecificKeys(item.binding?.binding)).flat(); + const keys = actionItems + .map(item => getCommonAndOSSpecificKeys(item.binding?.binding)) + .flat() + .map(item => mapShortcut(item)); useHotkeys( keys, @@ -58,6 +61,8 @@ export const CaptureView = observer>( }); }); + console.log(action); + action?.activate(true); }, { diff --git a/webapp/packages/core-view/src/View/parseHotkey.ts b/webapp/packages/core-view/src/View/parseHotkey.ts index 563b12cb8ad..2cb2501c20a 100644 --- a/webapp/packages/core-view/src/View/parseHotkey.ts +++ b/webapp/packages/core-view/src/View/parseHotkey.ts @@ -1,6 +1,6 @@ /* * CloudBeaver - Cloud Database Manager - * Copyright (C) 2020-2025 DBeaver Corp and others + * Copyright (C) 2020-2026 DBeaver Corp and others * * Licensed under the Apache License, Version 2.0. * you may not use this file except in compliance with the License. @@ -39,6 +39,10 @@ export function mapKey(key: string): string { .replace(/key|digit|numpad|arrow/, ''); } +export function mapShortcut(shortcut: string, combinationKey = '+'): string { + return shortcut.split(combinationKey).map(mapKey).join(combinationKey); +} + export function isHotkeyModifier(key: string): boolean { return reservedModifierKeywords.includes(key); } diff --git a/webapp/packages/plugin-data-viewer/src/DATA_VIEWER_KEY_BINDINGS.ts b/webapp/packages/plugin-data-viewer/src/DATA_VIEWER_KEY_BINDINGS.ts index cef790dc49a..af144a57361 100644 --- a/webapp/packages/plugin-data-viewer/src/DATA_VIEWER_KEY_BINDINGS.ts +++ b/webapp/packages/plugin-data-viewer/src/DATA_VIEWER_KEY_BINDINGS.ts @@ -1,6 +1,6 @@ /* * CloudBeaver - Cloud Database Manager - * Copyright (C) 2020-2025 DBeaver Corp and others + * Copyright (C) 2020-2026 DBeaver Corp and others * * Licensed under the Apache License, Version 2.0. * you may not use this file except in compliance with the License. @@ -34,5 +34,5 @@ export const KEY_BINDING_SAVE: IKeyBinding = { export const KEY_BINDING_CANCEL: IKeyBinding = { id: 'data-viewer-cancel', - keys: ['Alt+Escape'], + keys: ['mod+.'], }; From f5cf03fec07cf4697b1c6b5b5e33733baeab239f Mon Sep 17 00:00:00 2001 From: sergeyteleshev Date: Thu, 8 Jan 2026 10:42:11 +0100 Subject: [PATCH 7/9] Revert "uses mod+. shortcut for cancel action (data editor)" This reverts commit c5b375c2cfc628860c73e90f7dab6d62a4404106. --- webapp/packages/core-view/src/View/CaptureView.tsx | 11 +++-------- webapp/packages/core-view/src/View/parseHotkey.ts | 6 +----- .../src/DATA_VIEWER_KEY_BINDINGS.ts | 4 ++-- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/webapp/packages/core-view/src/View/CaptureView.tsx b/webapp/packages/core-view/src/View/CaptureView.tsx index 3f13e1db8e5..b218ba91467 100644 --- a/webapp/packages/core-view/src/View/CaptureView.tsx +++ b/webapp/packages/core-view/src/View/CaptureView.tsx @@ -1,6 +1,6 @@ /* * CloudBeaver - Cloud Database Manager - * Copyright (C) 2020-2026 DBeaver Corp and others + * Copyright (C) 2020-2025 DBeaver Corp and others * * Licensed under the Apache License, Version 2.0. * you may not use this file except in compliance with the License. @@ -18,7 +18,7 @@ import { getCommonAndOSSpecificKeys } from '../Action/KeyBinding/getCommonAndOSS import styles from './CaptureView.module.css'; import { CaptureViewContext } from './CaptureViewContext.js'; import type { IView } from './IView.js'; -import { mapShortcut, parseHotkey } from './parseHotkey.js'; +import { parseHotkey } from './parseHotkey.js'; import { useActiveView } from './useActiveView.js'; import { useViewContext } from './useViewContext.js'; @@ -40,10 +40,7 @@ export const CaptureView = observer>( .filter(action => action?.binding && !action.isDisabled()) .filter(Boolean) as IActionItem[]; - const keys = actionItems - .map(item => getCommonAndOSSpecificKeys(item.binding?.binding)) - .flat() - .map(item => mapShortcut(item)); + const keys = actionItems.map(item => getCommonAndOSSpecificKeys(item.binding?.binding)).flat(); useHotkeys( keys, @@ -61,8 +58,6 @@ export const CaptureView = observer>( }); }); - console.log(action); - action?.activate(true); }, { diff --git a/webapp/packages/core-view/src/View/parseHotkey.ts b/webapp/packages/core-view/src/View/parseHotkey.ts index 2cb2501c20a..563b12cb8ad 100644 --- a/webapp/packages/core-view/src/View/parseHotkey.ts +++ b/webapp/packages/core-view/src/View/parseHotkey.ts @@ -1,6 +1,6 @@ /* * CloudBeaver - Cloud Database Manager - * Copyright (C) 2020-2026 DBeaver Corp and others + * Copyright (C) 2020-2025 DBeaver Corp and others * * Licensed under the Apache License, Version 2.0. * you may not use this file except in compliance with the License. @@ -39,10 +39,6 @@ export function mapKey(key: string): string { .replace(/key|digit|numpad|arrow/, ''); } -export function mapShortcut(shortcut: string, combinationKey = '+'): string { - return shortcut.split(combinationKey).map(mapKey).join(combinationKey); -} - export function isHotkeyModifier(key: string): boolean { return reservedModifierKeywords.includes(key); } diff --git a/webapp/packages/plugin-data-viewer/src/DATA_VIEWER_KEY_BINDINGS.ts b/webapp/packages/plugin-data-viewer/src/DATA_VIEWER_KEY_BINDINGS.ts index af144a57361..cef790dc49a 100644 --- a/webapp/packages/plugin-data-viewer/src/DATA_VIEWER_KEY_BINDINGS.ts +++ b/webapp/packages/plugin-data-viewer/src/DATA_VIEWER_KEY_BINDINGS.ts @@ -1,6 +1,6 @@ /* * CloudBeaver - Cloud Database Manager - * Copyright (C) 2020-2026 DBeaver Corp and others + * Copyright (C) 2020-2025 DBeaver Corp and others * * Licensed under the Apache License, Version 2.0. * you may not use this file except in compliance with the License. @@ -34,5 +34,5 @@ export const KEY_BINDING_SAVE: IKeyBinding = { export const KEY_BINDING_CANCEL: IKeyBinding = { id: 'data-viewer-cancel', - keys: ['mod+.'], + keys: ['Alt+Escape'], }; From 75a80f3d6904edffff00d2857721cbf0932cb9bd Mon Sep 17 00:00:00 2001 From: sergeyteleshev Date: Thu, 8 Jan 2026 10:51:48 +0100 Subject: [PATCH 8/9] adds mod+. shortcut for cancel --- .../plugin-data-viewer/src/DATA_VIEWER_KEY_BINDINGS.ts | 4 ++-- webapp/packages/plugin-help/src/Shortcuts/SHORTCUTS_DATA.ts | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/webapp/packages/plugin-data-viewer/src/DATA_VIEWER_KEY_BINDINGS.ts b/webapp/packages/plugin-data-viewer/src/DATA_VIEWER_KEY_BINDINGS.ts index cef790dc49a..fb1d5001b24 100644 --- a/webapp/packages/plugin-data-viewer/src/DATA_VIEWER_KEY_BINDINGS.ts +++ b/webapp/packages/plugin-data-viewer/src/DATA_VIEWER_KEY_BINDINGS.ts @@ -1,6 +1,6 @@ /* * CloudBeaver - Cloud Database Manager - * Copyright (C) 2020-2025 DBeaver Corp and others + * Copyright (C) 2020-2026 DBeaver Corp and others * * Licensed under the Apache License, Version 2.0. * you may not use this file except in compliance with the License. @@ -34,5 +34,5 @@ export const KEY_BINDING_SAVE: IKeyBinding = { export const KEY_BINDING_CANCEL: IKeyBinding = { id: 'data-viewer-cancel', - keys: ['Alt+Escape'], + keys: ['mod+period'], }; diff --git a/webapp/packages/plugin-help/src/Shortcuts/SHORTCUTS_DATA.ts b/webapp/packages/plugin-help/src/Shortcuts/SHORTCUTS_DATA.ts index 927e4681cf7..d4b21104674 100644 --- a/webapp/packages/plugin-help/src/Shortcuts/SHORTCUTS_DATA.ts +++ b/webapp/packages/plugin-help/src/Shortcuts/SHORTCUTS_DATA.ts @@ -1,6 +1,6 @@ /* * CloudBeaver - Cloud Database Manager - * Copyright (C) 2020-2025 DBeaver Corp and others + * Copyright (C) 2020-2026 DBeaver Corp and others * * Licensed under the Apache License, Version 2.0. * you may not use this file except in compliance with the License. @@ -63,6 +63,7 @@ const FORMAT_SHORTCUT_KEYS_MAP: Record = { right: '→', pageup: 'pageup', pagedown: 'pagedown', + period: '.', }; const SOURCE_DIVIDER_REGEXP = /\+/gi; const APPLIED_DIVIDER = ' + '; From 3aefb87aea07706b4afbcf26395cc2c4f43267df Mon Sep 17 00:00:00 2001 From: sergeyteleshev Date: Thu, 8 Jan 2026 15:18:59 +0100 Subject: [PATCH 9/9] adds shortcut for mac for deleting row in table --- .../packages/plugin-data-viewer/src/DATA_VIEWER_KEY_BINDINGS.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/webapp/packages/plugin-data-viewer/src/DATA_VIEWER_KEY_BINDINGS.ts b/webapp/packages/plugin-data-viewer/src/DATA_VIEWER_KEY_BINDINGS.ts index fb1d5001b24..cbb60ef8a86 100644 --- a/webapp/packages/plugin-data-viewer/src/DATA_VIEWER_KEY_BINDINGS.ts +++ b/webapp/packages/plugin-data-viewer/src/DATA_VIEWER_KEY_BINDINGS.ts @@ -25,6 +25,7 @@ export const KEY_BINDING_DUPLICATE_ROW: IKeyBinding = { export const KEY_BINDING_DELETE_ROW: IKeyBinding = { id: 'data-viewer-delete-row', keys: ['Delete'], + keysMac: ['Fn+Backspace'], }; export const KEY_BINDING_SAVE: IKeyBinding = {