|
1 | | -<!DOCTYPE html> |
| 1 | +<!DOCTYPE html> |
2 | 2 | <html lang="en"> |
3 | 3 |
|
4 | 4 | <head> |
|
33 | 33 | <div class="status-label" id="status-label">Connected</div> |
34 | 34 | <!-- <button id="btn-theme-toggle" type="button" onclick="toggleTheme()">Light</button> --> |
35 | 35 | <!-- <button id="btn-settings" type="button" onclick="openSettingsModal()" title="MCP Server Settings" |
36 | | - style="background: transparent; border: 1px solid var(--border-light); border-radius: 8px; font-size: 16px; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-1); margin-left: 8px; transition: background 0.15s;">⚙️</button> --> |
| 36 | + style="background: transparent; border: 1px solid var(--border-light); border-radius: 8px; font-size: 16px; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-1); margin-left: 8px; transition: background 0.15s;">☑️</button> --> |
37 | 37 | <button id="btn-theme-toggle" type="button" title="Switch to light theme" aria-label="Switch theme" onclick="toggleTheme()"> |
38 | 38 | <!-- Sun icon — shown in dark mode (switch to light) --> |
39 | 39 | <svg id="theme-icon-sun" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> |
|
1064 | 1064 | promptHeader.querySelector('.msg-sys-prompt-chevron').innerHTML = !expanded ? '▲' : '▼'; |
1065 | 1065 | promptHeader.querySelector('.msg-sys-prompt-label').textContent = !expanded |
1066 | 1066 | ? 'Thread Instructions (system)' |
1067 | | - : 'Thread Instructions (system) — click to expand'; |
| 1067 | + : 'Thread Instructions (system) u{2014} click to expand'; |
1068 | 1068 | }); |
1069 | 1069 |
|
1070 | 1070 | wrapper.appendChild(promptHeader); |
|
1115 | 1115 |
|
1116 | 1116 | const authorLabel = String(m.author_name ?? m.author ?? '').trim() || 'unknown'; |
1117 | 1117 | const isSystem = String(m.role ?? '').toLowerCase() === 'system' || authorLabel.toLowerCase() === 'system'; |
1118 | | - const isHuman = authorLabel.toLowerCase() === 'human'; |
| 1118 | + const isHuman = !m.author_id && ( |
| 1119 | + authorLabel.toLowerCase() === 'human' |
| 1120 | + || String(m.role ?? '').toLowerCase() === 'user' |
| 1121 | + ); |
1119 | 1122 | const authorKey = isHuman ? 'human' : (isSystem ? 'system' : String(m.author_id ?? authorLabel)); |
1120 | 1123 | const color = authorColor(authorKey); |
1121 | 1124 | const avatarEmoji = String(m.author_emoji || '').trim() |
1122 | 1125 | || String(currentAgents?.find((a) => a.id === String(m.author_id ?? ''))?.emoji || '').trim() |
1123 | | - || (isHuman ? '👤' : (isSystem ? '⚙️' : '🤖')); |
| 1126 | + || (isHuman ? '👤' : (isSystem ? '☑️' : '🤖')); |
1124 | 1127 | const bgAlpha = `${color}22`; // ~13% alpha tint for avatar bg |
1125 | 1128 | const isAgentMessage = !isHuman && !isSystem; |
1126 | 1129 | const sentAtLabel = fmtTime(m.created_at); |
|
1400 | 1403 |
|
1401 | 1404 | function getStateEmoji(state) { |
1402 | 1405 | const map = { 'Offline': '⚫', 'Waiting': '⏳', 'Active': '🟢' }; |
1403 | | - return map[state] || 'Γ¥ô'; |
| 1406 | + return map[state] || '❓'; |
1404 | 1407 | } |
1405 | 1408 |
|
1406 | 1409 | // ============================================================================================== |
|
1435 | 1438 | // Extras: thread state & close (REST shims) |
1436 | 1439 | // ============================================================================================== |
1437 | 1440 | // Extend the REST API with two extra POST endpoints that main.py may serve later. |
1438 | | - // If they 404, we silently ignore ΓÇö the MCP tool path is the canonical way. |
| 1441 | + // If they 404, we silently ignore — the MCP tool path is the canonical way. |
1439 | 1442 |
|
1440 | 1443 | // ============================================================================================== |
1441 | 1444 | // Utilities |
|
0 commit comments