Fossil SCM

Minor cosmetic tweaks to the poll-in-distress indicator. Make it yellow in dark-mode skins, as red blends in too well. No functional changes.

stephan 2025-04-11 16:09 trunk
Commit 160d26923b0d6370feb5a991d8e79ca456a38860bd49d82086d6ffc20a857b8a
--- src/fossil.page.chat.js
+++ src/fossil.page.chat.js
@@ -159,11 +159,11 @@
159159
btnPreview: E1('#chat-button-preview'),
160160
views: document.querySelectorAll('.chat-view'),
161161
activeUserListWrapper: E1('#chat-user-list-wrapper'),
162162
activeUserList: E1('#chat-user-list'),
163163
eMsgPollError: undefined /* current connection error MessageMidget */,
164
- pollErrorMarker: undefined /* element to toggle 'connection-error' CSS class on */
164
+ pollErrorMarker: document.body /* element to toggle 'connection-error' CSS class on */
165165
},
166166
me: F.user.name,
167167
mxMsg: F.config.chat.initSize ? -F.config.chat.initSize : -50,
168168
mnMsg: undefined/*lowest message ID we've seen so far (for history loading)*/,
169169
pageIsActive: 'visible'===document.visibilityState,
@@ -206,12 +206,10 @@
206206
minDelay: 5000 /* minimum delay time */,
207207
tidReconnect: undefined /*timer id for reconnection determination*/,
208208
errCount: 0 /* Current poller connection error count */,
209209
minErrForNotify: 4 /* Don't warn for connection errors until this
210210
many have occurred */,
211
- skipErrDelay: 3500 /* time to wait/retry for the first minErrForNotify'th
212
- connection errors. */,
213211
randomInterval: function(factor){
214212
return Math.floor(Math.random() * factor);
215213
},
216214
incrDelay: function(){
217215
if( this.maxDelay > this.currentDelay ){
@@ -676,11 +674,10 @@
676674
}else{
677675
/* Only the Chrome family supports contenteditable=plaintext-only */
678676
cs.$browserHasPlaintextOnly = false;
679677
D.attr(cs.e.inputX,'contenteditable','true');
680678
}
681
- cs.e.pollErrorMarker = cs.e.viewMessages;
682679
cs.animate.$disabled = true;
683680
F.fetch.beforesend = ()=>cs.ajaxStart();
684681
F.fetch.aftersend = ()=>cs.ajaxEnd();
685682
cs.pageTitleOrig = cs.e.pageTitle.innerText;
686683
const qs = (e)=>document.querySelector(e);
@@ -2655,11 +2652,11 @@
26552652
D.addClass(Chat.e.pollErrorMarker, 'connection-error');
26562653
if( ++Chat.timer.errCount < Chat.timer.minErrForNotify ){
26572654
if(Chat.beVerbose){
26582655
console.warn("Ignoring polling error #", Chat.timer.errCount);
26592656
}
2660
- delay = Chat.timer.resetDelay(Chat.timer.skipErrDelay);
2657
+ delay = Chat.timer.resetDelay(Chat.timer.minDelay);
26612658
} else {
26622659
delay = Chat.timer.incrDelay();
26632660
//console.warn("afterPollFetch Chat.e.eMsgPollError",Chat.e.eMsgPollError);
26642661
const msg = "Poller connection error. Retrying in "+delay+ " ms.";
26652662
/* Replace the current/newest connection error widget. We could also
26662663
--- src/fossil.page.chat.js
+++ src/fossil.page.chat.js
@@ -159,11 +159,11 @@
159 btnPreview: E1('#chat-button-preview'),
160 views: document.querySelectorAll('.chat-view'),
161 activeUserListWrapper: E1('#chat-user-list-wrapper'),
162 activeUserList: E1('#chat-user-list'),
163 eMsgPollError: undefined /* current connection error MessageMidget */,
164 pollErrorMarker: undefined /* element to toggle 'connection-error' CSS class on */
165 },
166 me: F.user.name,
167 mxMsg: F.config.chat.initSize ? -F.config.chat.initSize : -50,
168 mnMsg: undefined/*lowest message ID we've seen so far (for history loading)*/,
169 pageIsActive: 'visible'===document.visibilityState,
@@ -206,12 +206,10 @@
206 minDelay: 5000 /* minimum delay time */,
207 tidReconnect: undefined /*timer id for reconnection determination*/,
208 errCount: 0 /* Current poller connection error count */,
209 minErrForNotify: 4 /* Don't warn for connection errors until this
210 many have occurred */,
211 skipErrDelay: 3500 /* time to wait/retry for the first minErrForNotify'th
212 connection errors. */,
213 randomInterval: function(factor){
214 return Math.floor(Math.random() * factor);
215 },
216 incrDelay: function(){
217 if( this.maxDelay > this.currentDelay ){
@@ -676,11 +674,10 @@
676 }else{
677 /* Only the Chrome family supports contenteditable=plaintext-only */
678 cs.$browserHasPlaintextOnly = false;
679 D.attr(cs.e.inputX,'contenteditable','true');
680 }
681 cs.e.pollErrorMarker = cs.e.viewMessages;
682 cs.animate.$disabled = true;
683 F.fetch.beforesend = ()=>cs.ajaxStart();
684 F.fetch.aftersend = ()=>cs.ajaxEnd();
685 cs.pageTitleOrig = cs.e.pageTitle.innerText;
686 const qs = (e)=>document.querySelector(e);
@@ -2655,11 +2652,11 @@
2655 D.addClass(Chat.e.pollErrorMarker, 'connection-error');
2656 if( ++Chat.timer.errCount < Chat.timer.minErrForNotify ){
2657 if(Chat.beVerbose){
2658 console.warn("Ignoring polling error #", Chat.timer.errCount);
2659 }
2660 delay = Chat.timer.resetDelay(Chat.timer.skipErrDelay);
2661 } else {
2662 delay = Chat.timer.incrDelay();
2663 //console.warn("afterPollFetch Chat.e.eMsgPollError",Chat.e.eMsgPollError);
2664 const msg = "Poller connection error. Retrying in "+delay+ " ms.";
2665 /* Replace the current/newest connection error widget. We could also
2666
--- src/fossil.page.chat.js
+++ src/fossil.page.chat.js
@@ -159,11 +159,11 @@
159 btnPreview: E1('#chat-button-preview'),
160 views: document.querySelectorAll('.chat-view'),
161 activeUserListWrapper: E1('#chat-user-list-wrapper'),
162 activeUserList: E1('#chat-user-list'),
163 eMsgPollError: undefined /* current connection error MessageMidget */,
164 pollErrorMarker: document.body /* element to toggle 'connection-error' CSS class on */
165 },
166 me: F.user.name,
167 mxMsg: F.config.chat.initSize ? -F.config.chat.initSize : -50,
168 mnMsg: undefined/*lowest message ID we've seen so far (for history loading)*/,
169 pageIsActive: 'visible'===document.visibilityState,
@@ -206,12 +206,10 @@
206 minDelay: 5000 /* minimum delay time */,
207 tidReconnect: undefined /*timer id for reconnection determination*/,
208 errCount: 0 /* Current poller connection error count */,
209 minErrForNotify: 4 /* Don't warn for connection errors until this
210 many have occurred */,
 
 
211 randomInterval: function(factor){
212 return Math.floor(Math.random() * factor);
213 },
214 incrDelay: function(){
215 if( this.maxDelay > this.currentDelay ){
@@ -676,11 +674,10 @@
674 }else{
675 /* Only the Chrome family supports contenteditable=plaintext-only */
676 cs.$browserHasPlaintextOnly = false;
677 D.attr(cs.e.inputX,'contenteditable','true');
678 }
 
679 cs.animate.$disabled = true;
680 F.fetch.beforesend = ()=>cs.ajaxStart();
681 F.fetch.aftersend = ()=>cs.ajaxEnd();
682 cs.pageTitleOrig = cs.e.pageTitle.innerText;
683 const qs = (e)=>document.querySelector(e);
@@ -2655,11 +2652,11 @@
2652 D.addClass(Chat.e.pollErrorMarker, 'connection-error');
2653 if( ++Chat.timer.errCount < Chat.timer.minErrForNotify ){
2654 if(Chat.beVerbose){
2655 console.warn("Ignoring polling error #", Chat.timer.errCount);
2656 }
2657 delay = Chat.timer.resetDelay(Chat.timer.minDelay);
2658 } else {
2659 delay = Chat.timer.incrDelay();
2660 //console.warn("afterPollFetch Chat.e.eMsgPollError",Chat.e.eMsgPollError);
2661 const msg = "Poller connection error. Retrying in "+delay+ " ms.";
2662 /* Replace the current/newest connection error widget. We could also
2663
--- src/style.chat.css
+++ src/style.chat.css
@@ -213,12 +213,17 @@
213213
}
214214
body.chat #chat-messages-wrapper.loading > * {
215215
/* An attempt at reducing flicker when loading lots of messages. */
216216
visibility: hidden;
217217
}
218
-body.chat #chat-messages-wrapper.connection-error {
219
- border-bottom: thin dotted red;
218
+
219
+/* Provide a visual cue when polling is offline. */
220
+body.chat.connection-error #chat-input-line-wrapper {
221
+ border-top: medium dotted red;
222
+}
223
+body.chat.fossil-dark-style.connection-error #chat-input-line-wrapper {
224
+ border-color: yellow;
220225
}
221226
222227
body.chat div.content {
223228
margin: 0;
224229
padding: 0;
225230
--- src/style.chat.css
+++ src/style.chat.css
@@ -213,12 +213,17 @@
213 }
214 body.chat #chat-messages-wrapper.loading > * {
215 /* An attempt at reducing flicker when loading lots of messages. */
216 visibility: hidden;
217 }
218 body.chat #chat-messages-wrapper.connection-error {
219 border-bottom: thin dotted red;
 
 
 
 
 
220 }
221
222 body.chat div.content {
223 margin: 0;
224 padding: 0;
225
--- src/style.chat.css
+++ src/style.chat.css
@@ -213,12 +213,17 @@
213 }
214 body.chat #chat-messages-wrapper.loading > * {
215 /* An attempt at reducing flicker when loading lots of messages. */
216 visibility: hidden;
217 }
218
219 /* Provide a visual cue when polling is offline. */
220 body.chat.connection-error #chat-input-line-wrapper {
221 border-top: medium dotted red;
222 }
223 body.chat.fossil-dark-style.connection-error #chat-input-line-wrapper {
224 border-color: yellow;
225 }
226
227 body.chat div.content {
228 margin: 0;
229 padding: 0;
230

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button