it0/it0_app/lib/features
hailin 55b983a950 feat(it0_app): add WhatsApp-style voice message with async agent interrupt
New VoiceMicButton widget (press-and-hold to record, release to send):
- Records audio to a temp .m4a file via the `record` package
- Slide-up gesture cancels recording without sending
- Pulsing red mic icon + "松开发送/松开取消" feedback during recording

New flow for voice messages:
  1. Temp "🎤 识别中..." bubble shown immediately
  2. Audio uploaded to POST /api/v1/agent/sessions/:id/voice-message
     (multipart/form-data; backend runs Whisper STT)
  3. Placeholder replaced with real transcript
  4. WS stream subscribed via new subscribeExistingTask() to receive
     agent's streaming response — same pipeline as text chat

Voice messages act as async interrupts: if the agent is mid-task the
backend hard-cancels it before processing the new voice command,
so whoever presses the mic button always takes priority.

Files changed:
  chat_remote_datasource.dart — sendVoiceMessage() multipart upload
  chat_repository.dart        — subscribeExistingTask() interface method
  chat_repository_impl.dart   — implement subscribeExistingTask(); fix
                                sendVoiceMessage() stub
  chat_providers.dart         — ChatNotifier.sendVoiceMessage()
  voice_mic_button.dart       — NEW press-and-hold recording widget
  chat_page.dart              — mic button added to input area

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-06 03:20:41 -08:00
..
agent_call docs: add detailed comments for thinking state indicator mechanism 2026-03-03 06:13:54 -08:00
alerts refactor: 移除 AppBar 刷新按钮,统一使用下拉刷新 2026-02-23 05:08:16 -08:00
approvals refactor: 移除 AppBar 刷新按钮,统一使用下拉刷新 2026-02-23 05:08:16 -08:00
auth feat: 生产级 API 错误处理 — 重试拦截器、友好错误提示、网络监测、WebSocket 退避 2026-02-23 04:01:04 -08:00
billing/presentation feat: implement complete commercial monetization loop (Phases 1-4) 2026-03-03 21:09:17 -08:00
chat feat(it0_app): add WhatsApp-style voice message with async agent interrupt 2026-03-06 03:20:41 -08:00
dashboard refactor: 移除 AppBar 刷新按钮,统一使用下拉刷新 2026-02-23 05:08:16 -08:00
notifications feat: 完成 iAgent App 三大功能 + 修复租户上下文 2026-02-23 01:10:52 -08:00
servers refactor: 移除 AppBar 刷新按钮,统一使用下拉刷新 2026-02-23 05:08:16 -08:00
settings feat: implement complete commercial monetization loop (Phases 1-4) 2026-03-03 21:09:17 -08:00
standing_orders feat: add app upgrade system with self-hosted APK update support 2026-02-26 22:35:01 -08:00
tasks feat: add app upgrade system with self-hosted APK update support 2026-02-26 22:35:01 -08:00
terminal fix: translate all remaining English UI strings to Chinese and remove dead code 2026-02-23 02:07:57 -08:00