From f1a7cbf4684af27a6ec32a47e27eaec40534758d Mon Sep 17 00:00:00 2001 From: Jage9 Date: Tue, 24 Feb 2026 23:44:09 -0500 Subject: [PATCH] Route preconnect status to header and silence nickname ack cue --- client/public/version.js | 2 +- client/src/main.ts | 15 ++++++++++----- client/src/network/messageHandlers.ts | 5 +---- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/client/public/version.js b/client/public/version.js index 60aece8..92328ac 100644 --- a/client/public/version.js +++ b/client/public/version.js @@ -1,5 +1,5 @@ // Maintainer-controlled web client version. // Format: YYYY.MM.DD Rn (example: 2026.02.20 R2) -window.CHGRID_WEB_VERSION = "2026.02.25 R252"; +window.CHGRID_WEB_VERSION = "2026.02.25 R253"; // Optional display timezone for timestamps. Falls back to America/Detroit if unset/invalid. window.CHGRID_TIME_ZONE = "America/Detroit"; diff --git a/client/src/main.ts b/client/src/main.ts index f642853..60ffe60 100644 --- a/client/src/main.ts +++ b/client/src/main.ts @@ -482,6 +482,9 @@ async function loadChangelog(): Promise { /** Announces status text via ARIA with brief de-duplication and auto-clear timing. */ function updateStatus(message: string): void { + if (!state.running) { + return; + } const normalized = String(message) .replace(/\s*\n+\s*/g, ' ') .replace(/\s{2,}/g, ' ') @@ -1424,7 +1427,7 @@ function buildAuthRequestPacket(): OutgoingMessage | null { function sendAuthRequest(): void { const packet = buildAuthRequestPacket(); if (!packet) { - updateStatus('Enter username and password.'); + setConnectionStatus('Enter username and password.'); audio.sfxUiCancel(); mediaSession.setConnecting(false); updateConnectAvailability(); @@ -1455,12 +1458,11 @@ async function handleAuthResult(message: Extract { + if (!state.running) { + setConnectionStatus(message); + return; + } if (message === 'Disconnected.') { setConnectionStatus('Disconnected.'); } else if (message.startsWith('Connect failed.')) { @@ -2672,9 +2678,8 @@ loadPersistedAuthPolicy(); setAuthMode('login'); updateConnectAvailability(); updateDeviceSummary(); -updateStatus( +setConnectionStatus( isVersionReloadedSession() ? 'Client updated, please reconnect.' : 'Welcome to the Chat Grid. Log in or register, configure audio if needed, then Connect to join the grid.', ); -setConnectionStatus(isVersionReloadedSession() ? 'Client updated, please reconnect.' : 'Not connected.'); diff --git a/client/src/network/messageHandlers.ts b/client/src/network/messageHandlers.ts index efa7cb6..595add9 100644 --- a/client/src/network/messageHandlers.ts +++ b/client/src/network/messageHandlers.ts @@ -219,10 +219,7 @@ export function createOnMessageHandler(deps: MessageHandlerDeps): (message: Inco case 'nickname_result': { deps.state.player.nickname = deps.sanitizeName(message.effectiveNickname) || 'user...'; - if (message.accepted) { - deps.updateStatus(`Nickname set to ${deps.state.player.nickname}`); - deps.audioUiConfirm(); - } else { + if (!message.accepted) { deps.pushChatMessage(message.reason || 'Nickname unavailable.'); deps.audioUiCancel(); }