Natjve comments & change tracking in LibreOffjce Online By - - PowerPoint PPT Presentation

natjve comments change tracking in libreoffjce online
SMART_READER_LITE
LIVE PREVIEW

Natjve comments & change tracking in LibreOffjce Online By - - PowerPoint PPT Presentation

C o l l a b o r a P r o d u c t i v i t y Natjve comments & change tracking in LibreOffjce Online By Pranav Kant Sofuware Engineer at Collabora Productjvity pranavk@collabora.com www.collaboraoffjce.co C o l l a


slide-1
SLIDE 1

C

  • l

l a b

  • r

a P r

  • d

u c t i v i t y

www.collaboraoffjce.co m

C

  • l

l a b

  • r

a P r

  • d

u c t i v i t y

Natjve comments & change tracking in LibreOffjce Online

By Pranav Kant

Sofuware Engineer at Collabora Productjvity

pranavk@collabora.com

slide-2
SLIDE 2

C

  • l

l a b

  • r

a P r

  • d

u c t i v i t y

www.collaboraoffjce.co m

Problems with previous approach

Trigger unnecessary rendering of document’s tjles

  • Upon user selectjng a comment, the anchor lines would

become bold and trigger a tjle invalidatjon in document

  • Not ideal for Online where every unnecessary

invalidatjon has a huge performance cost

  • Invalidatjon would happen even if the document content is

unchanged

slide-3
SLIDE 3

C

  • l

l a b

  • r

a P r

  • d

u c t i v i t y

www.collaboraoffjce.co m

Problems with previous approach

Harder comment navigatjon

  • Imagine a page full of range comments with range positjons

completely out of sync with comments’ positjon on the sidebar; fjnding which comment belongs to which text is hard

  • Ideal would be to slide the comments to their range

positjon as they are clicked

slide-4
SLIDE 4

C

  • l

l a b

  • r

a P r

  • d

u c t i v i t y

www.collaboraoffjce.co m

slide-5
SLIDE 5

C

  • l

l a b

  • r

a P r

  • d

u c t i v i t y

www.collaboraoffjce.co m

Problems with previous approach

Anchor lines all over the document

  • Interfering with user experience
  • Especially when there are lot of comments
slide-6
SLIDE 6

C

  • l

l a b

  • r

a P r

  • d

u c t i v i t y

www.collaboraoffjce.co m

slide-7
SLIDE 7

C

  • l

l a b

  • r

a P r

  • d

u c t i v i t y

www.collaboraoffjce.co m

Problems with previous approach

Harder to maintain

  • Involvement of editeng.
  • Typing comment in one view interfering with other views
  • Special cases to handle that in LOK
  • And many other problems; a lot of bug fjxing involved

around comments earlier

slide-8
SLIDE 8

C

  • l

l a b

  • r

a P r

  • d

u c t i v i t y

www.collaboraoffjce.co m

And no change tracking comments support

slide-9
SLIDE 9

C

  • l

l a b

  • r

a P r

  • d

u c t i v i t y

www.collaboraoffjce.co m

So, this is what we wanted

  • Betuer UX
  • Quicker response tjmes
  • Avoid unnecessary round-trips with every typed

character

  • Animatjons!!!
  • Betuer DX
  • Low maintenance costs
  • Less developer tjme fjxing comments related bugs
  • Integrated change tracking comments
  • Easier to accept/reject changes, add comment, etc.
slide-10
SLIDE 10

Implementatjon

slide-11
SLIDE 11

C

  • l

l a b

  • r

a P r

  • d

u c t i v i t y

www.collaboraoffjce.co m

Implementatjon

  • Optjonal feature
  • Can be disabled by an optjon in LOK
  • Other LOK clients stjll using in-tjled comment rendering
  • Pass --enable-tjled-annotatjons in GTV
  • Wrapped all comment functjonality under the set of LOK APIs
slide-12
SLIDE 12

C

  • l

l a b

  • r

a P r

  • d

u c t i v i t y

www.collaboraoffjce.co m

Implementatjon

  • Single LOK command to get all the comments (with their

parent-child relatjonship)

  • getCommandValues(ViewAnnotatjons)
  • JSON array containing all the comments
slide-13
SLIDE 13

C

  • l

l a b

  • r

a P r

  • d

u c t i v i t y

www.collaboraoffjce.co m

Implementatjon

  • Augmented existjng UNO commands
  • For insertjon/removal/modifjcatjon of comments
  • .uno:InsertAnnotatjon, .uno:RemoveAnnotatjon,

.uno:ModifyAnnotatjon now return/accept a ‘Id’ parameter to identjfy the comment

slide-14
SLIDE 14

C

  • l

l a b

  • r

a P r

  • d

u c t i v i t y

www.collaboraoffjce.co m

Implementatjon

  • Callbacks to notjfy LOK clients
  • For insertjon/removal/modifjcatjon of comments
  • LOK_CALLBACK_COMMENT
  • With a JSON containing the informatjon about the

comment

slide-15
SLIDE 15

C

  • l

l a b

  • r

a P r

  • d

u c t i v i t y

www.collaboraoffjce.co m

{ "comment": { "actjon": "Add", // “Remove”, “Modify” "id": "11", // Unique ID across lok instance "parent": "4", // “0” if it’s a root comment "author": "Unknown Author", "text": "This is a beautjful comment", "dateTime": "2016-08-18T13:13:00", // ISO 8601 tjme format "anchorPos": "4529, 3906", // positjon of comment in twips "textRange": "1418, 3906, 3111, 919" // rectangle coordinates of range comments in twips } }

JSON structure

slide-16
SLIDE 16

C

  • l

l a b

  • r

a P r

  • d

u c t i v i t y

www.collaboraoffjce.co m

Implementatjon (Writer)

  • Only available module with support for reply comments
  • Parse the internal data structures and convert it to JSON

preserving the parent-child relatjonship

  • Calculate the rectangles in twips for range comments
  • And put them in JSON
  • Give unique Ids to each SwPostItField object to be able to

identjfy comments from the LOK API

  • Needed to later modify or remove a specifjc comments
slide-17
SLIDE 17

C

  • l

l a b

  • r

a P r

  • d

u c t i v i t y

www.collaboraoffjce.co m

Change tracking

  • Simple to expose them through a LOK API
  • Support for commentjng was already present in core
  • Intuitjve UI – can accept/reject changes easily
  • Add comments easily
  • And animate them to their actual change
slide-18
SLIDE 18

Client side

slide-19
SLIDE 19

C

  • l

l a b

  • r

a P r

  • d

u c t i v i t y

www.collaboraoffjce.co m

Using comments & change tracking API

  • Interpret the JSON and feed it to the layoutjng algorithm
  • Sort comments by their anchor positjon in the document
  • Keep them as closer as possible to actual content
  • and animate them when they get the focus near to their

actual content

  • Send data to backend only afuer comment is commitued/saved
  • Whole comment data is sent in one go
  • Small performance win
  • Use the change tracking API to fetch changes and their

comments and integrate in sidebar with comments

slide-20
SLIDE 20

C

  • l

l a b

  • r

a P r

  • d

u c t i v i t y

www.collaboraoffjce.co m

slide-21
SLIDE 21

C

  • l

l a b

  • r

a P r

  • d

u c t i v i t y

www.collaboraoffjce.co m

More ideas for future

  • Betuer root-reply comment relatjonship
  • In ODF, all the adjacent <offjce:annotatjon> are treated as

reply comments

  • Limitatjon: Only one comment thread per anchor

positjon

  • Give Id to each <offjce:annotatjon> element and link

reply comments with a new aturibute, <offjce:parent- annotatjon-name>

  • Ability to resolve comments
  • Some new offjce:resolved aturibute?
slide-22
SLIDE 22

C

  • l

l a b

  • r

a P r

  • d

u c t i v i t y

www.collaboraoffjce.co m

More ideas for future

  • Ability to reply to comments and resolve them in Calc and

Impress

  • Calc: “Notes” vs. “Comments”?
  • Change tracking comment threads
  • … instead of only one comment per change
slide-23
SLIDE 23

C

  • l

l a b

  • r

a P r

  • d

u c t i v i t y

Any Questjons?

By Pranav Kant

pranavk@collabora.com