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

[Backport M76] fix(chat): Fix React warnings caused by relocating the model selector #7366

Open
wants to merge 1 commit into
base: M76
Choose a base branch
from

Conversation

sourcegraph-release-bot
Copy link
Collaborator

Description

WHAT

  1. Fix React warnings caused by relocating the model selector
  • Warning: React does not recognize the popoverContentProps prop on a DOM element
  • Warning: Nested Buttons
  • There are also other pre-existing warnings, but this PR does not fix them
  1. Remove cmd+N keyboard shortcut as it is not compatible for other non vscode IDEs

WHY
Good practice to avoid React warnings. This prevents us from having bigger problems in the future

CONTEXT
Slack: https://sourcegraph.slack.com/archives/C05AGQYD528/p1741247210218679
Model Selector PR: #7322

Test plan

1. New e2e test keyboard shortcuts cmd+M opens model selector

  • Run pnpm -C vscode test:e2e chat-keyboard-shortcuts.test.ts and make sure the test passes

2. Fix React warnings caused by the model selector

  • Run pnpm run test:unit --run -v and scroll through the output and check for warnings.
  • The top warning should be Warning: flushSync was called from inside a lifecycle method., which is a pre-existing warning.
  • popoverContentProps and nested buttons warnings should not exist when you search for them.
    Screenshot 2025-03-06 at 1 18 31 AM

3. Remove cmd+N keyboard shortcut as it is not compatible for other non vscode IDEs

…#7351)

## Description
**WHAT**

1. Fix React warnings caused by [relocating the model
selector](#7322)

- Warning: React does not recognize the `popoverContentProps` prop on a
DOM element
  - Warning: Nested Buttons
- There are also other pre-existing warnings, but this PR does not fix
them

2. Remove `cmd+N` keyboard shortcut as it is not compatible for other
non vscode IDEs

**WHY**
Good practice to avoid React warnings. This prevents us from having
bigger problems in the future

**CONTEXT**
Slack:
https://sourcegraph.slack.com/archives/C05AGQYD528/p1741247210218679
Model Selector PR: #7322

## Test plan
**1. New e2e test `keyboard shortcuts cmd+M opens model selector`**
- Run `pnpm -C vscode test:e2e chat-keyboard-shortcuts.test.ts` and make
sure the test passes
<!-- Required. See
https://docs-legacy.sourcegraph.com/dev/background-information/testing_principles.
-->

**2. Fix React warnings caused by the model selector**

- Run `pnpm run test:unit --run -v` and scroll through the output and
check for warnings.
- The top warning should be `Warning: flushSync` was called from inside
a lifecycle method., which is a pre-existing warning.
- `popoverContentProps` and nested buttons warnings should not exist
when you search for them.
![Screenshot 2025-03-06 at 1 18
31 AM](https://github.com/user-attachments/assets/3c0abd26-93a3-405e-b836-216c695e44a7)

**3. Remove `cmd+N` keyboard shortcut as it is not compatible for other
non vscode IDEs**
- Run `pnpm install && pnpm build && pnpm -C vscode build && pnpm -C
vscode run dev `
- Click the Cody chat box and type `cmd+N`. This should create a new
file.
- Hover open the model select to see the tooltip
- `cmd+M` opens the model options, escape key closes the model options
See video before for my local testing
https://www.loom.com/share/0018805561774723a286350b57e3c9d1

---------

Co-authored-by: Beatrix <[email protected]>
(cherry picked from commit c36d1e0)
@dominiccooney
Copy link
Contributor

As I said on chat, I don't think you should backport a change that is just fixing warnings.

@umpox
Copy link
Contributor

umpox commented Mar 10, 2025

@julialeex Is there more to this than fixing warnings? Agree with @dominiccooney that we shouldn't need to backport is this is just fixing warnings.

Remove cmd+N keyboard shortcut as it is not compatible for other non vscode IDEs

Is this critical to backport?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants