(role, text, muted)
| 481 | } |
| 482 | |
| 483 | function appendMessage(role, text, muted) { |
| 484 | if (!logEl) return; |
| 485 | const row = document.createElement('div'); |
| 486 | row.className = 'fr-share-copilot-msg ' + (role === 'user' ? 'is-user' : 'is-assistant') + (muted ? ' is-muted' : ''); |
| 487 | |
| 488 | const label = document.createElement('div'); |
| 489 | label.className = 'fr-share-copilot-msg-label'; |
| 490 | label.textContent = role === 'user' ? 'You' : 'AI Assistant'; |
| 491 | |
| 492 | const body = document.createElement('div'); |
| 493 | body.className = 'fr-share-copilot-msg-body'; |
| 494 | body.textContent = String(text || '').trim(); |
| 495 | |
| 496 | row.appendChild(label); |
| 497 | row.appendChild(body); |
| 498 | logEl.appendChild(row); |
| 499 | logEl.scrollTop = logEl.scrollHeight; |
| 500 | } |
| 501 | |
| 502 | function setSuggestions(items) { |
| 503 | if (!suggestionsEl) return; |
no outgoing calls
no test coverage detected