Bug 196772 - Dolphin tree view needs method to expand and collapse all/selected nodes
Summary: Dolphin tree view needs method to expand and collapse all/selected nodes
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: view-engine: details mode (show other bugs)
Version: 20.08.0
Platform: Fedora RPMs Linux
: NOR wishlist
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords: usability
: 374411 430729 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-06-16 17:27 UTC by Jason Farrell
Modified: 2023-08-30 17:24 UTC (History)
11 users (show)

See Also:
Latest Commit:
Version Fixed In: https://invent.kde.org/system/dolphin/-/commit/c17e6c8d2b33d6d62df46025b69cb7b401f09f62


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jason Farrell 2009-06-16 17:27:19 UTC
Version:            (using KDE 4.2.3)
OS:                Linux
Installed from:    Fedora RPMs

I love Dolphin's treeview mode (and konqueror's before that), but I find I'm often wasting time manually expanding multiple dirs. Expanding and collapsing all or just selected dirs should be implemented:

RFE:
  1) An "Expand/Collapse All" menu option IF in treeview mode (which will become even more useful when Dolphin once again remembers the expanded tree view state between back/forward navigation (see dupe bug 191787 and bug 194015))
  2) When multiple dir nodes are selected, and then the right or left arrowkey is pressed, all the selected dirs should be expanded or collapsed one level. At present, only the *last selected* dir is expanded.
Comment 1 Jeroen van Meeuwen (Kolab Systems) 2012-08-24 16:18:42 UTC
Resetting assignee to default as per bug #305719
Comment 2 Elvis Angelaccio 2017-01-01 10:17:27 UTC
*** Bug 374411 has been marked as a duplicate of this bug. ***
Comment 3 Myriam Schweingruber 2020-09-08 09:56:49 UTC
Bumping the version, this is still asked for
Comment 4 Nate Graham 2020-12-23 15:24:03 UTC
*** Bug 430729 has been marked as a duplicate of this bug. ***
Comment 5 Bill Werrel 2020-12-24 06:20:22 UTC
I am also after method of expanding the entire subtree of the selected node. My preference is for keyboard shortcuts. Something like the '*' (expand all), '+' (expand one level), '-' (collapse) keys that the old XTree Gold program used would be nice as they are all next to each other on the numeric keypad and can be easily operated while navigating through the tree using only the keyboard.

Also, the current keyboard shortcuts (left/right arrow) are not documented in the Dolphin Handbook.
Comment 6 Brand 2021-02-18 18:44:51 UTC
Throwing in my support for this.

It seems we would need the following:

1. Button to expand selected folders
2. Keyboard shortcut for expanding selected folders and none of their children
3. Keyboard shortcut for expanding selected folders and all of their children
4. Keyboard shortcut for collapsing all selected nodes
Comment 7 vmelkon 2021-04-16 02:43:15 UTC
I would implement this via a popup menu.
In other words, Dolphin would be in tree view mode.
The user right clicks the folder.
A popup menu opens.
Click on Expand This Folder.
or
Click on Collapse This Folder.

I don't think there is a need for a keyboard shortcut for this feature.
Comment 8 p92 2021-04-16 11:35:38 UTC
I guess this includes the possibility to expand/collapse ALL folders including subfolders from the folder we selected first.
Comment 9 almborg33 2022-11-10 14:37:05 UTC
I do not understand the logic about not having a shortcut to this feature.
I really think it would be great if it was made with a shortcut available.
I would use this feature multiple times every hour of the work day and to not have a shortcut to it would not be so nice.

Why shortcuts:
A lot of people have multiple hi resolution screens meaning mouse movement are on high sensitivity. 
Then to select from a menus many times during a workflow generates more tension in shoulders and arm because you tense up to do micro movements. Many users wants therefor to have shortcuts for repetitive tasks to take load of the mouse arm.
Also in general the less mouse you need to use the less arm and shoulder fatigue. 

e.g. select the  directory and press 'd',for just showing the directories, to collapse all sub-directories and perhaps 'f' to expand then (d and f being next to each other and on the home row. If you use your mouse in the right hand you do not need to drop it and can directly select the directory you want). Vs right click the directory then move the mouse to the right place.

This would be nice:
Right click directory opens menu > collapse (show the shortcut-key in the margin)
Right click directory opens menu > expand (show the shortcut-key in the margin)
Keyboard shortcut for expanding selected directory and none of their children
Keyboard shortcut for expanding selected directory and all of their children
Perhaps for nodes as well. but I do not know what a node is so...
Comment 10 Bug Janitor Service 2023-05-11 08:05:49 UTC
A possibly relevant merge request was started @ https://invent.kde.org/system/dolphin/-/merge_requests/546
Comment 11 Méven Car 2023-05-26 16:10:45 UTC
Git commit c17e6c8d2b33d6d62df46025b69cb7b401f09f62 by Méven Car.
Committed on 26/05/2023 at 16:10.
Pushed by meven into branch 'master'.

Expand or collapse all selected folders on Key Right/Left

M  +27   -8    src/kitemviews/kitemlistcontroller.cpp
M  +85   -8    src/kitemviews/kitemset.h
M  +5    -0    src/tests/CMakeLists.txt
A  +235  -0    src/tests/kitemlistcontrollerexpandtest.cpp     [License: GPL(v2.0+)]

https://invent.kde.org/system/dolphin/-/commit/c17e6c8d2b33d6d62df46025b69cb7b401f09f62
Comment 12 Bill Werrel 2023-06-16 05:42:45 UTC
The left/right arrow shortcuts for expand/collapse in 23.04.02 work great. It would good to also get a short cut for "expand all", and to make the keyboard shortcuts configurable.
Comment 13 Méven Car 2023-08-22 14:44:20 UTC
(In reply to Bill Werrel from comment #12)
> The left/right arrow shortcuts for expand/collapse in 23.04.02 work great.

Great to here.

I will close this bug then, feel free to open a new for your new suggestion.

> It would good to also get a short cut for "expand all",

It exists sort-of "Ctrl+A" then "Right" ><

Would you case to suggest a default shortcut?

> and to make the keyboard shortcuts configurable.

That would be down the road we have a lot of hardcoded shortcut in the view currently, it won't be easy to change this, meaning requiring a lot of effort and be error prone.
Comment 14 Bill Werrel 2023-08-30 09:23:21 UTC
(In reply to Méven Car from comment #13)
> (In reply to Bill Werrel from comment #12)
> > The left/right arrow shortcuts for expand/collapse in 23.04.02 work great.
> 
> Great to here.
> 
> I will close this bug then, feel free to open a new for your new suggestion.
> 
> > It would good to also get a short cut for "expand all",
> 
> It exists sort-of "Ctrl+A" then "Right" ><
> 
> Would you case to suggest a default shortcut?

<Ctrl-A>, <Right> does not do what I had in mind. By expand all I mean for the currently selected folder, recursively expand all subdirectories below it. You could use a shortcut like <Shift-Right> or <Ctrl-Right>. It would probably need a limit on the maximum depth and/or number of files in case someone does this on a directory with a huge number of files in the subdirs. It could be similar to the Folder Size display depth limit setting.
Comment 15 Méven Car 2023-08-30 17:24:12 UTC
(In reply to Bill Werrel from comment #14)
> (In reply to Méven Car from comment #13)
> > (In reply to Bill Werrel from comment #12)
> > > The left/right arrow shortcuts for expand/collapse in 23.04.02 work great.
> > 
> > Great to here.
> > 
> > I will close this bug then, feel free to open a new for your new suggestion.
> > 
> > > It would good to also get a short cut for "expand all",
> > 
> > It exists sort-of "Ctrl+A" then "Right" ><
> > 
> > Would you case to suggest a default shortcut?
> 
> <Ctrl-A>, <Right> does not do what I had in mind. By expand all I mean for
> the currently selected folder, recursively expand all subdirectories below
> it. You could use a shortcut like <Shift-Right> or <Ctrl-Right>. It would
> probably need a limit on the maximum depth and/or number of files in case
> someone does this on a directory with a huge number of files in the subdirs.
> It could be similar to the Folder Size display depth limit setting.

For that, there is a way, using the keyboard up/down keys to select the folders you want while holding SHIFT, then while keeping SHIFT held keep pressing right and the sub-folders selected will expand one level at a time.

You can open a specific bug for that.
I tried to add a specific SHIFT+Right behavior while implementing the fix but our code can't accommodate this ATM.