ποΈ Fluxo: O Que Acontece Quando Para a GravaΓ§Γ£o de Γudio
Documents two different flows for stopping audio recording in a meeting app, one automatic and one manual, with visual feedback and data generation.
What this file does
Documents two different flows for stopping audio recording in a meeting app, one automatic and one manual, with visual feedback and data generation.
When to use it
- You need to understand the difference between stopping recording from a floating button vs a canvas node
- You want to implement automatic node generation after recording stops
- You need to add WhatsApp notifications after processing meeting audio
- You are designing visual feedback for recording and processing states
Assumes this stack
ποΈ Fluxo: O Que Acontece Quando Para a GravaΓ§Γ£o de Γudio
π Componentes Envolvidos
1. MeetingAI.tsx - BotΓ£o Flutuante
LocalizaΓ§Γ£o: Canto inferior da tela
2. MeetingNode.tsx - NΓ³ de ReuniΓ£o no Canvas
LocalizaΓ§Γ£o: Canvas do React Flow
π FLUXO COMPLETO
Quando vocΓͺ para a gravaΓ§Γ£o no MeetingAI (botΓ£o flutuante):
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 1. UsuΓ‘rio clica em "Parar Alinhamento" β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 2. stopRecording() Γ© executado β
β - setStatus('processing') β
β - setIsRecording(false) β
β - AnimaΓ§Γ£o de waveform desaparece β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 3. Processamento de IA (3 segundos) β
β - Status muda para "Processando IA..." β
β - Badge aparece: "Analisando contexto editorial..." β
β - BotΓ£o fica desabilitado β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 4. IA Processa o Γudio β
β - TranscriΓ§Γ£o do Γ‘udio β
β - ExtraΓ§Γ£o de entidades (tarefas, prazos, etc.) β
β - GeraΓ§Γ£o de JSON estruturado β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 5. autoGenerateNodesFromMeeting() Γ© chamado β
β - Cria nΓ³s de tarefas no canvas β
β - Conecta ao nΓ³ de reuniΓ£o β
β - Adiciona checklists, deadlines, assignees β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 6. Status volta para 'idle' β
β - BotΓ£o volta ao estado inicial β
β - Pronto para nova gravaΓ§Γ£o β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π DADOS GERADOS
Mock Result (Exemplo):
{
campaignName: "LanΓ§amento NewsFlow V4.1",
tasks: [
{
label: "ProduΓ§Γ£o de VΓdeo Teaser",
assignee: "Video Edit",
deadline: "2024-01-10",
checklist: ["Roteiro", "GravaΓ§Γ£o", "EdiΓ§Γ£o Final"]
},
{
label: "Copywriting para Landing Page",
assignee: "Copywriter",
deadline: "2024-01-09",
checklist: ["Headline", "BenefΓcios", "CTA"]
},
{
label: "Setup de Ads (IG/FB)",
assignee: "Traffic Manager",
deadline: "2024-01-11",
checklist: ["PΓΊblicos", "Criativos", "Pixel"]
}
]
}
π― Quando vocΓͺ para a gravaΓ§Γ£o no MeetingNode (nΓ³ no canvas):
Fluxo Diferente:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 1. UsuΓ‘rio clica em "Parar GravaΓ§Γ£o" β
β - setIsRecording(false) β
β - BotΓ£o volta para "Gravar Γudio" β
β - β NΓO processa automaticamente β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 2. UsuΓ‘rio precisa clicar em "IA: Gerar Ata & Tarefas" β
β - handleProcessIA() Γ© executado β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 3. Processamento de IA (3 segundos) β
β - Gera transcript β
β - Extrai taskList β
β - Atualiza nΓ³ de reuniΓ£o β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 4. autoGenerateNodesFromMeeting(id) β
β - Cria nΓ³s filhos conectados β
β - Cada tarefa vira um nΓ³ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 5. WhatsAppAlerts.sendMeetingMinute() β
β - Envia ata da reuniΓ£o via WhatsApp β
β - Notifica stakeholders β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π DETALHES TΓCNICOS
MeetingAI.tsx - stopRecording()
const stopRecording = () => {
setStatus('processing'); // Muda para processando
setIsRecording(false); // Para a gravaΓ§Γ£o
// SimulaΓ§Γ£o de processamento (3 segundos)
setTimeout(async () => {
const mockResult = {
campaignName: "...",
tasks: [...]
};
await autoGenerateNodesFromMeeting(mockResult);
setStatus('idle');
}, 3000);
};
MeetingNode.tsx - handleProcessIA()
const handleProcessIA = async () => {
setIsProcessingIA(true);
// Processa Γ‘udio
setTimeout(async () => {
const updatePayload = {
transcript: "...",
taskList: [...],
isProcessing: false,
status: 'done'
};
// 1. Atualiza nΓ³
updateNodeData(id, updatePayload);
// 2. Gera nΓ³s filhos
await autoGenerateNodesFromMeeting(id);
// 3. Envia WhatsApp
await WhatsAppAlerts.sendMeetingMinute(...);
}, 3000);
};
π DIFERENΓAS ENTRE OS DOIS
| Aspecto | MeetingAI (Flutuante) | MeetingNode (Canvas) |
|---|---|---|
| Processamento AutomΓ‘tico | β Sim (3s apΓ³s parar) | β NΓ£o (precisa clicar) |
| GeraΓ§Γ£o de NΓ³s | β Sim | β Sim |
| Envio WhatsApp | β NΓ£o | β Sim |
| AtualizaΓ§Γ£o do NΓ³ | β NΓ£o | β Sim |
| Transcript | β NΓ£o salvo | β Salvo no nΓ³ |
π¨ FEEDBACK VISUAL
Durante GravaΓ§Γ£o:
- β AnimaΓ§Γ£o de waveform (12 barras animadas)
- β BotΓ£o vermelho com Γcone de stop
- β Texto: "Gravando Γudio..."
ApΓ³s Parar (Processing):
- β Badge flutuante: "Analisando contexto editorial..."
- β BotΓ£o com spinner (Loader2)
- β Texto: "Processando IA..."
- β BotΓ£o desabilitado
ApΓ³s Processar:
- β NΓ³s aparecem no canvas
- β Status volta para 'idle'
- β BotΓ£o volta ao estado inicial
π INTEGRAΓΓO COM STORE
autoGenerateNodesFromMeeting()
LocalizaΓ§Γ£o: store.ts (linha 328)
O que faz:
- Busca o nΓ³ de reuniΓ£o
- Cria novos nΓ³s para cada tarefa
- Conecta os nΓ³s ao nΓ³ de reuniΓ£o
- Adiciona checklists, deadlines, assignees
- Persiste no Supabase
π PRΓXIMOS PASSOS (Melhorias Futuras)
-
GravaΓ§Γ£o Real de Γudio
- Usar MediaRecorder API
- Salvar arquivo de Γ‘udio
- Enviar para serviΓ§o de transcriΓ§Γ£o
-
IntegraΓ§Γ£o com IA Real
- Google Speech-to-Text
- Gemini para extraΓ§Γ£o de entidades
- Processamento em tempo real
-
NotificaΓ§Γ΅es
- Toast quando processamento terminar
- Som de conclusΓ£o
- Badge de notificaΓ§Γ£o
β Fluxo completo documentado!
What's inside
Two flow diagrams, a mock data example, technical code snippets, a comparison table, visual feedback details, and future improvements list.
Change this for your project
- Replace
autoGenerateNodesFromMeetingwith your own node generation function - Replace
WhatsAppAlerts.sendMeetingMinutewith your notification service - Replace mock data structure
{ campaignName, tasks }with your own data model - Replace
setTimeoutdelays (3000ms) with actual async processing
Where it goes
Keep it in your repository where the agent or team that needs it will read it.
Worth borrowing
- Using a status state machine (idle β processing β idle) to control UI and disable buttons
- Separating automatic processing (floating button) from manual processing (canvas node) for different user expectations
- Providing a comparison table to highlight differences between two similar flows
Related Documents
Product Requirements Document: B2B SaaS Landing Page
Defines 12 page sections, a visual style guide, and technical requirements for a B2B SaaS landing page.
SignKit Complete Marketing & Distribution Strategy
Outlines a 14-month marketing and distribution plan to reach 2,200 customers and $80,000 revenue for a desktop signature extraction app.
π£ Marketing Prompts
Provides eight structured prompt templates for marketing tasks including SEO, ad copy, landing pages, email campaigns, social media, content calendars, brand voice, and customer personas.
UI Preview Guide
Shows ASCII mockups of a landing page, admin dashboard, and login screen for a farming community app, plus design tokens and testing steps.