fix(chat): show follow-up chips on ALL assistant messages, not just streaming
Some checks are pending
NordaBiz Tests / Unit & Integration Tests (push) Waiting to run
NordaBiz Tests / E2E Tests (Playwright) (push) Blocked by required conditions
NordaBiz Tests / Smoke Tests (Production) (push) Blocked by required conditions
NordaBiz Tests / Send Failure Notification (push) Blocked by required conditions

This commit is contained in:
Maciej Pienczyn 2026-03-28 15:34:28 +01:00
parent b308a80332
commit 036c959102

View File

@ -2727,6 +2727,20 @@ function addMessage(role, content, animate = true, techInfo = null) {
}
}
// Add follow-up chips to the LAST assistant message
if (role === 'assistant') {
// Remove chips from any previous assistant message
document.querySelectorAll('.follow-up-suggestions').forEach(el => el.remove());
const suggestions = document.createElement('div');
suggestions.className = 'follow-up-suggestions';
suggestions.innerHTML = `
<button class="suggestion-chip small" onclick="sendSuggestion('Podaj telefony i strony WWW TYLKO do firm które polecileś powyżej — nie dodawaj żadnych innych')">&#x1F4DE; Kontakt do poleconych</button>
<button class="suggestion-chip small" onclick="sendSuggestion('Powiedz więcej o tych firmach — czym się dokładnie zajmują i dlaczego pasują')">&#x1F4CB; Więcej szczegółów</button>
<button class="suggestion-chip small" onclick="sendSuggestion('Jakie inne firmy z Izby mogłyby pomóc w tym temacie?')">&#x1F50D; Inne firmy</button>
`;
contentDiv.appendChild(suggestions);
}
messageDiv.appendChild(avatar);
messageDiv.appendChild(contentDiv);