Fix paste into Monaco find widget#137
Conversation
There was a problem hiding this comment.
Pull request overview
Scopes Markpad’s custom Monaco clipboard keybindings (Ctrl/Cmd+C and Ctrl/Cmd+V) to only apply when the editor text area is focused, restoring native clipboard behavior for Monaco UI widgets like the Find widget (fixing #115).
Changes:
- Restricts the custom copy action (
custom-copy) toeditorTextFocusso it won’t intercept copy in non-editor inputs (e.g., Find widget). - Restricts the custom paste command (Ctrl/Cmd+V) to
editorTextFocusso pasting into the Find widget uses Monaco’s native handling.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Hi @alecdotdev, this PR fixes #115 by scoping Markpad's custom Monaco clipboard shortcuts to editor text focus, so the find widget keeps native copy/paste while editor paste behavior stays unchanged.\n\nPre-submit checklist:\n- Rebasing/preflight: one commit on top of current upstream/master; diff limited to src/lib/components/Editor.svelte.\n- Local checks: npm run check passed with 0 errors (existing 14 Svelte warnings unchanged); cargo check and cargo test passed (existing APP_NAME warning unchanged).\n- Review: internal Codex, Copilot, and Claude review completed with no actionable code comments; added isolated Monaco smoke tests for find-widget copy/paste and editor-focused copy/paste behavior.\n- GitHub Actions: upstream CI passed.\n\nReady to adjust if you prefer a narrower clipboard-scope policy. |
|
great stuff, thanks! |
Fixes #115.\n\n## Summary\n- Scope Markpad's custom Monaco copy shortcut to editor text focus.\n- Scope the custom paste command to editor text focus so Monaco's find widget keeps native clipboard handling.\n\n## Test plan\n- npm run check\n- cargo check\n- cargo test\n- Internal review PR CI passed: https://github.com/wargoblin/Markpad/actions/runs/25441558927\n- Isolated Monaco smoke test: with find widget focused, custom paste/copy handlers do not run; with editor text focused, they still run.