From a04c3f4bee2748f0992791d8dd4e621063c19fc2 Mon Sep 17 00:00:00 2001 From: jolavillette Date: Sat, 29 Aug 2026 19:02:00 +0200 Subject: [PATCH] webui v168: scroll to the tunnel status line when it lands "Tunnel is secured. You can talk!" was appended to the conversation without scrolling to it, so on a phone it sat below the fold and the tunnel looked stuck on connecting. Same for "Your partner closed the conversation". Scroll when the line is really new (the helper drops duplicates) and the contact is still the one on screen. --- webui-src/app/main.js | 2 +- webui-src/app/people/people_state.js | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/webui-src/app/main.js b/webui-src/app/main.js index 6804436..c6c12f8 100644 --- a/webui-src/app/main.js +++ b/webui-src/app/main.js @@ -1,7 +1,7 @@ const m = require('mithril'); // Bumped at every change of the web UI (two places used to carry it). -const WEBUI_VERSION = 'v167'; +const WEBUI_VERSION = 'v168'; const login = require('login'); const rs = require('rswebui'); diff --git a/webui-src/app/people/people_state.js b/webui-src/app/people/people_state.js index 9a85823..d319e30 100644 --- a/webui-src/app/people/people_state.js +++ b/webui-src/app/people/people_state.js @@ -407,14 +407,19 @@ function pollDistantChatStatus() { if (session) { session.status = detail.info; + // A status line is a message like any other: when one really lands + // (the helper drops what is already there) the pane has to follow it, + // or "You can talk" sits below the fold and the tunnel looks stuck. + let statusLineAdded = false; if (detail.info.status === 2) { - addSessionSystemMessage(session, 'Tunnel is secured. You can talk!'); + statusLineAdded = addSessionSystemMessage(session, 'Tunnel is secured. You can talk!'); // The tunnel just went up: anything the peer sent while it was still // pending is waiting in the event buffer. drainBufferedChatMessages(session); } else if (detail.info.status === 3) { - addSessionSystemMessage(session, 'Your partner closed the conversation.'); + statusLineAdded = addSessionSystemMessage(session, 'Your partner closed the conversation.'); } + if (statusLineAdded && State.selectedId === askedFor) scrollChatToBottom(); } m.redraw(); }