Skip to content

fix(intent-editor): save on Cmd+S instead of triggering browser save-page#6296

Merged
iliyan-velichkov merged 1 commit into
masterfrom
fix/intent-editor-save
Jul 15, 2026
Merged

fix(intent-editor): save on Cmd+S instead of triggering browser save-page#6296
iliyan-velichkov merged 1 commit into
masterfrom
fix/intent-editor-save

Conversation

@iliyan-velichkov

Copy link
Copy Markdown
Contributor

What

Fixes an annoying behaviour in the Intent Editor: pressing Cmd+S / Ctrl+S did not save the app.intent file — instead the browser's native "Save page" dialog appeared.

Why

Cmd+S is wired through the platform shortcut directive on the editor body (shortcut="'ctrl+s'" shortcut-action="save"). That directive invokes shortcut.action(keySet, event) but deliberately does not call event.preventDefault() itself — suppressing the browser default is the action's responsibility.

The Intent Editor's $scope.save was declared as () => {…}: it took no event and never called preventDefault(), so the browser default fired. This was most visible right after accepting an AI-assistant proposal, which dirties the buffer without the user typing — the buffer was genuinely dirty, the keydown just wasn't intercepted.

Every sibling blimpKit editor that uses the same directive (editor-csv, editor-csvim, editor-integrations) already does it correctly. The Intent Editor was the lone outlier.

Change

One-line signature change to the repo-standard pattern:

$scope.save = (keySet = 'ctrl+s', event) => {
    event?.preventDefault();
    ...

The defaulted parameters keep the toolbar Save button (ng-click="save()") and the workspaceHub.onSaveAll / onSaveFile hub handlers (which call save() with no args) working unchanged — only the shortcut directive passes (keySet, event).

Testing

Verified locally: open a project's app.intent, use the AI assistant, click Accept on a proposal (buffer goes dirty), press Cmd+S — the file saves silently, no download dialog. Plain typing edits + Cmd+S and the toolbar Save button also confirmed working.

🤖 Generated with Claude Code

…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>
@iliyan-velichkov iliyan-velichkov self-assigned this Jul 15, 2026
@iliyan-velichkov
iliyan-velichkov merged commit beebb32 into master Jul 15, 2026
10 checks passed
@iliyan-velichkov
iliyan-velichkov deleted the fix/intent-editor-save branch July 15, 2026 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant