Bug 84837 - Make show/hide comments UNO command work in Calc
Summary: Make show/hide comments UNO command work in Calc
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: Other All
: medium enhancement
Assignee: Gülşah Köse
QA Contact:
URL:
Whiteboard: target:5.4.0
Keywords:
Depends on:
Blocks: UNO-Command Calc-comments Unify-Across-Apps
  Show dependency treegraph
 
Reported: 2014-10-09 13:32 UTC by Yousuf Philips (jay)
Modified: 2017-05-12 07:41 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
Show-Hide Comments in menu before and after fix (123.93 KB, image/jpeg)
2017-04-12 12:20 UTC, Timur
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yousuf Philips (jay) 2014-10-09 13:32:37 UTC
While following the 'libreoffice' keyword on twitter, i stumbled on a tweet at < https://twitter.com/PascalRichier/status/519994784942141440 > where the user linked to a macro to hide comments in calc < http://moorlater.com/2014/05/22/macro-to-hide-all-comments-in-libreoffice-calc/ >. Looking that writer has the ability to hide and unhide comments in its View menu, i think it maybe useful to also have it in calc.
Comment 1 Cor Nouws 2014-10-09 14:37:17 UTC
Hi Jay ;)
Is the current summary what is meant?

Another question: I guess it must handle all comments selected cells ?

(Drat: some time back a feature was introduced that via context menu all comments could be made visible - is lost now ..)
Comment 2 Yousuf Philips (jay) 2014-10-09 14:52:32 UTC
Hi Cor,

Your modified summary is fine and yes it should hide all comments that are visible, as i'm assuming thats what the macro is doing.

The macro seems to have been created primarily because xlsx files in LibO were in 3.5 always showing comments (bug 45874).
Comment 3 raal 2014-10-18 04:57:17 UTC
You can select whole sheet (CTRL+A) -> Right click -> Hide comment/Show comment
Comment 4 Timur 2014-10-31 10:53:28 UTC
Repeating https://bugs.freedesktop.org/show_bug.cgi?id=85594#c2 I think that there should be:
1. 'Show All Comments' and 'Hide All Comments' in View menu
2. new buttons with icons for 'Show All Comments' and 'Hide All Comments' in Standard toolbar
It's only available now from ShowNotes extension http://extensions.libreoffice.org/extension-center/shownotes.

(In reply to raal from comment #3)
> You can select whole sheet (CTRL+A) -> Right click -> Hide/Show comment
I took some test file with a couple of comments and saw that it takes 10 seconds in LO 4.2. and 4.4. for that, I don't know why it's so slow, while ShowNotes works immediately.
Comment 5 Timur 2017-01-24 14:05:10 UTC
Yousuf, given that there were many changes in menus since the bug was created, is there some more specific reason this hasn't been done (aparat from "no volunteers" and "no ETA")?
Could we have someone for CC who might be interested?
Comment 6 Yousuf Philips (jay) 2017-01-28 10:38:52 UTC
(In reply to Timur from comment #5)
> Yousuf, given that there were many changes in menus since the bug was
> created, is there some more specific reason this hasn't been done (aparat
> from "no volunteers" and "no ETA")?

Adding a menu item for the option would be a piece of cake, but the problem boils down to not having an UNO command for this function. The existing comments toggle UNO command .uno:ShowAnnotations works in Writer and Impress/Draw, but not in Calc.

> Could we have someone for CC who might be interested?

CCing Gulsah and Maxim for their input on how easy it might be acheived.
Comment 7 Gülşah Köse 2017-01-29 20:19:21 UTC
(In reply to Yousuf Philips (jay) from comment #6)

> CCing Gulsah and Maxim for their input on how easy it might be acheived.

Hi, I'm working on #103258 now. It's about to complete. After that i'm going to send a patch for this. Thanks for letting me know.
Comment 8 Timur 2017-03-07 08:10:03 UTC
Gülşah, may I kind you remind on this one? Bug 103258 is fixed now.
Comment 9 Gülşah Köse 2017-03-07 08:32:34 UTC
Thanks for reminding me. I'm starting to work on it.
Comment 10 Gülşah Köse 2017-03-09 18:44:13 UTC
Done: https://gerrit.libreoffice.org/#/c/35020/ (Needs code review)
Comment 11 Commit Notification 2017-04-11 11:52:14 UTC
Gulsah Kose committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=ec25d34fa3ac900950ff24fcb224f7e827352803

tdf#84837 Add Show/Hide all comments commands to Calc.

It will be available in 5.4.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 12 Commit Notification 2017-04-11 12:31:11 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=e7b1c70ea9cd13e229014191cb82775723e7f48d

nitpicks, tdf#84837 follow-up

It will be available in 5.4.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 13 m.a.riosv 2017-04-12 00:47:02 UTC
Doing the test they work for the selected sheets. Looks fine but It's fine?

Also would be nice a 'Delete All Comments' option.
Comment 14 Timur 2017-04-12 08:47:02 UTC
(In reply to Timur from comment #4)
> There should be 'Show Comments' on/off in View menu
(In reply to Yousuf Philips (jay) from comment #6)
> Adding a menu item for the option would be a piece of cake
Should this be done here or in another bug? 

(In reply to Timur from comment #4)
> new buttons with icons for 'Show All Comments' and 'Hide All Comments' in
> Standard toolbar
Current 'Show All Comments' and 'Hide All Comments' are available but they are not in toolbar at all. From before there are also 2 Show Comment (of which 1 is on/off) and 1 Hide Comment buttons. They all have no icons.
Thinking again about this, there should be a single 'Show Comments' on/off button with icon. 
I wish we had "Comments and Changes" toolbar ('Show Comments' on/off, 'Show Comment' on/off, Record Changes, Show Changes..) maybe with "Show Comments functions" in Standard Toolbar that would show all of these like "Show Track Changes functions" in Writer. I may open another bug for that.
 
(In reply to m.a.riosv from comment #13)
> Doing the test they work for the selected sheets. Looks fine but It's fine?
What does it mean "Looks fine but It's fine?"

> Also would be nice a 'Delete All Comments' option.
I guess it takes another UNO. Gülşah, can you please comment, should this be another bug? 

As Eike advised, I added this feature under https://wiki.documentfoundation.org/ReleaseNotes/5.4#Calc as:
* New '''Show All Comments''' and '''Hide All Comments''' uno commands {{tdf|84837}} (Gülşah Köse).
Comment 15 Eike Rathke 2017-04-12 11:18:55 UTC
(In reply to Timur from comment #14)
> (In reply to Yousuf Philips (jay) from comment #6)
> > Adding a menu item for the option would be a piece of cake
> Should this be done here or in another bug?
? The commit does exactly that.

> Current 'Show All Comments' and 'Hide All Comments' are available but they
> are not in toolbar at all. From before there are also 2 Show Comment (of
> which 1 is on/off) and 1 Hide Comment buttons. They all have no icons.
> Thinking again about this, there should be a single 'Show Comments' on/off
> button with icon.
For a single comment at the current cell? For all comments on the selected sheet? Both?

> I wish we had "Comments and Changes" toolbar ('Show Comments' on/off, 'Show
> Comment' on/off, Record Changes, Show Changes..) maybe with "Show Comments
> functions" in Standard Toolbar that would show all of these like "Show Track
> Changes functions" in Writer. I may open another bug for that.
Cell note comments are unrelated to Track Changes and different from Writer comments. I'd not merge those into yet another toolbar that clutters space.

> As Eike advised, I added this feature under
> https://wiki.documentfoundation.org/ReleaseNotes/5.4#Calc as:
> * New '''Show All Comments''' and '''Hide All Comments''' uno commands
> {{tdf|84837}} (Gülşah Köse).
Thanks, I added where to find it ;-)
Comment 16 Timur 2017-04-12 12:20:37 UTC
Created attachment 132518 [details]
Show-Hide Comments in menu before and after fix

OK, I was looking in View menu, not under menu Sheet ▸ Cell Comment. 

There should be a single 'Show Comments' on/off button with icon for all comments on the selected sheet - that's icon for those 'Show All Comments' and 'Hide All Comments'.
Separately, there should be added another icon for existing Show Comment on/off text button that works on a single comment at the current cell.
Comment 17 m.a.riosv 2017-04-12 21:08:38 UTC
> (In reply to m.a.riosv from comment #13)
> > Doing the test they work for the selected sheets. Looks fine but It's fine?
> What does it mean "Looks fine but It's fine?"

Because 'All comments' not are 'All comments' in the file but in the selected sheets. For me looks fine because make the option more flexible, but the title can lead to think that are all comments on the file, while for that it's needed to select all sheets.
So even with bit longer title, I think it could be more explicit. 'Show All Sheet Comments'

>  
> > Also would be nice a 'Delete All Comments' option.
> I guess it takes another UNO. Gülşah, can you please comment, should this be
> another bug? 
Perhaps you are right and should be another enhancement request.

> 
> As Eike advised, I added this feature under
> https://wiki.documentfoundation.org/ReleaseNotes/5.4#Calc as:
> * New '''Show All Comments''' and '''Hide All Comments''' uno commands
> {{tdf|84837}} (Gülşah Köse).
Comment 18 Timur 2017-04-13 14:22:19 UTC
I added a separate Bug 107143 for "Delete All Comments". 
What's missing here IMHO (unless it's also a separate bug) is: 
There should be a single 'Show Comments' on/off button with icon for all comments on the selected sheet - that's icon for those 'Show All Comments' and 'Hide All Comments'.
Comment 19 Yousuf Philips (jay) 2017-04-15 17:36:22 UTC
(In reply to Timur from comment #18)
> What's missing here IMHO (unless it's also a separate bug) is: 
> There should be a single 'Show Comments' on/off button with icon for all
> comments on the selected sheet

Yes this bug report was intended to create this toggle entry in the View menu. I've moved the two newly created commands to the View menu while we await for the command to be created. https://gerrit.libreoffice.org/36570

@Gulsah: Thanks for creating the independent comment hiding and showing commands, but any thoughts on the single toggle comment command.
Comment 20 Gülşah Köse 2017-04-17 07:14:37 UTC
> @Gulsah: Thanks for creating the independent comment hiding and showing
> commands, but any thoughts on the single toggle comment command.

Nice idea. And i think easy to implement. I can.

Unfortunately, i'm not good at icon creation.
Comment 21 Yousuf Philips (jay) 2017-04-18 13:57:46 UTC
(In reply to Gülşah Köse from comment #20)
> Unfortunately, i'm not good at icon creation.

If you make the existing .uno:ShowAnnotations command work for Calc, it already has an icon. :D
Comment 22 Eike Rathke 2017-04-18 19:28:34 UTC
(In reply to Yousuf Philips (jay) from comment #19)
> (In reply to Timur from comment #18)
> > What's missing here IMHO (unless it's also a separate bug) is: 
> > There should be a single 'Show Comments' on/off button with icon for all
> > comments on the selected sheet
> 
> Yes this bug report was intended to create this toggle entry in the View
> menu. I've moved the two newly created commands to the View menu while we
> await for the command to be created. https://gerrit.libreoffice.org/36570

I'm not convinced of moving Show/Hide All Comments from the Sheet submenu to View. The code acts on the selected sheet(s), which perfectly suits the Sheet menu, and moving them to View splits places where to find comment related commands into two. Wanting to show/hide one comment => go to Sheet..., wanting to show/hide all comments => goto View. IMHO doesn't make sense.
Comment 23 Yousuf Philips (jay) 2017-04-18 20:04:57 UTC
(In reply to Eike Rathke from comment #22)
> I'm not convinced of moving Show/Hide All Comments from the Sheet submenu to
> View. The code acts on the selected sheet(s), which perfectly suits the
> Sheet menu, and moving them to View splits places where to find comment
> related commands into two. Wanting to show/hide one comment => go to
> Sheet..., wanting to show/hide all comments => goto View. IMHO doesn't make
> sense.

We have show/hiding all comments in the same location in writer and impress, so its logical for it to be in the same place in calc. The View menu also have sheet-level view options like Grid Lines and Freeze Cells.
Comment 24 Eike Rathke 2017-04-20 14:04:16 UTC
Ok, then where do you want to place the new Delete All Comments command (bug 107143)? Under Edit to have yet a third place to look for?
Comment 25 Yousuf Philips (jay) 2017-04-20 20:14:22 UTC
(In reply to Eike Rathke from comment #24)
> Ok, then where do you want to place the new Delete All Comments command (bug
> 107143)? Under Edit to have yet a third place to look for?

No we'd just change the name of the submenu from 'Cell Comment' to 'Cell Comments' to keep it all in one place.
Comment 26 Commit Notification 2017-04-24 20:59:29 UTC
Yousuf Philips committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=c909609c28e12c2aba260dc565bd8c82aed28086

tdf#84837 Comment submenu icon and remove hide/show all comments

It will be available in 5.4.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 27 Timur 2017-05-12 07:41:45 UTC
I'm not sure why Bug 107258 is separate, but what matters is that it's done. 
Now there's View▸Comments and Comments command available to be added to toolbar. 

What's missing is to have Comments icon available in the toolbar and I propose this bug be about it. That would finally render ShowNotes extension obsolete. 
Question is: to Standard or Formatting toolbar? To me it seems more logical to Standard. If there won't be "Comments and Changes" toolbar.