# Feature OP-6571 - Button to collapse/uncollapse all work packages in hierarchy view

Project: OpenProject
Status: on hold
URL: https://community.openproject.org/work_packages/OP-6571

## Planning

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Target versions | Product Backlog |
| Sprint |  |
| Backlog bucket |  |
| Votes | 71 |
| List |  |
| Roadmap |  |
| Relevance |  |

## OPEN POINTS / FEEDBACK

_No work packages_

## Features and Chunks

_No work packages_

## Bugs and other work packages

_No work packages_

## Technical Details

| Attribute | Value |
| --- | --- |
| Module |  |
| Feature Flag |  |
| Requires doc change | Yes |
| Enterprise plan |  |

## Details

| Attribute | Value |
| --- | --- |
| Pull preview |  |
| Mockups |  |
| Found in mobile app version |  |
| Follow-up feedback e-mail |  |
| Accessibility | No |

## People

| Attribute | Value |
| --- | --- |
| Assignee | 纯中 过 |
| Accountable |  |
| Product manager |  |
| Developers |  |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Estimates and progress

| Attribute | Value |
| --- | --- |
| PD (min) |  |
| PD (max) |  |
| Work |  |
| Labor costs |  |

## Description

### Original description:

  - Currently all work packages are folded out in the table / hierarchy view per default. Thats very confusing with 300 or more open work packages.

  - A little checkbox / setting would be nice where you can select wether all work packages shuld be collapsed per default or should be folded out per default.

We currently use Redmine in our company and thats the reason why we can't switch to OpenProject.

### Reworked specification

Because of a PR offered, that does not completely satisfy the originally intended scope but is already an improvement, this feature request is revamped. The similar request <mention class="mention" data-id="29852" data-type="work_package" data-text="##29852">##29852</mention> can be used to further proceed with the original scope.

**Acceptance criteria**

  - Have a toggle button in the toolbar of the work package list view that:
    
      - Allows collapsing all uncollapsed hierarchies
    
      - Allows uncollapsing all collapsed hierarchies

  - The button options are disabled/enabled depending on whether the options are available
    
      - e.g. in case all hierarchies are already collapsed, the collapse option is disabled.

  - The button is only visible in the hierarchy mode (similar to how the toggle button for groups is only available when grouping)

<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/115880/content">

**Out of scope**

  - Storing the collapse-state in the query

  - Keeping the collapse state over page changes
