GNOME Bugzilla – Bug 772621
Empty comments in annotations server no purpose but get created at the first click
Last modified: 2017-12-25 08:35:54 UTC
When clicking on an annotation a comment section pops up. However even if left empty and closed immediately an empty comment gets created and is visible when hovering over the annotation.
Created attachment 337280 [details] [review] libview: Auto-remove empty annotations
Review of attachment 337280 [details] [review]: I don't think this is what we want. removing annotations shouldb e some explicit user interaction. I think what we want is not to show an hover over annotations without content.
Adding empty annotations which do not get displayed is even more awkward for the user since the document gets changed without an apparent reason. I think removing the comment from the annotations if it is empty is the right choice.
I'm also not sure this would work for everyone. The description of the proposed patch would suggest that an annotation that has no comment will be deleted? People make lots of empty annotations (text highlight) - would these be removed? I'm not entirely sure how the backend handles annotations and how various readers create them (I am also aware that acrobat handles comments slightly differently to evince/poppler, i.e. comment threads), so correct me if I am wrong. I assume that annotations with empty comments at least in poppler are a thing and should be OK, might even not be avoidable depending on the implementation. Is it possible to have annotations with comments with poppler? Nevertheless, I agree that an empty comment does not need to be displayed. Not displaying these comments while leaving the annotation itself alone would be an option then?
Created attachment 365318 [details] Screenshot showing empty tooltip for annotation Yes, "highlight" annotations without comments can be quite common, and there is no point in showing an empty tooltip for them. I will attach a patch to not show these empty tooltips.
Created attachment 365319 [details] [review] ev-view: don't show tooltips for empty annotations Empty annotations can be quite common, eg. when adding highlight annotations where the user doesn't enter a comment. So don't show show empty tooltips as they are useless.
Thanks for you work towards fixing this issue!
Review of attachment 365319 [details] [review]: ::: libview/ev-view.c @@ +4754,3 @@ + contents = ev_annotation_get_contents (annot); + if (contents && strcmp (contents, "")) { I don't think we need to use strcmp for this, you could simply check *contents (or contents[0]) != '\0'. I think it's easier to read than strcmp.
Created attachment 365896 [details] [review] ev-view: don't show tooltips for empty annotations Empty annotations can be quite common, eg. when adding highlight annotations where the user doesn't enter a comment. So don't show show empty tooltips as they are useless. https://bugzilla.gnome.org/show_bug.cgi?id=772621 ------ Updated patch, indeed checking for NULL is better.
Comment on attachment 365896 [details] [review] ev-view: don't show tooltips for empty annotations Pushed as commit de9657875d6da3a14ec3ac852079cdcb00d74f6f Thanks!