Skip to content

Commit cfc7160

Browse files
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) <noreply@anthropic.com>
1 parent d88749e commit cfc7160

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • components/ui/editor-intent/src/main/resources/META-INF/dirigible/editor-intent/js

‎components/ui/editor-intent/src/main/resources/META-INF/dirigible/editor-intent/js/editor.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ editorView.controller('IntentEditorController', ($scope, $http, ViewParameters,
9999
});
100100
};
101101

102-
$scope.save = () => {
102+
$scope.save = (keySet = 'ctrl+s', event) => {
103+
event?.preventDefault();
103104
if (!$scope.changed || $scope.state.error) return;
104105
$scope.state.isBusy = true;
105106
WorkspaceService.saveContent($scope.dataParameters.filePath, $scope.text).then(() => {

0 commit comments

Comments
 (0)