Bug 130122 - LibreOfficeDev 6.5.0.0 Navigator collapse headings works only for sub-headings
Summary: LibreOfficeDev 6.5.0.0 Navigator collapse headings works only for sub-headings
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.0.0.0.alpha0+
Hardware: x86-64 (AMD64) macOS (All)
: medium normal
Assignee: Jim Raykowski
URL:
Whiteboard: target:6.5.0 target:7.0.0
Keywords:
Depends on:
Blocks: Navigator
  Show dependency treegraph
 
Reported: 2020-01-22 13:31 UTC by Christopher J Poor
Modified: 2020-05-01 06:19 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Crash report sent to Apple (85.42 KB, text/plain)
2020-01-22 14:08 UTC, Christopher J Poor
Details
demonstration of root node collapse (975.28 KB, video/x-matroska)
2020-01-24 03:44 UTC, Jim Raykowski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher J Poor 2020-01-22 13:31:36 UTC
Description:
LibreOfficeDev: I opened my document on Mac OS X 10.13.6 and then opened Navigator. I used the new shortcut shown by the context menu to expand all headings. This worked. However, when I tried to use the shortcut (or Ctrl- or Ctrl Shift -)or the menu to collapse all that did not work for the entire document - only for an individual section. 

After trying a few times I received the message soffice quit unexpectedly although LibreOffice remained open. I have saved the report sent to Apple anyway, if it's of interest. 

Steps to Reproduce:
1. Open complex Writer document with multiple heading levels on MacbookAir
2. Use Command * to expand all heading levels
3. Attempt to use shortcut(s) or menu to collapse all levels

Actual Results:
Neither shortcut(s) nor menu click collapses all heading levels in entire document. The shortcut works for individual sections of the document.



Expected Results:
When right-clicking on "Headings" and then clicking "Collapse All"  - or using the shortcut Command * - all headings below the highest level (Heading 2 in my document) should collapse (as happens when applied to each Heading 2).


Reproducible: Always


User Profile Reset: No



Additional Info:
I tried closing the document to open it again but the Document Recovery dialog appeared and "soffice quit unexpectedly" - this time for real. The Document Recovery dialog had appeared before (with nothing in it) but the app was still running.
When I got the document to open again, the Collapse all worked but then the document crashed and the Document Recovery dialog opened with my document in it. Recovery ran but app crashed - Opened again, crashed again - offered to recover two of the same document.

Thank you for bringing this long sought after capability to LibreOffice. It is a  very useful feature available in a few document processors like org-mode and Scrivener, and in many outliners/PIMs like Treeline.

Org-mode has very similar functionality. I use Spacemacs. The shortcuts applied to the entire document do not require movement to another pane so they can be used without the mouse. Beginning with the document entirely collapsed to the top level headings, tapping Tab opens the next level of headings, tapping Tab again opens the entire document, tapping Tab again collapses the entire document. A recent change actually removed the useful intermediate tapping Tab opens all headings.

Version: 6.5.0.0.alpha0+
Build ID: d144fe04e7689b0298239b78ee6a6638e136fd55
CPU threads: 4; OS: Mac OS X 10.13.6; UI render: default; VCL: osx; 
Locale: en-NZ (en_NZ.UTF-8); UI-Language: en-US
Calc: threaded

There was a log report shown under this information. I assume that was sent to LibreOffice devs.

This is a brand new installation so I do not think there could be any corruption of profile issue.
Comment 1 Christopher J Poor 2020-01-22 14:08:12 UTC
Created attachment 157328 [details]
Crash report sent to Apple

Second crash report sent to Apple and copies of opencl_devices.log and opencl_profile.xml available.
Comment 2 Dieter 2020-01-22 21:34:47 UTC
Jim, I think you might be interested in this issue.

cc:
Comment 3 Jim Raykowski 2020-01-23 21:01:24 UTC
Hi Christopher,

I repro the collapse not happening on the headings root when in headings content navigation view mode but not in full content mode. Looks like this has always been the behaviour. Perhaps for headings content navigation view mode, collapse done on the root should collapse to all first level children of the root? Thoughts?
Comment 4 Jim Raykowski 2020-01-24 03:06:18 UTC
Here is a patch that collapses root node to children when in content navigation view:
https://gerrit.libreoffice.org/c/core/+/87316
Comment 5 Christopher J Poor 2020-01-24 03:18:48 UTC
Hi Jim. I would suggest that using the "collapse all" shortcut the second time should do the exact opposite of the "expand all" (I think you had that in the "tool tip") The "collapse all" should work in this way in whichever context the "expand all" works - I think it makes sense for this to be in the navigation view with headings only displayed - but could be in full content mode also. If you are able to code an intermediate expand - to all first level children - that would be great too. However I think it is important, if (1).you have two shortcuts, that the same shortcut does expand/collapse to the same level or (2). you go the org-mode route so that perhaps you hold down a leader key and repeated taps of the secondary key cycle through the visibility levels. What do you think?
I will try the dev package again tomorrow and see if it crashes less.
Comment 6 Christopher J Poor 2020-01-24 03:19:35 UTC
Just saw your patch. I will check it out shortly. thanks.
Comment 7 Jim Raykowski 2020-01-24 03:29:04 UTC
(In reply to Christopher J Poor from comment #6)
> Just saw your patch. I will check it out shortly. thanks.

The patch hasn't been merged yet. You would need to build from source and then apply the patch see what it does. Need more input before merging. I will make a screen capture of what it does. It won't solve the crash/freeze you have been experiencing, see bug 130155 for a report and fix for that.
Comment 8 Christopher J Poor 2020-01-24 03:40:20 UTC
Oh right. I'm not quite up to speed on how to apply a patch. I should spend more time on such things :-)
Comment 9 Jim Raykowski 2020-01-24 03:44:43 UTC
Created attachment 157381 [details]
demonstration of root node collapse

HTH explain the patch
Comment 10 Christopher J Poor 2020-01-24 05:37:13 UTC
That looks cool!
Comment 11 Commit Notification 2020-01-28 20:36:25 UTC
Jim Raykowski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/7f59313a1bd88dd142ff0b4c9b8cfc7e4beeabc7

tdf#130122 Make content navigation view collapse uniform

It will be available in 6.5.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 12 Christopher J Poor 2020-01-31 10:51:07 UTC
It works nicely now on Mac 

Version: 7.0.0.0.alpha0+
Build ID: 5d7a526ee784abc3d83835b9e43047baf5dbe0b9
CPU threads: 4; OS: Mac OS X 10.13.6; UI render: default; VCL: osx; 
Locale: en-NZ (en_NZ.UTF-8); UI-Language: en-US
Calc: threaded

- but not on Linux Mint - I guess I should file another bug for that.
Comment 13 Jim Raykowski 2020-01-31 23:25:28 UTC
@Christopher, Thanks for confirming the Mac build is working. Perhaps the build you tested on Mint isn't patched? I see there is no appimage of 7.0 and the most recent master build for linux rpm is 2020-1-25 which won't have this patch merge on 2020-1-28.
Comment 14 Kevin Suo 2020-02-01 06:20:29 UTC
(In reply to Jim Raykowski from comment #13)

I confirm this is fixed on master, on Linux as well.
The bug reporter reported another bug in bug 130315, but used an older version in the test. I closed that bug as WORKSFORME.
Comment 15 Commit Notification 2020-05-01 06:19:08 UTC
Jim Raykowski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/6cb9b06432434fb3257118743780828b3b57326a

tdf#130122 Make Navigator CNV collapse to children

It will be available in 7.0.0.

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

Affected users are encouraged to test the fix and report feedback.