From f1fb926c2f24bbd57125cba7d9cfc3627ff95f62 Mon Sep 17 00:00:00 2001 From: Thomas Date: Fri, 6 Nov 2026 12:04:18 +0100 Subject: [PATCH] Bugfix Richtungsstrich --- CMBNet/static/css/mobile.css | 13 +++++++++---- CMBNet/static/js/sw.js | 2 +- CMBNet/static/js/views/mobile.js | 10 +++++++--- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/CMBNet/static/css/mobile.css b/CMBNet/static/css/mobile.css index 08216cf..79874d8 100644 --- a/CMBNet/static/css/mobile.css +++ b/CMBNet/static/css/mobile.css @@ -472,31 +472,36 @@ html[data-theme="dark"] .mobile-chat-card.own { border: 0 !important; background: transparent !important; box-shadow: none !important; + box-sizing: border-box; } .mobile-user-dot { - position: relative; + position: absolute; + left: 50%; + top: 50%; z-index: 2; width: 16px; height: 16px; + margin: -8px 0 0 -8px; border-radius: 50%; background: #2563eb; border: 3px solid #fff; box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.4); + box-sizing: border-box; } .mobile-user-heading { position: absolute; left: 50%; top: 50%; - z-index: 1; + z-index: 3; width: 2px; height: 20px; + margin: -20px 0 0 -1px; border-radius: 999px; background: #2563eb; - box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.85); pointer-events: none; - transform: translate(-50%, -100%) rotate(var(--user-heading, 0deg)); + transform: rotate(var(--user-heading, 0deg)); transform-origin: 50% 100%; } diff --git a/CMBNet/static/js/sw.js b/CMBNet/static/js/sw.js index 2a5ba6e..e83d75b 100644 --- a/CMBNet/static/js/sw.js +++ b/CMBNet/static/js/sw.js @@ -5,7 +5,7 @@ * damit er sowohl die mobilen Views als auch die statischen Assets * kontrolliert. Der Cache-Name wird pro App-Wurzel gebildet. */ -const VERSION = 'cmbnet-pwa-v19'; +const VERSION = 'cmbnet-pwa-v21'; const BASE = new URL('./', self.location).href; const SHELL_CACHE = `${VERSION}-shell`; const TILE_CACHE = `${VERSION}-tiles`; diff --git a/CMBNet/static/js/views/mobile.js b/CMBNet/static/js/views/mobile.js index 3c904e7..44588bf 100644 --- a/CMBNet/static/js/views/mobile.js +++ b/CMBNet/static/js/views/mobile.js @@ -1499,10 +1499,11 @@ function sendChat() { function addChatEntry(entry) { const key = `${entry.code}|${entry.sender_id}|${entry.ts}|${entry.text}`; - if (state.chatKeys.has(key)) return; + if (state.chatKeys.has(key)) return false; state.chatKeys.add(key); state.chatMessages.push(entry); renderChat(); + return true; } function renderChat() { @@ -1834,7 +1835,7 @@ function handleWs(event) { } const senderName = getSenderName(message, payload); - addChatEntry({ + const isNewMessage = addChatEntry({ sender_id: message.sender_id, code: message.code, ts: normalizeTs(message.ts) || Date.now(), @@ -1843,7 +1844,10 @@ function handleWs(event) { toName: getReceiverName(message, payload) }); - if (Number(message.sender_id) !== currentAccountId) { + // Wiederholt zugestellte Nachrichten (z. B. nach einem Reconnect) + // dürfen weder Ton noch Dialog oder Systembenachrichtigung erneut + // auslösen. + if (isNewMessage && Number(message.sender_id) !== currentAccountId) { playSound(); // In-App-Dialog und, sofern erlaubt, Systembenachrichtigung. showIncomingChatDialog(text, senderName);