fix(botui): dynamic switchers styling and custom prompt injection

This commit is contained in:
Rodrigo Rodriguez (Pragmatismo) 2026-04-22 22:37:46 -03:00 committed by Rodrigo Rodriguez (Pragmatismo)
parent 3a05600b78
commit 7a5cbf9e8f

View file

@ -970,17 +970,8 @@ function hideThinkingIndicator() {
}
}
var chip = document.createElement("button");
// More robust switcher detection: check action type or context/switcher fields
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
));
var chip = document.createElement("button");
chip.className = "suggestion-chip";
chip.className = isSwitcher ? "switcher-chip" : "suggestion-chip";