Bug 144999 - Writer Navigator: Add a toggle button to Expand entries / Show only top-level items
Summary: Writer Navigator: Add a toggle button to Expand entries / Show only top-level...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.2.1.2 release
Hardware: All All
: medium enhancement
Assignee: Jim Raykowski
URL:
Whiteboard: target:7.3.0
Keywords:
Depends on:
Blocks: Navigator
  Show dependency treegraph
 
Reported: 2021-10-08 13:09 UTC by Rafael Lima
Modified: 2022-04-11 09:49 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Image explaining the new feature (130.12 KB, application/vnd.oasis.opendocument.graphics)
2021-10-08 13:09 UTC, Rafael Lima
Details
Current Context Menu (81.76 KB, application/vnd.oasis.opendocument.graphics)
2021-10-18 13:03 UTC, Rafael Lima
Details
collapse all categories demo (438.54 KB, video/x-matroska)
2021-10-19 09:34 UTC, Jim Raykowski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rafael Lima 2021-10-08 13:09:44 UTC
Created attachment 175596 [details]
Image explaining the new feature

By default the Navigator shows all entries of various categories by default (f.i. tables, frames, images, etc). This is okay for short documents, but when I am reading very long documents (e.g. dissertation, thesis or writing a book), this becomes an issue because suppose I wanted to scroll down to the "Comments" section; then I would have to scroll down a lot till I get to the Comments section in the navigator.

What I would like to propose is to add a toggle button to the Navigator that simply alternates between (i) expanding all items, which is the default behavior, and (ii) showing only top level items in the navigator (see attached image).

Another aspect that could be improved in the navigator is when the user selects an item type in the "Navigate by" drop-down list. For example, when "Comments" is selected in "Navigate by", the selection in the Navigator could be updated by going to the "Comments" section... and using the navigation arrows could reflect the selection in the navigator as well (since the cursor position in the text is also updated).
Comment 1 Heiko Tietze 2021-10-18 12:03:34 UTC
The Navigator has the Expand All / Collapse All function (see bug 128058 and bug 36308) on the context menu allowing to expand/collapse from the selected node. I think an additional button on the toolbar rather clutters the UI further than adding much to the usability. => WF

IIRC we discussed this at a related ticket.
Comment 2 Rafael Lima 2021-10-18 13:03:04 UTC
Created attachment 175811 [details]
Current Context Menu

Hi Heiko, I tested the solution implemented in bug 128058 but it does not address the issue I originally discussed because it is only available for the "Headings" section (see attached ODG file). It is not possible to collapse/expand all entries in the Navigator at once. The current implementation only covers items inside the "Headings" category.

Moreover the current implementation does not cover "Tables", "Images" and so on. Try selecting and then right-clicking the "Tables" entry in the navigator and notice that the context menu does not have the "Collapse all / Expand all" option that exists in the "Headings" section.

What I would like to suggest is a way to collapse/expand all top-level entries at once (Headings, Tables, Images, etc), which is currently not possible. Note in the first image I attached that when the proposed toggle button is pressed, only top-level entries are shown.

Also note that extending the context menu from the "Headings" section to the other types of items would not suffice, because the user would have to repeat the steps for all types to collapse them all. That's why I believe there should be a way to collapse/expand all top-level items.

The feature I'm proposing would be very useful for large documents. Suppose your reading a thesis with hundreds of headings, tens of images, frames, hundreds of comments and you just want to see the comments down below. If it were possible to collapse all entries, it would be much easier to get to the Comments section.
Comment 3 Heiko Tietze 2021-10-18 13:19:26 UTC
Jim, how about a "collapse all" functions on all root nodes? 

Not really what Rafael is asking, though. I could imagine an alternative shortcut similar to what the Windows Explorer does with the asterisk at the numpad. On KDE I can press ctrl + * (or just +/-) in the Navigator to collapse/expand the currently selected node and ctrl + -/+ to collapse/expand the root node of the currently active node.

Not sure that overwriting the system default makes sense.
Comment 4 David 2021-10-18 17:59:45 UTC
I think that implementing individual tracking toggles for bug 145132 could provide a solution for what is being asked for here (though not as a single button). These have already been implemented for outlines, tables, and sections. I think that a persistent toggle setting for each category is probably a better solution overall than a single button that enables/disables tracking for all categories at the same time.  Tracking may be wanted for one category and not the others.
Comment 5 Jim Raykowski 2021-10-19 09:34:53 UTC
Created attachment 175831 [details]
collapse all categories demo

(In reply to Heiko Tietze from comment #3)
> Jim, how about a "collapse all" functions on all root nodes? 
Will what is shown in the demo do?
Comment 6 Heiko Tietze 2021-10-19 09:52:15 UTC
(In reply to Jim Raykowski from comment #5)
> Will what is shown in the demo do?

Looks good to me. But please wait until Thursday, I've added this topic to the design meeting agenda.
Comment 7 David 2021-10-19 15:28:27 UTC
Do the categories stay collapsed or does the automated tracking cause them to expand?
Comment 8 Jim Raykowski 2021-10-19 16:52:29 UTC
(In reply to David from comment #7)
> Do the categories stay collapsed or does the automated tracking cause them
> to expand?
The categories stay collapsed until focus is moved to the document.

Here is a link to the patch demonstrated:
https://gerrit.libreoffice.org/c/core/+/123811
Comment 9 David 2021-10-19 17:17:56 UTC
(In reply to Jim Raykowski from comment #8)
> (In reply to David from comment #7)
> > Do the categories stay collapsed or does the automated tracking cause them
> > to expand?
> The categories stay collapsed until focus is moved to the document.

I guess that can be useful, but also see related bug 145132.
Comment 10 Rafael Lima 2021-10-20 14:12:54 UTC
(In reply to Jim Raykowski from comment #5)
> Will what is shown in the demo do?

It looks good to me.

> I guess that can be useful, but also see related bug 145132.

Just a suggestion: to fix bug 145132 by David there could be a toggle in the popup menu saying "Enable/Disable tracking". So automatic updates in the navigator (tracking) will only occur when this is enabled. By default this should be enabled.
Comment 11 Heiko Tietze 2021-10-21 13:02:12 UTC
The topic was on the agenda of the design meeting. One comment agrees with a per-rootnode collapse function as a common interaction (rather than one button for everything, or the like).

Easy decision since the patch has been done by Jim - and is appreciated by everyone. Please submit.
Comment 12 Commit Notification 2021-10-22 02:19:48 UTC
Jim Raykowski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/58a3e2a6fad68d8d5e6091e063c0b26e3608f998

tdf#144999 SwNavigator: Add way to collapse all categories

It will be available in 7.3.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 13 Rafael Lima 2021-10-28 20:08:30 UTC
@Jim, I tested it with today's build and everything is working perfectly.

Thanks for the fix!

Here's the system info where I ran my tests:

Version: 7.3.0.0.alpha0+ / LibreOffice Community
Build ID: fc71991510df6ac6d9de278689f2def1a5af775e
CPU threads: 16; OS: Linux 5.13; UI render: default; VCL: kf5 (cairo+xcb)
Locale: pt-BR (pt_BR.UTF-8); UI: en-US
Calc: threaded