IITC-CE / ingress-intel-total-conversion

intel.ingress.com total conversion user script with some new features. Should allow easier extension of the intel map.
https://iitc.app
ISC License
285 stars 110 forks source link

Unable to scroll COMM to past logs on mobile #507

Open Looka13 opened 3 years ago

Looka13 commented 3 years ago

Sometimes at the first opening of the COMM tab only a partial set of the logs is loaded. Since the window is not full (I think), I'm unable to scroll and thus triggering the loading of previous logs.

Screenshot_20210521-140521 (From the screenshot you can see that the bottom lines of the COMM are empty)

Reloading the app does not fix the issue. When this happen, I have to wait new logs until the window is full, which allows me to scroll and load past data. I'm quite sure the issue is strictly related to the specific logs in COMM, which makes it a time-dependent and position-dependent issue, and thus difficult to reproduce. It happens very rarely, but when it does it is quite annoying.

Maybe unrelated issue (but if I'm to guess I think they are related): A few times I had the issue even with the COMM window full. In those cases I was able to scroll back up to a certain point, and then I wasn't able to scroll anymore and couldn't load older logs. This issue seems to be time(log)-dependent and position-dependent too.

I'm using IITC mobile 0.31.1 for Android.

MysticJay commented 3 years ago

@Looka13 please try the test-build. I know the effect, but imho this is already fixed.

MysticJay commented 3 years ago

it seems to me that the array window.requests._onRefreshFunctions gets filled during setup inwindow.chat.setup by calling window.requests.addRefreshFunction but then, instead of executing it once for the start it waits for the idle to run down for a refresh.

my proposal for a fix: window.requests.addRefreshFunction should do the initial refresh and not leave it to setup

// add method here to be notified of auto-refreshes
window.requests.addRefreshFunction = function(f) {
  window.requests._onRefreshFunctions.push(f);
  f(); // initial execution of the new refresh function
}
johnd0e commented 3 years ago

@le-jeu ?

le-jeu commented 3 years ago

The COMM follow the following rules so far:

Point (ii) is an issue when the number of messages is small enough to have no scrollbar. Most cases are caused by big screen (then reducing the comm+scroll is a workaround) or by a zone with very few messages in the past month, (all messages are already loaded)

The refresh system looks unrelated to me, but it also looks like an old piece of iitc (only used for chat refresh to delay it on map move, likely to wait for the user to be on the desired location)