-
Notifications
You must be signed in to change notification settings - Fork 734
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Anchor comments directly to the scroll position and optimise comment layout #10772
base: master
Are you sure you want to change the base?
Conversation
43c8b46
to
bec7104
Compare
Some failures here, likely due to the show/hide caching - I was wondering if that would hold up :) Will dig into it. |
I'm not fully convinced these failures are directly caused by this patch - they seem to be happening because sometimes after this patch when you hit save, you end up with a conflict dialog asking if you want to overwrite changes that another user made - possibly there's some bad ordering of events and we're getting the acknowledgement back from the server before we've set a property that indicates we were the ones to have made the change... Still digging. It doesn't seem to be a cache invalidation issue at least(!) |
bec7104
to
cf549cc
Compare
Failures should be fixed, it was caching of show/hide as I initially thought - didn't quite get to the root of it, but made sure it behaved identically to how it did before and the failures disappeared locally. |
Ok, so still some of the same failures, I'll dig further to see if I can replicate them locally... Though the last run I had was successful, so not entirely sure what's happening now - intermittent maybe? |
ah, just noticed it's specifically the calc annotation_spec.js that's failing - I didn't try that locally so it's probably legit again. There's specific behaviour for annotations in calc, looking at this now. |
So I think the broken tests, it's the test themselves that are bad - they're modifying the DOM and so obviously breaking caching. I think these tests need to be rewritten to not do this, of course randomly modifying the DOM is going to break assumptions within the app... I'll try to figure out what they're trying to do and fix the tests. |
cf549cc
to
dd23fa9
Compare
Should be good now. Rather than trying to fix all those tests and calc behaviour, I just made the choice not to cache show/hide for calc - Only one comment can be visible and they're hidden during scrolling, so it doesn't really buy us anything vs the quite large amount of work to fix this properly. |
dd23fa9
to
216e8f8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks new update mechanism feels much better:)
There are some things, not sure if they are related to your PR:
- When i paste a long content into comment (while creating a new comment) and click on save, it doesn't save the comment and i need to click twice. This sometimes adds 2 instances of the same comment.
- In Impress, long content of a comment has a gap above it.
If they are not related to your code, we can get this in, in RED code i think.
Other than that, i checked the code and behaviour quickly, thank you.
this.showWriter(); | ||
else if (this.sectionProperties.docLayer._docType === 'presentation' || this.sectionProperties.docLayer._docType === 'drawing') | ||
this.hidden = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think "hidden" cannot be true if we are here. I guess we could initiate hidden as "false" and remove these assignments. Not that important but may be confusing in the future while editing the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Argh whoops, it's not this that's wrong (I don't think), but the check at the top of the function - makes me wonder how all the tests passed - I guess because they don't make multiple changes and at first the value isn't cached (intentionally, to mimic the old behaviour of the comment being in an indeterminate state on creation).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now i checked master branch. Both issues seem to be related to this PR. Can you have a look at them when you have time?
Absolutely, thanks for the thorough testing 🙂 |
Don't postpone and don't animate comment block position changes when scrolling or resizing the document. Signed-off-by: Chris Lord <[email protected]> Change-Id: I95c1ae1eb732c6dc682018b85debb6133d85ce8c
CommentListSection layout appears very high in the profile when scrolling. This commit makes various optimisations, mainly around doing less unnecessary work while scrolling and caching regularly accessed values. Comment layout no longer appears anywhere significant in the profile in Writer after this patch. Signed-off-by: Chris Lord <[email protected]> Change-Id: I3bc8d040422703375b583fbc8c49bd793547514d
216e8f8
to
57c9cab
Compare
@gokaysatir With the mistake in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have 2 things here:
- I can't update a comment because of the "someone else is updating" popup.
- There are JS errors on the console. Not sure if they were there before. Though seems unrelated to your commits, i couldn't be sure.
Can you check if you can reproduce the issues? I tried to switch to master and back to your PR to be sure. If you can't reproduce, then i'll need to refresh browser cache and dist directory.
Gap in Impress comments seems to persist, but i couldn't check correctly because of the popup.
Summary
It is desirable for comments to scroll in sync with the document instead of lagging behind the scroll position. The first commit in this branch anchors comments directly to the scroll position and the second commit fixes various performance issues doing this exposes.
Checklist
make prettier-write
and formatted the code.make check
make run
and manually verified that everything looks okay