This repository was archived by the owner on Sep 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add stop generating button to cody web #53191
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
almeidapaulooliveira
approved these changes
Jun 8, 2023
2830f6f
to
8627ac0
Compare
valerybugakov
approved these changes
Jun 9, 2023
Comment on lines
113
to
127
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of suggestions:
- Extract props into a standalone interface to be consistent with other React components in the monorepo.
- Do not use
React.memo
if it's not required to fix a known performance issue.
Suggested change
const AbortMessageInProgress: React.FunctionComponent<{ onAbortMessageInProgress: () => void }> = React.memo( | |
function AbortMessageInProgressButton({ onAbortMessageInProgress }) { | |
return ( | |
<div className="d-flex justify-content-center w-100 mt-4 mb-2"> | |
<Button onClick={onAbortMessageInProgress} variant="secondary" outline={true} size="sm"> | |
Stop generating | |
</Button> | |
</div> | |
) | |
} | |
) | |
interface AbortMessageInProgressProps { | |
onAbortMessageInProgress: () => void | |
} | |
const AbortMessageInProgress: React.FC<AbortMessageInProgressProps> = props => ( | |
<div className="d-flex justify-content-center w-100 mt-4 mb-2"> | |
<Button onClick={props.onAbortMessageInProgress} variant="secondary" outline={true} size="sm"> | |
Stop generating | |
</Button> | |
</div> | |
) | |
} | |
) |
Omg it's beautiful @thenamankumar. Where do I bribe you so that we can also add this to VS Code? 👀 |
@thenamankumar what's required to get this merged? |
8627ac0
to
acb8d71
Compare
ErikaRS
pushed a commit
that referenced
this pull request
Jun 22, 2023
Add stop generating button for in progress message for cody in web. <img width="760" alt="image" src="https://github.com/sourcegraph/sourcegraph/assets/22571395/8ea16443-a125-4a73-8859-eb815cdd89e3"> https://www.loom.com/share/811352d2fb6942ff9851c9dedda281e1 ## Test plan - visit /cody - ask a question - click on stop generating button - reload the page
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 stop generating button for in progress message for cody in web.

https://www.loom.com/share/811352d2fb6942ff9851c9dedda281e1
Test plan