feat: Add Shift+Alt+C mode switching between IDE and copy modes #409
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
功能概述
Add Shift+Alt+C keyboard shortcut to toggle between two operation modes:
主要特性
1. Mode Switching
Shift+Alt+C
2. Fixed Copy Path Bug
Before: Copy function returned IDE name (e.g., "vscode") instead of file path
After: Returns actual file path in format
path:line:column
Example:
/Users/project/src/App.tsx:42:10
3. Cross-Platform Keyboard Support
Improved keyboard event detection using multiple methods (
e.key
,e.code
,e.keyCode
) for cross-browser/OS compatibility.Technical Implementation
Modified files:
packages/core/src/client/index.ts
- Core functionality (~160 lines added)packages/core/types/client/index.d.ts
- TypeScript type definitionsNew state:
New methods:
toggleMode()
- Switch between IDE and copy modesshowModeToastNotification()
- Display toast notificationhandleKeyDown(e: KeyboardEvent)
- Handle Shift+Alt+C shortcutUpdated UI:
Use Cases
Testing
Tested on:
Backwards Compatibility
For users not using the new shortcut, experience is identical to before.
Demo
Press
Shift+Alt+C
while the inspector is active to see the mode toggle toast notification. The overlay will show which mode is active.