Feat: Add a think button to the chat box. #12742 (#12743)

### What problem does this PR solve?

Feat: Add a think button to the chat box. #12742
### Type of change


- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2026-01-21 15:39:18 +08:00
committed by GitHub
parent f98abf14a8
commit e1143d40bc
12 changed files with 190 additions and 149 deletions

View File

@ -68,8 +68,9 @@ const FloatingChatWidget = () => {
// Play sound when opening
const playNotificationSound = useCallback(() => {
try {
const audioContext = new (window.AudioContext ||
(window as any).webkitAudioContext)();
const audioContext = new (
window.AudioContext || (window as any).webkitAudioContext
)();
const oscillator = audioContext.createOscillator();
const gainNode = audioContext.createGain();
@ -95,8 +96,9 @@ const FloatingChatWidget = () => {
// Play sound for AI responses (Intercom-style)
const playResponseSound = useCallback(() => {
try {
const audioContext = new (window.AudioContext ||
(window as any).webkitAudioContext)();
const audioContext = new (
window.AudioContext || (window as any).webkitAudioContext
)();
const oscillator = audioContext.createOscillator();
const gainNode = audioContext.createGain();
@ -266,7 +268,7 @@ const FloatingChatWidget = () => {
// Wait for state to update, then send
setTimeout(() => {
handlePressEnter([]);
handlePressEnter({ enableThinking: false });
// Clear our local input after sending
setInputValue('');
}, 50);