ocsms icon indicating copy to clipboard operation
ocsms copied to clipboard

Messages in web interface shown in ascending date order - need to scroll a lot to get to recent messages

Open al-ign opened this issue 7 years ago • 10 comments

$subj I have some conversations for more than 5 years, up to 300 messages, and when I select contact to show its messages:

  1. I need to wait a lot more to load the page (up to 5-6 seconds vs. no more than a second for accounts with 10-20 messages)
  2. I need to scroll down all the way to see the recent messages, for some conversations - this 15-20 screens to scroll (I counted!)

My suggestion:

  • [ ] Make an option to show messages in reverse (descending by date) order [easy to implement]
  • [ ] Change filter to show messages in reverse (descending by date) order by changing 'orderBy' directive [super easy to implement]
  • [ ] Rewrite page conversation loading to support async loading, so initial load will show only some small portion of the messages (perhaps 15-30?) and rest will be loaded only if needed (by clicking 'load more' or dynamically) [obviously - not so easy to implement]

Server configuration

Nextcloud/ownCloud version: Nextcloud - 12.0.5.3 ocsms 1.12.2

OS/Browser Windows 10/Edge Windows 2012R2/IE11

al-ign avatar Jan 30 '18 11:01 al-ign

(regarding topic change - messed up repos, please ignore) I know about 'Max messages on tab loading' setting, but without async load it is not very useful.

al-ign avatar Jan 30 '18 11:01 al-ign

i need time to rewrite the app from AngularJS 1 to Vue.JS, i strarted massive code cleanup but it's stalled at this moment, anybody wanting to help can help :)

nerzhul avatar Jan 30 '18 12:01 nerzhul

I'm in no means capable for rewriting from one JS framework to another, but quick googling shows that Angular accepts minus symbol in orderby directive to sort in descending order, so in https://github.com/nextcloud/ocsms/blob/0c23a10e80d10f5198146e8e4d91812998ed14dd/templates/main.php#L83 'date' could be changed to '-date' and this will change list sort to descending order. Documentation: https://docs.angularjs.org/api/ng/filter/orderBy

al-ign avatar Jan 30 '18 12:01 al-ign

@al-ign yeah, but it means you load all messages too, atm we load recent messages, and you can change ordering on the loaded message, we should also change loading order, not just triage order :)

nerzhul avatar Jan 30 '18 12:01 nerzhul

we should also change loading order

To support async/on-demand load - probably yes, you should know better.

As for now - it works, I changed to '-orderBy' in my installation - and I'm okay with the result for now.

al-ign avatar Jan 30 '18 13:01 al-ign

@al-ign it's a workaround but it works 📦

nerzhul avatar Jan 30 '18 13:01 nerzhul

Well, I got what I need :godmode:

Close, or leave as remainder to add reverse sort? Sometime after rewrite to Vue. In a year or two...

al-ign avatar Jan 30 '18 13:01 al-ign

@al-ign we should keep it. For the slow dev, sorry but it's not my only project and i'm the main commiter on this project, whereas there is an interesting population

nerzhul avatar Feb 10 '18 09:02 nerzhul

I noticed there actually some JavaScript in the code to automatically scroll to the bottom of the windows when a conversation is loaded, but it's broken due to an incorrect div id. I'll create a PR to resolve it.

toolstack avatar Jun 29 '18 22:06 toolstack

it's merged, thanks @toolstack

nerzhul avatar Jun 30 '18 08:06 nerzhul