From 42c22cfcabbc9fcb44a2ad8abb0a6f625d8a58d0 Mon Sep 17 00:00:00 2001 From: "Rodrigo Rodriguez (Pragmatismo)" Date: Wed, 22 Apr 2026 22:56:10 -0300 Subject: [PATCH] fix(botui): ensure heuristic switchers are correctly identified --- botui/ui/suite/chat/chat.html | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/botui/ui/suite/chat/chat.html b/botui/ui/suite/chat/chat.html index 6d59f5c1..d8938432 100644 --- a/botui/ui/suite/chat/chat.html +++ b/botui/ui/suite/chat/chat.html @@ -972,14 +972,15 @@ function hideThinkingIndicator() { var chip = document.createElement("button"); // More robust switcher detection: check action type or context/switcher fields - var isSwitcher = (suggestion.type === "switcher") || (action && ( - action.type === "switch_context" || - action.type === "select_context" || - action.type === "switcher" || - suggestion.text.toLowerCase().includes("tabela") || // Heuristic for current bot - action.switcher || - action.context - )); + var isSwitcher = (suggestion.type === "switcher") || + (suggestion.text && suggestion.text.toLowerCase().includes("tabela")) || // Heuristic for current bot + (action && ( + action.type === "switch_context" || + action.type === "select_context" || + action.type === "switcher" || + action.switcher || + action.context + )); chip.className = isSwitcher ? "switcher-chip" : "suggestion-chip";