So we're currently relying on old Document#getComment API for getting the comments. A proper fix is probably to deprecate this API and the related ones, and to introduce a proper decoupled API in a new module xwiki-platform-comment. We would need interface for defining the comment, a component role and its default implem and a script service. Ultimately this API should also contain the code for computing the threads.
Note that a quick custom fix for deployed instances is also possible by editing directly commentsinline.vm and performing the sort operation just after retrieving the comments.
This message was sent by Atlassian Jira (v9.3.0#930000-sha1:287aeb6)
If image attachments aren't displayed, see this article.