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: VoiceWidget (DSN-2548) #370

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

mikaalnaik
Copy link
Contributor

Fixes or implements VF-XXX

Brief description. What is this change?

Implementation details. How do you make this change?

Setup information

Deployment Notes

Related PRs

Checklist

  • Breaking changes have been communicated, including:
    • New required environment variables
    • Renaming of interfaces (API routes, request/response interface, etc)
  • New environment variables have been deployed
  • Appropriate tests have been written
    • Bug fixes are accompanied by an updated or new test
    • New features are accompanied by a new test

@mikaalnaik mikaalnaik self-assigned this Nov 26, 2024
Copy link

linear bot commented Nov 26, 2024

Copy link

vercel bot commented Nov 26, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-chat ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 26, 2024 9:59pm

Copy link

graphite-app bot commented Nov 26, 2024

Your org requires the Graphite merge queue for merging into master

Add the label “merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

} else if (isListening) {
title = 'Listening';
} else if (isTalking) {
title = 'Talk to interupt';
Copy link

Choose a reason for hiding this comment

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

There is a typo in the title text - interupt should be spelled interrupt

Spotted by Graphite Reviewer

Is this helpful? React 👍 or 👎 to let us know.

Comment on lines +46 to +47
if (microphone) microphone.disconnect();
if (audioContext) audioContext.close();
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be simplified to:

microphone?.disconnect();
audioContext?.close();

setIsCalling((prev) => !prev);
if (isCalling) {
endCall();
// End call
Copy link
Contributor

Choose a reason for hiding this comment

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

redundant comment.. :/

// End call
} else {
startCall();
// Start call
Copy link
Contributor

Choose a reason for hiding this comment

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

redundant comment.. :/


const handleButtonClick = () => {
setIsCalling((prev) => !prev);
if (isCalling) {
Copy link
Contributor

Choose a reason for hiding this comment

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

In react (from what I know) we don't have a guarantee as to when a 'set state' method will change the state. (It should happen instantaneously, but sometimes for performance reasons it might not).

So, I would place this if before the setIsCalling() method, so it's definitive.

Comment on lines +26 to +30
footer: {
extraLinkText: string;
extraLinkUrl: string;
showPoweredBy: boolean;
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Can't we use the same FooterProps object we have for this ?


useEffect(() => {
const initAudio = async () => {
if (audioContextRef.current) return;
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe this should be a dependency of the effect here if it needs to be triggered when this is changed (and not triggered again after) ?

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