diff --git a/internal/web/static/index.html b/internal/web/static/index.html
index 8fd5e25..23c8c22 100644
--- a/internal/web/static/index.html
+++ b/internal/web/static/index.html
@@ -2333,6 +2333,7 @@
var currentMaxMsgID = 0;
var currentMaxTimestamp = 0;
var newMsgScrollDone = false;
+ var refreshingChannels = {}; // tracks channels with an in-flight refresh
// ===== MOBILE NAV =====
function openChat() {
@@ -2691,9 +2692,15 @@
}
if (data && typeof data === 'object' && data.type === 'no_changes') {
showToast(t('no_new_messages'));
+ // Refresh done — clear progress bar
+ if (snapChannel > 0) { delete refreshingChannels[snapChannel]; var fb = document.getElementById('prog-fetch-ch-' + snapChannel); if (fb) fb.remove() }
} else if (data && typeof data === 'object' && data.channel) {
+ delete refreshingChannels[data.channel]; var fb2 = document.getElementById('prog-fetch-ch-' + data.channel); if (fb2) fb2.remove();
if (data.channel === snapChannel) await loadMessages(data.channel)
- } else if (snapChannel > 0) { await loadMessages(snapChannel) }
+ } else if (snapChannel > 0) {
+ delete refreshingChannels[snapChannel]; var fb3 = document.getElementById('prog-fetch-ch-' + snapChannel); if (fb3) fb3.remove();
+ await loadMessages(snapChannel)
+ }
updateSendPanel();
});
eventSource.onerror = function () {
@@ -3152,10 +3159,13 @@
renderChannels(); updateSendPanel();
document.getElementById('messages').innerHTML = '
' + t('loading') + '
';
document.getElementById('scrollDownBtn').classList.remove('visible');
- // Show immediate feedback progress bar
- showChannelFetchProgress(num, name);
await loadMessages(num);
- await doRefresh(false);
+ // Show progress bar and mark channel as refreshing so the bar persists
+ // through the metadata fetch + channel fetch (~5 s). The bar is removed
+ // when the SSE update arrives with fresh data for this channel.
+ showChannelFetchProgress(num, name);
+ refreshingChannels[num] = true;
+ doRefresh(false);
}
function showChannelFetchProgress(num, name) {
@@ -3167,8 +3177,9 @@
item.dataset.lastUpdate = Date.now();
item.innerHTML = '