Skip to content

feat(voice): add VoiceWaveformVisualizer component for voice interaction feedback#21680

Closed
sakshisemalti wants to merge 2 commits intogoogle-gemini:mainfrom
sakshisemalti:feat/voice-waveform-visualizer
Closed

feat(voice): add VoiceWaveformVisualizer component for voice interaction feedback#21680
sakshisemalti wants to merge 2 commits intogoogle-gemini:mainfrom
sakshisemalti:feat/voice-waveform-visualizer

Conversation

@sakshisemalti
Copy link
Copy Markdown
Contributor

Summary

Adds a VoiceWaveformVisualizer component that renders animated terminal feedback for voice interaction states: listening, processing and speaking. Returns null when idle. Includes screen reader support.

Details

Adds a standalone VoiceWaveformVisualizer component as a foundation for voice UI feedback. The component handles four states (idle, listening, processing, speaking) with animated bar logic and screen reader support. Uses existing theme colors and follows the same patterns as other UI components.

This is a UI building block, integration with the voice input pipeline will follow in a subsequent PR.

Related Issues

Related to #18067

How to Validate

cd packages/cli
npx vitest run src/ui/components/VoiceWaveformVisualizer.test.tsx
All tests should pass.

Pre-Merge Checklist

  • Updated relevant documentation and README (if needed)
  • Added/updated tests (if needed)
  • Noted breaking changes (if any)
  • Validated on required platforms/methods:
    • MacOS
      • npm run
      • npx
      • Docker
      • Podman
      • Seatbelt
    • Windows
      • npm run
      • npx
      • Docker
    • Linux
      • npm run
      • npx
      • Docker

@sakshisemalti sakshisemalti requested a review from a team as a code owner March 9, 2026 08:57
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a new VoiceWaveformVisualizer component, a foundational UI element designed to provide clear, animated feedback for various voice interaction states within the terminal. It ensures an intuitive user experience by visually representing listening, processing, and speaking states, while also integrating essential screen reader support for accessibility. This component is a building block for future voice input pipeline integrations.

Highlights

  • New Component: Introduced the VoiceWaveformVisualizer component to provide visual feedback for voice interaction states.
  • State Management: Implemented support for 'idle', 'listening', 'processing', and 'speaking' voice states.
  • Visual Feedback: Provided animated terminal waveform visualization for active voice states using block characters and dynamic heights.
  • Accessibility: Incorporated screen reader support with descriptive labels for each voice state, ensuring inclusivity.
Changelog
  • packages/cli/src/ui/components/VoiceWaveformVisualizer.test.tsx
    • Added new test cases for the VoiceWaveformVisualizer component, covering its rendering behavior across different voice states.
  • packages/cli/src/ui/components/VoiceWaveformVisualizer.tsx
    • Added the VoiceWaveformVisualizer component, implementing animated terminal feedback for voice interaction states and including screen reader accessibility.
Activity
  • The author, sakshisemalti, created this pull request to introduce a new voice waveform visualizer component.
  • New tests were added for the VoiceWaveformVisualizer component to ensure its correct functionality.
  • The author validated the changes on MacOS using npm run.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a VoiceWaveformVisualizer component. The implementation is mostly solid, but a critical issue was identified that causes an infinite render loop for non-animating states, which would likely freeze the application. A suggested fix for this problem is included in the review.

@gemini-cli gemini-cli bot added priority/p2 Important but can be addressed in a future release. area/core Issues related to User Interface, OS Support, Core Functionality help wanted We will accept PRs from all issues marked as "help wanted". Thanks for your support! labels Mar 9, 2026
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@sakshisemalti
Copy link
Copy Markdown
Contributor Author

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new VoiceWaveformVisualizer component. While well-structured, a critical issue exists where STATIC_HEIGHTS is used but undefined, causing a ReferenceError and preventing rendering. The comments highlight this and suggest defining these values as named constants to replace magic numbers, improving readability and maintainability as per repository guidelines.

VoiceWaveformVisualizerProps
> = ({ state }) => {
const isScreenReaderEnabled = useIsScreenReaderEnabled();
const [heights, setHeights] = useState<number[]>(STATIC_HEIGHTS);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

critical

The constant STATIC_HEIGHTS is used here but is not defined, which will cause a ReferenceError at runtime. To improve readability and maintainability, these values should be defined as a named constant (e.g., WAVEFORM_INITIAL_HEIGHTS) at the top of the file, replacing these magic numbers.

Suggested change
const [heights, setHeights] = useState<number[]>(STATIC_HEIGHTS);
const [heights, setHeights] = useState<number[]>([2, 3, 4, 3, 2]);
References
  1. Magic numbers, especially those used for layout or padding, should be replaced with named constants to improve readability and maintainability. This makes the intent clearer and simplifies future updates.


useEffect(() => {
if (state !== 'listening' && state !== 'speaking') {
setHeights(STATIC_HEIGHTS);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

critical

The constant STATIC_HEIGHTS is used here but is not defined, which will cause a ReferenceError. To avoid code duplication and improve readability, these values should be defined as a named constant (e.g., WAVEFORM_INITIAL_HEIGHTS) at the top of the file, replacing these magic numbers.

Suggested change
setHeights(STATIC_HEIGHTS);
setHeights([2, 3, 4, 3, 2]);
References
  1. Magic numbers, especially those used for layout or padding, should be replaced with named constants to improve readability and maintainability. This makes the intent clearer and simplifies future updates.

@jackwotherspoon
Copy link
Copy Markdown
Collaborator

Thanks for the PR!

There is already an open PR for this I believe: #21115

Going to close this as a duplicate, please take a look at the existing PR and feel free to add any comments or things you notice to help it 😄

@sakshisemalti
Copy link
Copy Markdown
Contributor Author

Thanks for the pointer! Will take a look at #21115 and see where I can contribute.

@sakshisemalti sakshisemalti deleted the feat/voice-waveform-visualizer branch March 16, 2026 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/core Issues related to User Interface, OS Support, Core Functionality help wanted We will accept PRs from all issues marked as "help wanted". Thanks for your support! priority/p2 Important but can be addressed in a future release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants