-
Notifications
You must be signed in to change notification settings - Fork 4k
[feat] Integrate audio recording into ChatInput widget #12835
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
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
This stack of pull requests is managed by Graphite. Learn more about stacking. |
✅ PR preview is ready!
|
frontend/lib/src/components/widgets/AudioInput/AudioInput.test.tsx
Outdated
Show resolved
Hide resolved
📉 Python coverage change detectedThe Python unit test coverage has decreased by 0.0000%
✅ Coverage change is within normal range. Coverage by files
|
d8dc6fd to
d8de826
Compare
deb8f05 to
53062ef
Compare
d8de826 to
bcfdda6
Compare
662c525 to
fa19cbe
Compare
2109c8a to
7f52651
Compare
fa19cbe to
1d2cf42
Compare
7f52651 to
d8c8b84
Compare
1d2cf42 to
9c1fd45
Compare
d8c8b84 to
b68c2ad
Compare
b68c2ad to
bb13287
Compare
9c1fd45 to
5dbf8af
Compare
bb13287 to
f71021d
Compare
53b4659 to
9ba9e8d
Compare
| bottom: "0px", | ||
| // Calculate the right padding to account for button(s) on the right | ||
| // Each button is: iconSizes.xl + 2 * spacing.sm | ||
| // When acceptAudio is true, there are 2 buttons (mic + send) with extra margin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: My previous comment about re-structuring this so we aren't unnecessarily coupling this still stands: #12835
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea where this is being used actually. I was trying to tweak this earlier and get it to not overlap the placeholder text, but it wasn't changing anything and I found that the actual padding was coming from a paddingRight elsewhere. Let me see if this can be removed entirely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, gem from claude.
The wrapper exists solely to push the character count left to avoid the absolutely positioned buttons.
| onClick={() => { | ||
| handleRecordingApprove().catch(_error => { | ||
| // Error handling is done via controller events | ||
| }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion (non-blocking): This should be wrapped in a useCallback.
| onClick={(e: React.MouseEvent) => { | ||
| handleMicClick(e).catch(_error => { | ||
| // Error handling is done via controller events | ||
| }) | ||
| }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion (non-blocking): This should be wrapped in a useCallback.
317e4cf to
8ab4bd4
Compare
dc6bbd0 to
2f6226e
Compare
8ab4bd4 to
804f153
Compare
244738a to
41b2ef3
Compare
41b2ef3 to
e45c02d
Compare
Add audio recording capability to the ChatInput widget with waveform visualization and approve/cancel controls. Includes shared logger for ChatInput components. - Add WaveformController integration for live audio recording - Add recording state management and UI controls - Add shared logger.ts for ChatInput component logging - Add comprehensive test coverage for audio recording flow
Update AudioInput and useWaveformController to support being controlled externally by ChatInput. Changes include: - Add controllerRef pattern to allow parent components to access controller methods - Fix circular dependency by moving upload logic out of controller events - Add error handling comments for silent catch blocks - Update AudioInput test to match new controller pattern
Move StyledChatAudioWave from removed component library to widget's styled-components file and update import path.
- Consolidate styled-components imports into single block - Add empty line between import groups - Move StyledChatAudioWave to correct import location
When copying StyledChatAudioWave from PR7, we missed the width: 100% that was added in PR8's inline styles refactor. Without explicit width, the waveform collapses to 0 width and becomes invisible despite recording working.
When recording, use static positioning instead of absolute so buttons participate in flex layout alongside waveform. This fixes overlapping layout issues.
Add acceptAudio prop to StyledInputInstructionsContainer to account for both mic and send buttons when audio is enabled. Doubles the right padding calculation from 1 button to 2 buttons to prevent overlap.
Add extra spacing.sm to account for the gap between mic and send buttons when calculating right padding for InputInstructions.
Double the final margin from spacing.sm to 2*spacing.sm when acceptAudio is true to prevent overlap with mic button.
Apply the same conditional padding logic to the textarea input that we use for InputInstructions - account for 2 buttons when acceptAudio is true.
804f153 to
ddd2d4a
Compare
e45c02d to
34fbfe4
Compare
Remove extra spacing.sm margin - 80px (2 × 40px buttons) is sufficient padding.
ddd2d4a to
ee72aaf
Compare
Merge activity
|

Describe your changes
This PR refactors the AudioInput component and adds audio recording capabilities to the ChatInput component:
In AudioInput:
In ChatInput:
Testing Plan
Contribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.