Bug 160350 - Replies to comment are in reverse order
Summary: Replies to comment are in reverse order
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Writer-Comments
  Show dependency treegraph
 
Reported: 2024-03-25 11:41 UTC by Timur
Modified: 2024-04-24 18:45 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
Current order (123.65 KB, image/png)
2024-03-25 15:17 UTC, Aron Budea
Details
screen shot with mixed threads (49.35 KB, image/png)
2024-04-04 08:01 UTC, Cor Nouws
Details
Comment menu (45.62 KB, image/png)
2024-04-23 11:32 UTC, Timur
Details
Reply to someone else's comment in OOo 3.3.png: screenshot of replying in OOo. (115.79 KB, image/png)
2024-04-23 13:32 UTC, Justin L
Details
commentsInWord2019.PNG: screenshot of single reply to thread in MSO (14.58 KB, image/png)
2024-04-24 00:06 UTC, Justin L
Details
commentsInWord.docx: the source document for the previous screenshot (16.24 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2024-04-24 00:07 UTC, Justin L
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Timur 2024-03-25 11:41:00 UTC
In Writer, write a comment.
Then add replies to that comment (not to the other replies) with text A, B, C, D. 
I would expect that comments are seen as Comment, A, B, C, D.
See that comments are ordered as  Comment, D, C, B, A.

Seems like implementationError from when replies were added in LO 5.4.
Comment 1 wjsim 2024-03-25 13:50:20 UTC
Thank you for reporting the bug.

Could you give clearer instructions to replicate the bug? Where are you seeing D, C, B, A? I did as you said and the comments are where the comments are supposed to be.

Tested with:

Version: 24.2.1.2 (X86_64) / LibreOffice Community
Build ID: db4def46b0453cc22e2d0305797cf981b68ef5ac
CPU threads: 16; OS: Windows 10.0 Build 19045; UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL threaded

Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 6a064b1967e06e40be40817deff99d00c1a8554f
CPU threads: 16; OS: Windows 10.0 Build 19045; UI render: Skia/Vulkan; VCL: win
Locale: ko-KR (en_US); UI: en-US
Calc: CL threaded
Comment 2 Timur 2024-03-25 14:49:27 UTC
Steps are rather clear, I think. It is about comment order.
Comment 3 Aron Budea 2024-03-25 15:16:52 UTC
What Timur described is that when you add multiple replies to the same comment, the replies will always be added right below the original comment, not below the existing replies, this is how the order of replies will be in reverse in the end.

I agree with the expectation that they should be in the order as they're added, but let's ask the UX team as well for input.
Comment 4 Aron Budea 2024-03-25 15:17:55 UTC
Created attachment 193296 [details]
Current order

This screenshot should help showing current behavior.
Comment 5 Timur 2024-03-25 15:20:49 UTC
G docs and MSO both work as I expect, replies order as inserted.
Comment 6 BogdanB 2024-03-25 16:16:53 UTC
If we read comments like a chat, the order is D, C, B, A.
If we read comments like a book, the order is A, B, C, D.
Comment 7 Heiko Tietze 2024-03-26 09:26:04 UTC
Latest on top sounds reasonable. The real world scenario is A,B,C being different people replying individually on some comment. If the communication is a thread and B replies on A, and C on B, etc., you get the sequence as expected.
Comment 8 Timur 2024-03-26 09:33:57 UTC
(In reply to Heiko Tietze from comment #7)
> Latest on top sounds reasonable. The real world scenario is A,B,C being
> different people replying individually on some comment. 

How is that resonable, when that is contrary to time logic, user expectation, the way work Google Docs or MS Ofice, even this Bugzilla, or any commenting system?
Comment 9 BogdanB 2024-03-26 10:51:11 UTC
Heiko, from my point of view a +1 for book view, like in Google Drive/Bugzilla, if you will have a Jitsi meeting soon.
Comment 10 Cor Nouws 2024-04-04 08:01:50 UTC
Created attachment 193483 [details]
screen shot with mixed threads

example with various relies mixed - looks sensible as Heiko suggests in comment #7
Comment 11 Heiko Tietze 2024-04-05 12:24:59 UTC
We discussed the topic in the design meeting.

There are arguments for both sides, yet the majority believes in the "book style" with latest at bottom. Please make it possible via expert setting to switch back to the current sort order, if possible.
Comment 12 Cor Nouws 2024-04-05 20:14:39 UTC
May I please ask @timur and @bogdanb to look at attachment 193483 [details]?
There replies are shown below the comment on which they are done. What do you think of that situation?
Comment 13 Justin L 2024-04-22 14:52:48 UTC
(In reply to Timur from comment #0)
> Seems like implementationError from when replies were added in LO 5.4.
I can reply to comments in OOo 3.3.
Comment 14 Justin L 2024-04-22 18:11:54 UTC
Inserting the comment at the end of the thread can easily happen with SwAnnotationWin::MoveCaret.

But that causes a problem. The first time the reply undergoes LayoutPostIts, it InitAnswer's, and this expects that it is a reply to the previous comment.
    mrMgr.GetNextPostIt(KEY_PAGEUP, this);

In fact, there is NO hierarchy of replies, REGARDLESS OF WHAT IT MAY LOOK LIKE. The navigator actually show this - all "replies" are replies of a top comment. (OK, so there is a two level hierarchy - initial comments and replies to the initial comment [GetTopReplyNote()], but never a reply to a reply.)

In order to solve this bug, postit's need a complete rewrite.
Comment 15 Timur 2024-04-23 11:32:16 UTC
Created attachment 193820 [details]
Comment menu

(In reply to Justin L from comment #13)
> (In reply to Timur from comment #0)
> > Seems like implementationError from when replies were added in LO 5.4.
> I can reply to comments in OOo 3.3.

Plese explain how to reply to comments in OO. Per attachment, in OO or 4.4 or 5.2, in comment menu there is no Reply, seen from LO 5.4. 

Separately, please explain that all "replies" are replies of a top comment and never a reply to a reply. Wrt that my test showed different behavior when replying to the top comment and replying to replies.
Comment 16 Justin L 2024-04-23 13:32:22 UTC
Created attachment 193824 [details]
Reply to someone else's comment in OOo 3.3.png: screenshot of replying in OOo.

Using Comment Reply Example.docx (attachment 145913 [details] from bug 119229) and bibisect-releases git checkout oldest (openoffice-3.3.0), I see a reply button. (Until recently, there was code that prevent someone from replying to their own comments - I assume that code is related to why your screenshot doesn't show a reply option.)
Comment 17 Justin L 2024-04-23 13:59:58 UTC
(In reply to Timur from comment #15)
> Separately, please explain that all "replies" are replies of a top comment
> and never a reply to a reply.
The only thing that suggests you have "replied to a reply" is some free-form answer-text that says 'Reply to xyz (04/23/2024, 09:29): "..."' 

However, that answer-text is NOT composed by the actions of hitting the reply button (FN_REPLY) and there is NOTHING in the comment itself that points to the comment that you think you replied to. INSTEAD, the answer-text is composed during its first LAYOUT, and is compiled FROM THE COMMENT IT FOLLOWS. This all happens long after the comment has been created. The internals of the comment indicate that its ParentPostItId is the top level comment - which is why the navigator shows only two levels of comments.

Therefore, when I changed "MoveCaret" to move the reply to the end of the thread instead of the beginning of the thread, the answer-text "replied" to the second-last comment instead of the first comment.

In other words, the entire comment design is based on the assumption that replies go to the top of the thread.
Comment 18 Justin L 2024-04-24 00:06:52 UTC
Created attachment 193828 [details]
commentsInWord2019.PNG: screenshot of single reply to thread in MSO

Likely our poor model is just a copy of what MSO does. It too is extremely limited in comment replies. You can only reply to the thread, and comments cannot be re-organized, etc.
Comment 19 Justin L 2024-04-24 00:07:41 UTC
Created attachment 193829 [details]
commentsInWord.docx: the source document for the previous screenshot