Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Match Cursor's double-press behavior for AI Chat toggle (cmd+]) #7

Closed
wants to merge 1 commit into from

Conversation

sheen4n
Copy link

@sheen4n sheen4n commented Nov 11, 2024

Aims to resolve #6

Issue

Currently, our AI Chat toggle behavior differs from Cursor editor's implementation. We should align our cmd+] behavior with how Cursor handles double-press cmd+L for consistency across AI-enabled editors.

Current Behavior:

  • First press of cmd+] opens the ai chat panel
  • Second press of cmd+] does not close the ai chat panel (unless we toggle to the editor)

Expected Behavior:

  • Match Cursor editor's double-press pattern:
    • Single press of cmd+] opens the chat panel
    • Quick double press of cmd+] should toggle the chat panel
  • This mirrors Cursor's implementation where double-pressing cmd+L toggles their AI chat view

Technical Changes:

const additionalShortcuts = [
    {
        key: 'ctrl+]',
        mac: 'cmd+]',
        command: 'aichat.newchataction',
    },
    // ... other shortcuts
];
  • Remove the when clause restriction from aichat.newchataction
  • Ensures smooth toggle behavior on repeated keypresses

Reference:

  • Cursor Editor's cmd+L double-press behavior serves as the UX benchmark
  • This change will provide feature parity with Cursor's chat toggle implementation

@tjx666
Copy link
Owner

tjx666 commented Nov 11, 2024

Did you test it?

After I test, your solution doesn't work, buecause: getcursor/cursor#860 (comment).

I know this is the best ux, but no method to fix it util official fix getcursor/cursor#860 (comment)

The 93e7d2c is the best I can do now

@tjx666
Copy link
Owner

tjx666 commented Nov 11, 2024

When you focus on chat input, only cursor official injected shortcuts will work, most of vscode shortcut not work:

image image

@sheen4n
Copy link
Author

sheen4n commented Nov 19, 2024

I see, will close the merge request then. Let's await for the official fix:
getcursor/cursor#860 (comment)

@sheen4n sheen4n closed this Nov 19, 2024
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: Match Cursor's double-press behavior for AI Chat toggle (cmd+])
2 participants