Bug 108341 - [Feature] Follow Editor
Summary: [Feature] Follow Editor
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice Online
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard: target:6.0.0
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-05 09:56 UTC by Pranav Kant
Modified: 2017-07-06 07:52 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pranav Kant 2017-06-05 09:56:08 UTC
Would be useful to have a feature to follow the editor's cursor, since in many cases (meetings, f.e.) there is a primary editor / note-taker.

This feature can work like in Hangouts. It could automatically follow whoever is typing, but stops once the user clicks in the document (i.e. sets their own cursor somewhere, signifying they might want to type). The feature can be enabled again by taping some command (from the menu or toolbar, etc).
Comment 1 Xisco Faulí 2017-06-05 10:07:33 UTC
Can be useful for meeting like ESC for instance. Moving to NEW.
Comment 2 Aron Budea 2017-06-05 18:32:57 UTC
How is it supposed to work if multiple people are typing at the same time?
It might not be a normal situation, but better not do crazy things even in that case.
Comment 3 Pranav Kant 2017-06-06 05:14:13 UTC
This information about who is typing and then automatically start following him in loleaflet needs to be fetched from core, so needs some work there, I think. I see no sensible way of accomplishing this in online. 

But yeah, as Aron mentioned, if two people are typing at the same time, getting this information correctly is important. Maybe make only the user who is typing faster (use no. of characters typing per second etc.) the editor of the document and send this information to all clients. If they are typing such that their typing rates switches each second, insert some kind of constant there which precludes making the other person editor unless his typing rate is faster for greater than 'constant' seconds ?

The other part of the bug (i.e follow the user-specific editor) can be done completely in loleaflet and is rather easy to do than the first part.
Comment 4 Jan Holesovsky 2017-06-06 09:43:57 UTC
Yep - doing the "explicit mark this one as the session chair" first sounds great to me; that would already be a huge win, and seems much easier than the automatic switching.

Wrt. the automatic switching - I think easiest would be that when there is a lag in typing [2-5 seconds maybe?], consider that a switch time, and then whoever starts typing first after that lag, he/she is the chair until the next lag :-)
Comment 5 Pranav Kant 2017-06-14 08:55:20 UTC
(In reply to Jan Holesovsky from comment #4)
> Wrt. the automatic switching - I think easiest would be that when there is a
> lag in typing [2-5 seconds maybe?], consider that a switch time, and then
> whoever starts typing first after that lag, he/she is the chair until the
> next lag :-)

And do you mean handling this in online.git only ? I am not sure about its reliability if we handle this in online.git only. For example, a user hitting an arrow key repeatedly to navigate into the document can become an editor unless we handle all of such cases in loolwsd to distinguish between printable and non-printable keys. But at the same time, taking it to core.git might be making the LOK API unnecessarily complex - I imagine some callbacks to notify the LOK clients and then some code to detect that user typed something.
Comment 6 Aditya Dewan 2017-06-16 01:25:11 UTC
Hi,

I have added a patch for this feature at https://gerrit.libreoffice.org/#/c/38855/
it's a wip, but the basic functionality works as of now. There is no automatic switching of editors, but rather each user has to manually select the editor.

This is how it currently works
users selects - view > follow editor
a list of all the users currently viewing the document pops up and then the user can select the other user(editor) he wants to follow.
Comment 7 Pranav Kant 2017-06-16 07:56:39 UTC
(In reply to Aditya Dewan from comment #6)
> Hi,
> 
> I have added a patch for this feature at
> https://gerrit.libreoffice.org/#/c/38855/
> it's a wip, but the basic functionality works as of now. There is no
> automatic switching of editors, but rather each user has to manually select
> the editor.
> 
> This is how it currently works
> users selects - view > follow editor
> a list of all the users currently viewing the document pops up and then the
> user can select the other user(editor) he wants to follow.

I think better if we integrate this somehow with the userlist in the bottom toolbar rather than having a separate userlist to choose the 'follow editor' thing from. Can we do that please ?
Comment 8 Pranav Kant 2017-06-16 10:56:30 UTC
Actually for now, for the automatic switching, lets do it in online.git only, as a first iteration. We don't want to create unnecessary callbacks and APIs in the core.git for this feature and complicate things there. 

Just monitor the key events there in wsd to make one the editor as mentioned in previous comments.

We can iterate further here in future and see if anything else needs to be changed.
Comment 9 Commit Notification 2017-07-06 07:43:21 UTC
Aditya Dewan committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/online/commit/?id=49032d1dab93c74ae57bd92c2a72d019a9340cf6

tdf#108341 Follow any user from the userlist
Comment 10 Commit Notification 2017-07-06 07:47:44 UTC
Aditya Dewan committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/online/commit/?id=3a43f691167c6ad08ffc5670384ca3ab8cadcbe2

tdf#108341 automatic editor switch and follow added
Comment 11 Pranav Kant 2017-07-06 07:52:24 UTC
Turning off follow-mode on user click was annoying, I have turned it off for now here - https://gerrit.libreoffice.org/gitweb?p=online.git;a=commit;h=a20afc1ceb398df934df4736771ffc2e91cd27a9

Closing this, lets file new bugs for additional reports.

Thanks Aditya for working on this, this is a very useful feature.