Skip to content

Fix/6274 ctrl c source mode copy#6365

Open
siddqamar wants to merge 2 commits into
stablyai:mainfrom
siddqamar:fix/6274-ctrl-c-source-mode-copy
Open

Fix/6274 ctrl c source mode copy#6365
siddqamar wants to merge 2 commits into
stablyai:mainfrom
siddqamar:fix/6274-ctrl-c-source-mode-copy

Conversation

@siddqamar

Copy link
Copy Markdown
Contributor

Summary

Fixed #6274 the Windows Markdown Source mode copy bug by making Monaco-backed editor surfaces count as editable, so Ctrl+C is no longer intercepted by global shortcut guards.

Screenshots

No visual change

Testing

  • pnpm lint
  • pnpm typecheck
  • pnpm test
  • pnpm build
  • Ran src/renderer/src/lib/editable-target.test.ts locally with Vitest and confirmed it passed

AI Review Report

Reviewed the shortcut routing path end to end and checked the main risks: global shortcut interception, terminal
exclusions, and cross-platform behavior. Verified the fix is limited to renderer-side editable-target detection and does
not change main-process accelerators, clipboard handling, or IPC flow.

Cross-platform compatibility checked for macOS, Linux, and Windows, including shortcut behavior, labels, path handling,
shell behavior, and Electron-specific shortcut differences.

Security Audit

No security issues found. This change does not add input parsing, command execution, IPC, auth, secrets, or path-handling
risk.

Notes

  • The fix is scoped to Monaco/diff/rich-markdown editor hosts.
  • The regression test is Node-friendly and covers native inputs, Monaco-style editor hosts, and the terminal helper
    textarea exclusion.

@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: f2c5ae93-b58e-47da-88dc-4fd438667380

📥 Commits

Reviewing files that changed from the base of the PR and between f6ad569 and 79020a4.

📒 Files selected for processing (2)
  • src/renderer/src/lib/editable-target.test.ts
  • src/renderer/src/lib/editable-target.ts

📝 Walkthrough

Walkthrough

The editable-target check now treats Monaco, diff editor, and rich-markdown editor container elements as editable alongside standard form fields and contenteditable elements. The test suite adds a mock HTMLElement, stubs the global constructor, and covers native form fields, editor host elements, terminal helper textareas, and empty targets.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and points to the Ctrl+C Source mode fix in #6274.
Description check ✅ Passed The PR description follows the template sections and includes summary, screenshots, testing, review, audit, and notes.
Linked Issues check ✅ Passed The code change and regression test address #6274 by making Source mode editor hosts editable so Ctrl+C is no longer intercepted.
Out of Scope Changes check ✅ Passed The changes stay scoped to editable-target detection and its regression test, with no unrelated code paths added.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…cut guards

- Add Monaco/diff/rich-markdown editor roots to the shared editable-target check

- Prevent App-level capture handlers from misclassifying Markdown Source mode as non-editable on Windows

- Restore native Ctrl+C copy behavior in Monaco-backed editors while preserving terminal xterm exclusions

- Add regression coverage for native inputs, Monaco-style editor hosts, and terminal helper textarea handling
- Replace DOM-dependent setup with lightweight HTMLElement mocks

- Keep coverage for native inputs, Monaco-style editor hosts, and terminal helper textarea exclusions
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.

[Bug]: Ctrl+C shortcuts for copying do not work.

2 participants