ux: route reconnect/restart signaling notices into chat buffer
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
// Maintainer-controlled web client version.
|
// Maintainer-controlled web client version.
|
||||||
// Format: YYYY.MM.DD Rn (example: 2026.02.20 R2)
|
// Format: YYYY.MM.DD Rn (example: 2026.02.20 R2)
|
||||||
window.CHGRID_WEB_VERSION = "2026.02.22 R161";
|
window.CHGRID_WEB_VERSION = "2026.02.22 R162";
|
||||||
// Optional display timezone for timestamps. Falls back to America/Detroit if unset/invalid.
|
// Optional display timezone for timestamps. Falls back to America/Detroit if unset/invalid.
|
||||||
window.CHGRID_TIME_ZONE = "America/Detroit";
|
window.CHGRID_TIME_ZONE = "America/Detroit";
|
||||||
|
|||||||
@@ -210,7 +210,7 @@ let audioLayers: AudioLayerState = {
|
|||||||
|
|
||||||
const signalingProtocol = window.location.protocol === 'https:' ? 'wss' : 'ws';
|
const signalingProtocol = window.location.protocol === 'https:' ? 'wss' : 'ws';
|
||||||
const signalingUrl = `${signalingProtocol}://${window.location.host}/ws`;
|
const signalingUrl = `${signalingProtocol}://${window.location.host}/ws`;
|
||||||
const signaling = new SignalingClient(signalingUrl, updateStatus);
|
const signaling = new SignalingClient(signalingUrl, handleSignalingStatus);
|
||||||
|
|
||||||
const peerManager = new PeerManager(
|
const peerManager = new PeerManager(
|
||||||
audio,
|
audio,
|
||||||
@@ -490,6 +490,11 @@ function toggleAudioLayer(layer: keyof AudioLayerState): void {
|
|||||||
audio.sfxUiBlip();
|
audio.sfxUiBlip();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Routes signaling transport status messages through chat buffer + status output. */
|
||||||
|
function handleSignalingStatus(message: string): void {
|
||||||
|
pushChatMessage(message);
|
||||||
|
}
|
||||||
|
|
||||||
/** Appends a chat/system line to the bounded status history buffer. */
|
/** Appends a chat/system line to the bounded status history buffer. */
|
||||||
function pushChatMessage(message: string): void {
|
function pushChatMessage(message: string): void {
|
||||||
messageBuffer.push(message);
|
messageBuffer.push(message);
|
||||||
@@ -1081,7 +1086,7 @@ async function reconnectAfterHeartbeatTimeout(): Promise<void> {
|
|||||||
if (reconnectInFlight || !state.running) return;
|
if (reconnectInFlight || !state.running) return;
|
||||||
reconnectInFlight = true;
|
reconnectInFlight = true;
|
||||||
stopHeartbeat();
|
stopHeartbeat();
|
||||||
updateStatus('Connection stale. Reconnecting...');
|
pushChatMessage('Connection stale. Reconnecting...');
|
||||||
disconnect();
|
disconnect();
|
||||||
try {
|
try {
|
||||||
await connect();
|
await connect();
|
||||||
@@ -1205,7 +1210,7 @@ async function onSignalingMessage(message: IncomingMessage): Promise<void> {
|
|||||||
}
|
}
|
||||||
await onAppMessage(message);
|
await onAppMessage(message);
|
||||||
if (restartAnnouncement) {
|
if (restartAnnouncement) {
|
||||||
updateStatus(restartAnnouncement);
|
pushChatMessage(restartAnnouncement);
|
||||||
audio.sfxUiConfirm();
|
audio.sfxUiConfirm();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user