fix(botui): ensure heuristic switchers are correctly identified
All checks were successful
Botlib CI / build (push) Successful in 2s
BotServer CI / build (push) Successful in 2m19s
Bottest CI / build (push) Successful in 20s
BotUI CI / build (push) Successful in 20s

This commit is contained in:
Rodrigo Rodriguez (Pragmatismo) 2026-04-22 22:56:10 -03:00
parent 47412722fe
commit 42c22cfcab

View file

@ -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";