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(web): voice search integration in search components #1046

Merged
merged 3 commits into from
Jul 16, 2019

Conversation

bietkul
Copy link
Contributor

@bietkul bietkul commented Jul 10, 2019

This PR contains voice search implementation in the search components with the following specs:

  • To enable voice search showVoiceSearch prop must be set to true.
  • Mic icon is fully customizable with the following new props.
  1. inner class named mic
  2. getMicInstance prop can be used to get the instance of SpeechRecognition object, which can be used to override the default configurations.
  3. renderMic can be used to render the custom mic UI.
renderMic = ({ handleClick, status }) => (
  <div>
    {...}
  </div>
)

Note
status is an enum which can have one of these values:
INACTIVE - mic is in inactive state i.e not listening
STOPPED - mic has been stopped by the user
ACTIVE - mic is listening
DENIED - mic permission is not available

Copy link
Contributor

@jyash97 jyash97 left a comment

Choose a reason for hiding this comment

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

Here are some points that I found:

  1. The mic is listening even after the search has been applied. Ideally, we should stop the mic after the search has been applied or should append results if we are listening to it. Check the following gif:

ContinuosVoice

  1. When we block the mic permission we should disable the mic, I think showing a tooltip about the details can be a great experience rather than toggling the icon. Check the following gif:

Access

  1. iconPosition in Mic component is set to left but it is on right. Are we making use of this prop?

  2. Can we have a better image when in a listening state? The current image doesn't look good and it doesn't seem to be smooth on my machine as seen in the first gif.

Thoughts @lakhansamani @siddharthlatest ?

packages/web/src/components/search/addons/Mic.js Outdated Show resolved Hide resolved
@bietkul
Copy link
Contributor Author

bietkul commented Jul 11, 2019

1, 2: I'll check on it.
3: iconPosition is just for internal use, it is coming from DataSearch.
4: I agree that the images aren't perfect.

@bietkul bietkul merged commit 8fb3970 into appbaseio:next Jul 16, 2019
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