Skip to content

feat(cli): Add AudioWaveform visualizer component for Voice Mode#21186

Closed
lucumango wants to merge 4 commits intogoogle-gemini:mainfrom
lucumango:feat/voice-audio-waveform
Closed

feat(cli): Add AudioWaveform visualizer component for Voice Mode#21186
lucumango wants to merge 4 commits intogoogle-gemini:mainfrom
lucumango:feat/voice-audio-waveform

Conversation

@lucumango
Copy link
Copy Markdown

Fixes #21109. This adds the AudioWaveform component and tests.

@lucumango lucumango requested a review from a team as a code owner March 5, 2026 00:44
@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 enhances the CLI's Voice Mode by introducing a visual AudioWaveform component, offering clear feedback on the current audio state. Concurrently, it resolves a critical issue with PowerShell command execution on Windows by enforcing UTF-8 encoding, thereby improving the reliability and consistency of output handling within the shell execution service.

Highlights

  • New AudioWaveform Component: A new AudioWaveform React component has been added to the CLI, designed to provide visual feedback for various audio states within Voice Mode, such as idle, listening, processing, speaking, and error.
  • PowerShell UTF-8 Encoding Fix: The ShellExecutionService has been updated to explicitly configure PowerShell commands to use UTF-8 output encoding. This change prevents potential character misinterpretation issues, particularly on Windows systems with different default code pages.
  • Comprehensive Testing: New unit and snapshot tests were introduced for the AudioWaveform component to ensure its correct rendering across different states and amplitudes. Additionally, tests for the ShellExecutionService were updated to verify the proper application of the PowerShell UTF-8 encoding prefix.
Changelog
  • packages/cli/src/ui/components/AudioWaveform.test.tsx
    • Added a new test file for the AudioWaveform component, including tests for various states and snapshot comparisons.
  • packages/cli/src/ui/components/AudioWaveform.tsx
    • Added the AudioWaveform React component, which visualizes audio amplitudes and states using block characters.
  • packages/cli/src/ui/components/snapshots/AudioWaveform.test.tsx.snap
    • Added snapshot test files for the AudioWaveform component to capture expected rendering outputs.
  • packages/core/src/services/shellExecutionService.test.ts
    • Updated PowerShell command tests to include the new UTF-8 encoding prefix in the expected command arguments.
  • packages/core/src/services/shellExecutionService.ts
    • Modified the ShellExecutionService to incorporate the ensurePowerShellUtf8Encoding utility when preparing commands for execution via both cpSpawn and ptySpawn.
  • packages/core/src/utils/shell-utils.test.ts
    • Added new unit tests for the ensurePowerShellUtf8Encoding utility function, verifying its behavior for PowerShell and other shell types.
  • packages/core/src/utils/shell-utils.ts
    • Introduced ensurePowerShellUtf8Encoding utility function to prepend UTF-8 encoding configuration to PowerShell commands.
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.

@gemini-cli gemini-cli bot added 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 5, 2026
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 AudioWaveform component for voice mode and includes a fix for PowerShell output encoding on Windows. A security audit found no high or critical severity vulnerabilities. However, a potential crash scenario was identified related to the width prop not being sanitized in the new AudioWaveform component, and feedback focuses on making this component more robust.

@lucumango
Copy link
Copy Markdown
Author

Thanks @gemini-code-assist! Great catch on the unbounded width array instantiation. I've updated the component to sanitize the width with Math.max(0, Math.floor(width)) to prevent RangeErrors.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Thanks for the update, @lucumango. The addition of Math.max(0, Math.floor(propsWidth)) correctly ensures that the width is a non-negative integer, which effectively prevents potential RangeErrors during array instantiation.

@ayush31010

This comment was marked as spam.

@jackwotherspoon
Copy link
Copy Markdown
Collaborator

Yes I re-assigned the parent issue to @Solventerritory 👍

As mentioned #21115 is already for this.

@lucumango It is important to look to see if an issue has an existing PR linked prior to starting work on PRs.

This helps limit duplicate work, thanks!

@lucumango
Copy link
Copy Markdown
Author

Got it, sorry for the confusion and the duplicate work. I'm still getting the hang of the workflow and will make sure to check for linked PRs and assignees more thoroughly next time :)

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!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(voice): add animated waveform visualizer for voice mode state feedback

3 participants