Bug 156282 - Outline Folding Toggle not available for entire Headings outline
Summary: Outline Folding Toggle not available for entire Headings outline
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.2.0.0.alpha0+
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:24.2.0 inReleaseNotes:24.2
Keywords:
Depends on:
Blocks: Navigator Writer-Outline-Folding
  Show dependency treegraph
 
Reported: 2023-07-14 02:15 UTC by bathsheba
Modified: 2023-09-06 10:42 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Patch that makes fold/unfold including sub levels menu items available in include sub levels mode (1.40 MB, video/x-matroska)
2023-08-21 06:29 UTC, Jim Raykowski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bathsheba 2023-07-14 02:15:17 UTC
Description:
Outline Folding 'Fold All' and 'Unfold All' features documented at
https://help.libreoffice.org/latest/he/text/swriter/01/outlinecontent_visibility.html are missing.

Steps to Reproduce:
1. Enable "Experimental Features"
2. Enable "Options" > "LibreOffice Writer" > "View" > "Outline Folding" > "Show outline-folding buttons"
3. Create a Writer document with some headings
4. In Navigator/Headings right-click on a heading / Outline Folding, or right-click on the Headings hamburger/Outline Folding

Expected results:
Fold All and Unfold All options appear.

Actual results: 
Individual headings have only "Toggle" option. 
Headings has only [No selection possible], grayed out.
(Please note I’m not talking about Expand All/Collapse All at the top of that menu, that affects only the Navigator view whereas outline folding affects the document view.)

Reproducible: Always
Version: 7.5.4.2 (X86_64) / LibreOffice Community
Build ID: 36ccfdc35048b057fd9854c757a8b67ec53977b6
CPU threads: 12; OS: Windows 10.0 Build 22621; UI render: Skia/Raster; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded

Thanks! I love this feature and I want to use it all the time, but not if I have to unfold everything one subhed at a time.
Comment 1 bathsheba 2023-07-15 03:09:10 UTC
EDIT: these options are missing only if the *Include sub levels* boxes are ticked, which are below the *Show outline-folding buttons* boxes.

I think it's still a bug, Fold and Unfold All buttons should still be available from the Headings hamburger even if sublevels are included.
Comment 2 Stéphane Guillou (stragu) 2023-07-28 13:12:34 UTC
Thanks for the report!

It makes sense that "Fold/Unfold Including Sub Levels" are greyed out on single headings when "Include sublevels" is on, because they would duplicate the Toggle function unnecessarily.

However, it is true that right-clicking on Headings > Outline Folding does not give the option to toggle the whole outline.

I changed the summary to clarify what the issue is.

Steps:
1. Enable "Experimental Features"
2. Enable "Options" > "LibreOffice Writer" > "View" > "Outline Folding" > "Show outline-folding buttons"
3. Also turn on "Include sublevels"
4. Create a Writer document with some headings and subheadings
5. In Navigator sidebar, context menu of Headings > Outline Folding

Results: can't fold / unfold the whole outline.

Tested with:

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 24d0a62bd75b9a895c419aa165da648ab18f134d
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded
Comment 3 bathsheba 2023-07-28 20:02:37 UTC
Thanks!! 

My pain point with not being able to Unfold All is that folding changes the index: sub-levels under a folded level disappear from the index when it's updated.

I'd prefer that folding not affect the index, but that might be too much to ask -- navigating to a folded header using the index would have to unfold it, which would probably be work -- but anyway I need a way to get back to a state where the index is complete.
Comment 4 Stéphane Guillou (stragu) 2023-07-28 23:10:59 UTC
(In reply to bathsheba from comment #3)
> My pain point with not being able to Unfold All is that folding changes the
> index: sub-levels under a folded level disappear from the index when it's
> updated.
> 
> I'd prefer that folding not affect the index, but that might be too much to
> ask -- navigating to a folded header using the index would have to unfold
> it, which would probably be work [...]

This would have to go into a separate report, but I'm unsure what its fate would be given that hidden sections are not even printed or exported to PDF (which makes the current behaviour consistent).

Jim, what do you think about the issue described in this ticket? I think the best solution would be: making Toggle available in the top "Headings" context menu in the Navigator (instead of having it always greyed out like currently - which started when the sublevel option was introduced in 7.2 for bug 138136).
Comment 5 bathsheba 2023-07-28 23:52:07 UTC
(In reply to Stéphane Guillou (stragu) from comment #4)
> This would have to go into a separate report, but I'm unsure what its fate
> would be given that hidden sections are not even printed or exported to PDF
> (which makes the current behaviour consistent).

Fair enough.

> Jim, what do you think about the issue described in this ticket? I think the
> best solution would be: making Toggle available in the top "Headings"
> context menu in the Navigator (instead of having it always greyed out like
> currently - which started when the sublevel option was introduced in 7.2 for
> bug 138136).

<3 that is what I would like
Comment 6 Jim Raykowski 2023-08-21 06:29:59 UTC
Created attachment 189059 [details]
Patch that makes fold/unfold including sub levels menu items available in include sub levels mode

Here is a patch that makes 'Fold/Unfold Including Sub Levels' available when outline folding is set to include sub levels. The patch also changes the behavior of not including outlines in the Navigator Headings content that are not visible in the document view to including them greyed out:
https://gerrit.libreoffice.org/c/core/+/155881

I hope this is close to what is being asked for.
Comment 7 Commit Notification 2023-08-26 03:37:42 UTC
Jim Raykowski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/f24f352da00b3e9a57e723c83008fc5854c38227

tdf#156282 Make 'Fold/Unfold Including Sub Levels' menu items

It will be available in 24.2.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 8 Stéphane Guillou (stragu) 2023-08-28 22:06:11 UTC
Thanks Jim! I verified the fix with the gen VCL plugin:

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: e7496f41562b75ea9732ca48f9aa0c07b69e424f
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: x11
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

(with gtk3, I get crashes. See bug 156978.)
Comment 9 bathsheba 2023-09-05 21:31:13 UTC
Thank you very much Jim!