feat(diagnostic): GPS-Position als Debug-Block in Chat einblendbar
Toggle 'GPS-Position einblenden' rechts neben 'TTS-Text einblenden'. Wenn aktiv und ein chat-Event hat ein location-Feld, erscheint unter der Bubble ein gruener Block mit lat/lon — Klick oeffnet OpenStreetMap am Punkt. Nur Diagnostic, keine Anzeige in der App. Der Block taucht nur bei User-/STT-/Diagnostic-Nachrichten auf (sender != aria), weil aria-core sich nicht selbst lokalisiert. Toggle-State wird in localStorage persistiert (aria-show-gps-debug). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
+29
-2
@@ -278,6 +278,10 @@
|
||||
<input type="checkbox" id="tts-debug-toggle" onchange="toggleTtsDebug()" style="margin-right:4px;vertical-align:middle;">
|
||||
TTS-Text einblenden
|
||||
</label>
|
||||
<label style="color:#8888AA;font-size:11px;cursor:pointer;">
|
||||
<input type="checkbox" id="gps-debug-toggle" onchange="toggleGpsDebug()" style="margin-right:4px;vertical-align:middle;">
|
||||
GPS-Position einblenden
|
||||
</label>
|
||||
<button class="btn secondary" onclick="toggleChatFullscreen()" id="btn-chat-fs" style="padding:4px 10px;font-size:11px;">Vollbild</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1004,7 +1008,7 @@
|
||||
if (sender === 'aria') return;
|
||||
const chatType = 'sent';
|
||||
const label = sender === 'stt' ? '\uD83C\uDFA4 Spracheingabe' : `via RVS (${sender})`;
|
||||
addChat(chatType, p.text || '?', label);
|
||||
addChat(chatType, p.text || '?', label, { location: p.location });
|
||||
return;
|
||||
}
|
||||
if (msg.type === 'proxy_result') {
|
||||
@@ -1395,6 +1399,16 @@
|
||||
if (el) el.checked = showTtsDebug;
|
||||
}
|
||||
|
||||
// Debug-Toggle: GPS-Position unter User-Nachrichten einblenden (nur Diagnostic).
|
||||
// App zeigt's bewusst nicht — die Position geht nur an aria-core.
|
||||
let showGpsDebug = localStorage.getItem('aria-show-gps-debug') === '1';
|
||||
function toggleGpsDebug() {
|
||||
showGpsDebug = !showGpsDebug;
|
||||
localStorage.setItem('aria-show-gps-debug', showGpsDebug ? '1' : '0');
|
||||
const el = document.getElementById('gps-debug-toggle');
|
||||
if (el) el.checked = showGpsDebug;
|
||||
}
|
||||
|
||||
// Minimal-JS-Port von clean_text_for_tts() (Bridge) — reine Anzeige
|
||||
function previewTtsText(text) {
|
||||
if (!text) return '';
|
||||
@@ -1434,7 +1448,18 @@
|
||||
ttsBlock = `<div style="margin-top:6px;padding:4px 8px;background:rgba(0,150,255,0.08);border-left:2px solid #0096FF;font-size:11px;color:#88AACC;"><span style="color:#0096FF;font-weight:bold;">TTS:</span> ${escapeHtml(ttsText)}</div>`;
|
||||
}
|
||||
}
|
||||
const html = `${linked}${ttsBlock}<div class="meta">${escapeHtml(meta)} — ${new Date().toLocaleTimeString('de-DE')}</div>`;
|
||||
// Optional: GPS-Position als Block unter User-Nachrichten (nur Diagnostic)
|
||||
let gpsBlock = '';
|
||||
if (showGpsDebug && options && options.location) {
|
||||
const loc = options.location;
|
||||
const lat = typeof loc.lat === 'number' ? loc.lat.toFixed(6) : '?';
|
||||
const lon = typeof loc.lon === 'number' ? loc.lon.toFixed(6) : (typeof loc.lng === 'number' ? loc.lng.toFixed(6) : '?');
|
||||
if (lat !== '?' && lon !== '?') {
|
||||
const mapLink = `https://www.openstreetmap.org/?mlat=${lat}&mlon=${lon}#map=16/${lat}/${lon}`;
|
||||
gpsBlock = `<div style="margin-top:6px;padding:4px 8px;background:rgba(52,199,89,0.08);border-left:2px solid #34C759;font-size:11px;color:#88BB99;"><span style="color:#34C759;font-weight:bold;">📍 GPS:</span> <a href="${mapLink}" target="_blank" rel="noopener" style="color:#88BB99;text-decoration:underline;">${lat}, ${lon}</a></div>`;
|
||||
}
|
||||
}
|
||||
const html = `${linked}${ttsBlock}${gpsBlock}<div class="meta">${escapeHtml(meta)} — ${new Date().toLocaleTimeString('de-DE')}</div>`;
|
||||
|
||||
// Thinking-Indikator ausblenden bei neuer Nachricht
|
||||
updateThinkingIndicator({ activity: 'idle' });
|
||||
@@ -2451,6 +2476,8 @@
|
||||
// Toggle-Checkbox initial korrekt setzen
|
||||
const ttsToggleEl = document.getElementById('tts-debug-toggle');
|
||||
if (ttsToggleEl) ttsToggleEl.checked = showTtsDebug;
|
||||
const gpsToggleEl = document.getElementById('gps-debug-toggle');
|
||||
if (gpsToggleEl) gpsToggleEl.checked = showGpsDebug;
|
||||
|
||||
// Disk-Space Banner aktualisieren (wird vom Server via disk_status gepusht)
|
||||
function updateDiskBanner(status) {
|
||||
|
||||
Reference in New Issue
Block a user