# Bug OP-20332 - Collapsing a hierarchy in one embedded table hides rows in another

Project: OpenProject
Status: closed
URL: https://community.openproject.org/work_packages/OP-20332

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module | Modules and project features / Work packages, Frontend components and Primer design system |
| Target versions | 18.0.0 |
| Observed in versions | 18.0.0, 17.9.0 |
| Sprint |  |
| Backlog bucket |  |
| Bug found in version (deprecated) |  |
| Found in mobile app version |  |
| Follow-up feedback e-mail |  |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager |  |
| Developers | Alexander Coles |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

| Attribute | Value |
| --- | --- |
| Relevance |  |

## Costs

| Attribute | Value |
| --- | --- |
| Votes |  |
| Work |  |
| Labor costs |  |

## Description

### Before filing a report

Reproduced twice locally on 2026-09-26 while reviewing <mention class="mention" data-id="DREAM-865" data-type="work_package" data-text="#DREAM-865">#DREAM-865</mention> / PR <mention class="mention" data-id="25619" data-type="work_package" data-text="#25619">#25619</mention>. Searched for “hierarchy collapse” and “embedded hierarchy”. <mention class="mention" data-id="OP-5704" data-type="work_package" data-text="#OP-5704">#OP-5704</mention> and <mention class="mention" data-id="OP-5522" data-type="work_package" data-text="#OP-5522">#OP-5522</mention> describe different, closed hierarchy-toggle issues; neither describes one table changing another table. Reproduced on both QA edge and stage on 2026-09-26.

### Steps to reproduce

Preconditions: sign in as a user with permission to view the work packages and create/edit a wiki page in a project. Use a parent work package P with one or more children. No second user is required.

1.  Open the saved [edge fixture](https://qa.openproject-edge.com/projects/A102/wiki/cross-table-hierarchy-bug-reproduction-2026-09-26) or [stage fixture](https://qa.openproject-stage.com/projects/ART/wiki/cross-table-hierarchy-bug-reproduction-2026-09-26). Each contains two tables, A and B, showing the same existing parent and children with hierarchy display enabled. Viewing these fixtures requires only permission to view the wiki and work packages.
2.  Confirm that both tables show the parent and children. On edge: A102-29 with A102-53/A102-54. On stage: ART-3 with ART-5.
3.  Collapse the parent using its hierarchy control in Table A only.
4.  Inspect the children and expansion control in Table B.
5.  Expand the parent in Table A again.

### What is the buggy behavior?

Collapsing the parent in Table A also hides its children in Table B. Table B's control still indicates that P is expanded. Expanding Table A restores the children in both tables.

On both QA instances, collapsing A hid the child rows in both tables; expanding A restored both tables. Locally this was also reproduced using DP-3 with children DP-4/DP-5. Read-only inspection also showed Table B's rendered row metadata still marked both children visible while their DOM rows were hidden. This mismatch is relevant to <mention class="mention" data-id="DREAM-846" data-type="work_package" data-text="#DREAM-846">#DREAM-846</mention> navigation.

### What is the expected behavior?

Collapse/expand affects only the table whose control was activated. The other table retains its own visible rows, expansion control state and rendered metadata.

### Important note

Reproduced on QA edge (`dev`, reported version 18.0.0) and QA stage (`release/*`, reported version 17.9.0) on 2026-09-26. These are browser reproductions on shared QA deployments, independent of the unmerged test stack. No work-package data was changed.

### **Logs**

No console exception is required. The cross-table change is visible in the browser. Source investigation points to document-wide queries in `HierarchyTransformer#renderHierarchyState`, instead of queries scoped to the owning table.

### Screenshots and other files

No screenshot attached. The QA links and steps above allow manual reproduction. Browser evidence is also recorded in the DREAM-863–865 review notes.

### Environment information

**OpenProject installation type**

Other: OpenProject QA edge and QA stage deployments; underlying deployment packaging not checked. Also reproduced on a local Rails/frontend development server.

**OpenProject version**

Local branch `implementation/dream-865-backfill-table-lifecycle-configuration-coverage`, commit `6928f2108014e94ddadd8417c1d7d59fa2b399d6`, tested 2026-09-26. This local result is supplementary to the QA reproductions.

Confirmed on [QA edge](https://qa.openproject-edge.com/) (`dev`, API reports **18.0.0**) and [QA stage](https://qa.openproject-stage.com/) (`release/*`, API reports **17.9.0**), tested 2026-09-26. Exact deployed commit SHAs were not established.

**Browser**

- [x] Chrome — reported version 153.0.0.0
- [ ] Firefox
- [ ] Safari
- [ ] Mobile Safari
- [ ] Other

**Operating System**

- [ ] Windows
- [x] Mac OS X
- [ ] Mobile iOS
- [ ] Mobile Android
- [ ] Linux
- [ ] Chrome OS
- [ ] Other

**Language**

Browser: en-GB. OpenProject interface: English (`html lang=en`).
