From cfc71604feedf3833be5fe817b8d29fcfa3cc12c Mon Sep 17 00:00:00 2001 From: Iliyan Velichkov Date: Wed, 15 Jul 2026 14:33:37 +0300 Subject: [PATCH] fix(intent-editor): save on Cmd+S instead of triggering browser save-page The Intent Editor's $scope.save took no arguments and never called preventDefault(), so the platform `shortcut` directive (which passes `(keySet, event)` and deliberately leaves preventDefault to the action) let the browser's native "Save page" dialog fire on Cmd+S/Ctrl+S. This was most visible right after accepting an AI-assistant proposal, which dirties the buffer without the user typing. Adopt the repo-standard save signature already used by editor-csv, editor-csvim and editor-integrations: accept `(keySet, event)` and `event?.preventDefault()` first. The defaulted params keep the toolbar Save button and the save-all/save-file hub handlers (which call save() with no args) working unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../resources/META-INF/dirigible/editor-intent/js/editor.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/ui/editor-intent/src/main/resources/META-INF/dirigible/editor-intent/js/editor.js b/components/ui/editor-intent/src/main/resources/META-INF/dirigible/editor-intent/js/editor.js index a14b75619b9..099303f936d 100644 --- a/components/ui/editor-intent/src/main/resources/META-INF/dirigible/editor-intent/js/editor.js +++ b/components/ui/editor-intent/src/main/resources/META-INF/dirigible/editor-intent/js/editor.js @@ -99,7 +99,8 @@ editorView.controller('IntentEditorController', ($scope, $http, ViewParameters, }); }; - $scope.save = () => { + $scope.save = (keySet = 'ctrl+s', event) => { + event?.preventDefault(); if (!$scope.changed || $scope.state.error) return; $scope.state.isBusy = true; WorkspaceService.saveContent($scope.dataParameters.filePath, $scope.text).then(() => {