Skip to content

#19 Add Ctrl/Cmd+S save shortcut in Monaco code editors - #72

Open
cherepanov wants to merge 12 commits into
OptimaJetLLC:masterfrom
cherepanov:19-feature-add-ctrlcmd+s-save-shortcut-in-monaco-code-editors
Open

cherepanov wants to merge 12 commits into
OptimaJetLLC:masterfrom
cherepanov:19-feature-add-ctrlcmd+s-save-shortcut-in-monaco-code-editors

Conversation

@cherepanov

@cherepanov cherepanov commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds Monaco Ctrl/Cmd+S script save when FormBuilder hotkeys are enabled, documents the chord vs form Save / hotkeys={false}, and hardens save paths found in soak testing:

  • Code Action compile returns CalculableResult.error instead of throwing on invalid syntax
  • Generic code editor validates the Monaco-supplied value on save (not stale React state)
  • Edit JSON modal wires Ctrl/Cmd+S to apply the form without closing bottom-panel editors

Closes #19.

Packages affected

  • @react-form-builder/designer
  • Form Author Guide / developer docs (keyboard shortcuts, designer customization)
  • tests/ (module + component + browser)

Checklist

  • I followed CONTRIBUTION.md and CONTRIBUTING.md
  • I ran npm run check-all locally (or explain why not) — ran focused gates instead: module hotkey specs, generic-code-editor-save, Chromium code-editor-save-hotkey
  • Tests updated/added under tests/ when appropriate
  • Docs updated under documentation/docs for user-facing changes
  • External contributors: I have signed the CLA (comment the sign phrase on this PR if CI asks)

Breaking changes / migration

None. Hosts that pass hotkeys={false} keep owning Ctrl/Cmd+S. Remapping form save via hotkeys.bindings does not disable the Monaco script-save chord.

Co-authored-by: Alexey Cherepanov <a@cherepanov.info>
…nd hotkeys={false}

Skip the save chord when onSave is omitted or hotkeys are disabled, and bind KeyMod via stable enum values so empty onMount monaco stubs no longer crash autoformat tests.

Co-authored-by: Alexey Cherepanov <a@cherepanov.info>
Co-authored-by: Alexey Cherepanov <a@cherepanov.info>
…cmd+s-save-shortcut-in-monaco-code-editors

Co-authored-by: Alexey Cherepanov <a@cherepanov.info>
…monaco-code-editors

Co-authored-by: Alexey Cherepanov <a@cherepanov.info>
Co-authored-by: Alexey Cherepanov <a@cherepanov.info>
Co-authored-by: Alexey Cherepanov <a@cherepanov.info>
…alue, JsonView Ctrl/Cmd+S

Prevent uncaught SyntaxError from Code Action compile, validate the Monaco
value on save instead of stale React state, and wire Edit JSON modal Ctrl/Cmd+S
to apply the form without closing bottom-panel editors.

Co-authored-by: Alexey Cherepanov <a@cherepanov.info>
@cherepanov

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@ashalugin ashalugin mentioned this pull request Dec 1, 2026
3 tasks done
…monaco-code-editors

Co-authored-by: Alexey Cherepanov <a@cherepanov.info>
@cherepanov

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

github-actions Bot and others added 3 commits December 1, 2026 16:23
eslint react-hooks/refs forbids updating compileSourceRef in the props
reset path; keep save-time sync so Monaco values still validate correctly.

Co-authored-by: Alexey Cherepanov <a@cherepanov.info>
Co-authored-by: Alexey Cherepanov <a@cherepanov.info>
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.

[Feature] Add Ctrl/Cmd+S save shortcut in Monaco code editors

1 participant