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

refactor(webview): remove mention and add intent selector to toolbar #7287

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

abeatrix
Copy link
Contributor

@abeatrix abeatrix commented Mar 1, 2025

Part of https://linear.app/sourcegraph/issue/CODY-5035

This commit introduces a new ModeSelectorButton component to replace the intent selection logic within the submit button.

The changes include:

  • Removal of intent selection logic from SubmitButton.tsx.
  • Introduction of ModeSelectorButton.tsx with a popover menu for selecting chat modes (Chat, Search, Edit, Insert).
  • Integration of the new ModeSelectorButton into the Toolbar.tsx.
  • Optimizations for intent options and keyboard shortcuts to avoid recreating React elements.
  • Removal of at mention menu from Toolbar.tsx.

Test plan

Simple UI change with no feature change

image

Storybook

image

This commit introduces a new `ModeSelectorButton` component to replace the intent selection logic within the submit button.

The changes include:

- Removal of intent selection logic from `SubmitButton.tsx`.
- Introduction of `ModeSelectorButton.tsx` with a popover menu for selecting chat modes (Chat, Search, Edit, Insert).
- Integration of the new `ModeSelectorButton` into the `Toolbar.tsx`.
- Optimizations for intent options and keyboard shortcuts to avoid recreating React elements.
@abeatrix abeatrix changed the title refactor(webview): move intent selection to toolbar refactor(webview): remove mention and add intent selector to toolbar Mar 1, 2025
@alexromano
Copy link
Contributor

awesome! let's try:

  • dropdown says "Chat" or "Search" rather than "Run as chat" or "Run as search"
  • keyboard shortcut ⌘. switches between chat and search
  • hovering over the dropdown shows the keyboard shortcut like "Select a model (⌘.)"

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.

2 participants