Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Conversation

thenamankumar
Copy link
Member

Add stop generating button for in progress message for cody in web.
image

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

Test plan

  • visit /cody
  • ask a question
  • click on stop generating button
  • reload the page

@cla-bot cla-bot bot added the cla-signed label Jun 8, 2023
@thenamankumar thenamankumar requested a review from a team June 8, 2023 19:16
@thenamankumar thenamankumar self-assigned this Jun 8, 2023
@sourcegraph-bot
Copy link
Contributor

sourcegraph-bot commented Jun 8, 2023

📖 Storybook live preview

@thenamankumar thenamankumar force-pushed the naman/cody-web-stop-generating branch from 2830f6f to 8627ac0 Compare June 8, 2023 20:57
@thenamankumar thenamankumar requested a review from a team June 8, 2023 21:05
Comment on lines 113 to 127
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of suggestions:

  1. Extract props into a standalone interface to be consistent with other React components in the monorepo.
  2. 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>
)
}
)

@philipp-spiess
Copy link
Contributor

Omg it's beautiful @thenamankumar. Where do I bribe you so that we can also add this to VS Code? 👀

@eseliger
Copy link
Member

@thenamankumar what's required to get this merged?

@thenamankumar thenamankumar enabled auto-merge (squash) June 13, 2023 21:23
@thenamankumar thenamankumar force-pushed the naman/cody-web-stop-generating branch from 8627ac0 to acb8d71 Compare June 13, 2023 21:23
@thenamankumar thenamankumar merged commit 6b6008e into main Jun 13, 2023
@thenamankumar thenamankumar deleted the naman/cody-web-stop-generating branch June 13, 2023 21:39
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants