iachat/app/javascript/dashboard/helper
Rodribm10 4b0e8c314e feat(aggressive-alert): escalada amarelo/laranja/vermelho + toggles
Banner agressivo passa de uma notificação só ("status→open") pra
um sistema de escalada baseado em inatividade quando o cliente é
o último a falar.

Níveis:
- 5 min sem resposta  → AMARELO, sem som
- 15 min sem resposta → LARANJA, beep 1x + notificação do SO
- 28 min sem resposta → VERMELHO pulsante + som em loop infinito
- status→open (reabertura) → VERMELHO imediato

Por conversa, o banner mostra um item com nome do contato, inbox
e contexto ("reabriu agora" / "15 min sem resposta"). Headline
grande e explicação clara sobre como limpa.

Comportamento do × dismiss:
- Antes: apagava o alerta de vez. Agente podia "fingir que viu".
- Agora: esconde temporariamente. Volta quando escalar (próximo
  threshold) ou nova mensagem. A única forma de LIMPAR de vez é
  responder o cliente (tracker detecta msg outgoing do User ou
  AgentBot e chama dismissForReply).

Permissões:
- account.settings.aggressive_alert_enabled (master switch admin)
- user.ui_settings.aggressive_alert_enabled (toggle do próprio agente)
- Default true pros dois; um false em qualquer bloqueia alertas.

Settings UI:
- Conta → General: novo card "Alerta agressivo (master switch)"
- Perfil do usuário: novo card "Receber alertas agressivos"

Arquivos:
- helper/aggressiveAlert.js: multi-level state, hide vs dismiss-for-reply
- helper/inactivityAlertTracker.js: timer único, thresholds declarativos
- helper/actionCable.js: hook em onMessageCreated (feed tracker) +
  isAggressiveAlertEnabled() + limpa tracker em status_changed != open
- components/app/AggressiveConversationBanner.vue: variantes de cor,
  headline grande, explanation, × temp-hide
- account.rb + accounts_controller.rb: store_accessor + permitted
- settings UI components (account + profile): switches auto-persist

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 20:49:24 -03:00
..
AnalyticsHelper feat: add captain editor events (#13524) 2026-02-17 13:26:56 +05:30
AudioAlerts feat: handle mine event for incoming messages (#10867) 2025-02-11 17:45:31 +05:30
CacheHelper feat: fallback to DB localStorage for idb names (#8682) 2024-01-15 15:08:15 +05:30
commandbar feat: Rewrite command bar mixin to a composable (#10015) 2024-08-26 15:55:59 +05:30
specs Merge branch 'main' into chore/merge-upstream-4.11.0 2026-02-17 23:05:26 -03:00
actionCable.js feat(aggressive-alert): escalada amarelo/laranja/vermelho + toggles 2026-04-23 20:49:24 -03:00
actionQueryGenerator.js feat: mensagens agendadas (#198) 2026-01-30 22:08:16 -03:00
agentHelper.js fix: Translate "None" option in agent assignment dropdown (#11060) 2025-03-11 14:49:27 -07:00
aggressiveAlert.js feat(aggressive-alert): escalada amarelo/laranja/vermelho + toggles 2026-04-23 20:49:24 -03:00
APIHelper.js fix: Allow users to login even if they have access to more than 15 accounts (#4475) 2022-04-14 20:54:26 +05:30
auditlogHelper.js feat: Add conversation delete feature (#11677) 2025-06-05 15:53:17 -05:00
automationHelper.js Merge branch 'main' into chore/merge-upstream-4.11.0 2026-02-17 23:05:26 -03:00
commons.js feat: Agent assignment policy index page with CRUD actions (#12373) 2025-09-10 12:07:21 +05:30
conversationHelper.js fix: TypeError: t.messages.at is not a function (#9950) 2024-08-13 19:16:15 +05:30
customViewsHelper.js feat: Add support for frontend filtering of conversations (#11111) 2025-03-24 19:39:04 -07:00
DOMHelpers.js feat: add promise based loader for FB script (#9780) 2024-07-22 11:32:05 +05:30
downloadHelper.js feat: Add business hours in downloadable reports (#4674) 2022-05-27 09:26:59 +05:30
editorHelper.js Merge branch 'main' into chore/merge-upstream-4.11.0 2026-02-17 23:05:26 -03:00
emailQuoteExtractor.js feat: sanitize html before assiging it to tempDiv (#13252) 2026-01-12 22:41:37 +05:30
featureHelper.js feat: add global config for captain settings (#13141) 2026-01-12 19:54:19 +05:30
filterQueryGenerator.js chore: Support multiple values for automation message content (#7871) 2023-09-19 13:04:58 +05:30
flag.js chore: Replace packages with native functions (#5140) 2022-08-03 17:08:21 +05:30
inactivityAlertTracker.js feat(aggressive-alert): escalada amarelo/laranja/vermelho + toggles 2026-04-23 20:49:24 -03:00
inbox.js feat: TikTok channel (#12741) 2025-12-17 07:54:50 -08:00
labelColor.js feat: Create portal UI improvements (#5261) 2022-08-18 17:11:19 +05:30
permissionsHelper.js chore: Remove older UI (#11720) 2025-07-01 09:43:44 +05:30
portalHelper.js chore: Remove older UI (#11720) 2025-07-01 09:43:44 +05:30
preChat.js feat: Support Regex validation for custom attributes (#7856) 2024-01-23 18:01:57 +04:00
pushHelper.js feat: Log push notification error (#12543) 2025-09-29 15:19:45 +05:30
quotedEmailHelper.js feat: sanitize html before assiging it to tempDiv (#13252) 2026-01-12 22:41:37 +05:30
ReconnectService.js feat: Vite + vue 3 💚 (#10047) 2024-10-02 00:36:30 -07:00
routeHelpers.js chore: Custom Roles to manage permissions [ UI ] (#9865) 2024-09-17 11:40:11 -07:00
scriptHelpers.js Chore/merge upstream 4.8.0 (#150) 2025-11-19 16:25:58 -03:00
snoozeHelpers.js feat(v4): Update Inbox view card design (#10599) 2025-01-07 21:11:54 +05:30
states.js Move src to dashboard (#152) 2019-10-16 14:36:17 +05:30
templateHelper.js feat: Add media_name support for WhatsApp templates document files (#12462) 2025-09-18 15:25:31 +05:30
themeHelper.js feat: Support bigger font size in dashboard (#10974) 2025-02-27 12:10:33 +05:30
Timer.js feat: Voice Channel (#11602) 2025-12-19 12:41:33 -08:00
uploadHelper.js feat: Add the ability to paste images to editor (#10072) 2024-09-11 09:44:13 +05:30
URLHelper.js feat: Adiciona configuração Active Storage proxy, refatora serviço de decriptografia WhatsApp para processar bytes diretamente e ajusta componentes de mídia. 2026-02-28 12:48:17 -03:00
validations.js Merge branch 'main' into chore/merge-upstream-4.11.0 2026-02-17 23:05:26 -03:00
voice.js feat: Voice Channel (#11602) 2025-12-19 12:41:33 -08:00