Load more button on Hierarchy widget fetches children in the background when Show closed items toggle is OFF
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Summary
In Hierarchy Widget AKA Child items, if user has Show closed items
toggle set to Off
, we run into a situation where if user has loaded all the open children using Load more
and now next batch of children are all closed items, clicking on Load more
doesn't do anything visually, although it is fetching those children behind the scenes but not showing them due to Show closed items
toggle being Off
, once all the children are loaded, the Load more
button is gone and now we show Show n closed items
(n
being number of closed items currently hidden).
Screen_Recording_2025-01-30_at_5.23.17_PM
Steps to reproduce
- Go to a Work Item that supports children (i.e. Issue, Epic, or Objective).
- Create/add at least 10 child work items to it.
- Close the bottom 5 (i.e. 50%) work items from that list.
- Go to
app/assets/javascripts/work_items/constants.js#L253
and change value ofDEFAULT_PAGE_SIZE_CHILD_ITEMS
to 2.- We're changing page size to a small number just to test this behaviour, this will cause only 2 children to load at a time when
Load more
is clicked.
- We're changing page size to a small number just to test this behaviour, this will cause only 2 children to load at a time when
- Reload the page and turn off
Show closed items
from kebab menu ofChild items
widget as shown in above screen recording. - Start clicking
Load more
to load batches of items. - Notice how towards the end, clicking on
Load more
shows the spinner but doesn't do anything. - Once all the children are loaded,
Load more
button is gone and instead,Show 5 closed items
button is shown. - Clicking on
Show 5 closed items
will eventually show those closed children.
Proposed solution
Scenario 1 (All open items have loaded, but there are still more items to load)
- Show
Show closed items
button. Upon clicking this, the setting (and toggle) updates to showing closed items. It shows any closed items that have already been loaded but are hidden, while now showing theLoad more
button as well (since there are more items to load). Pagination continues as normal after this.
Scenario 2 (All items are loaded)
- Show Show closed items button. Upon clicking this, the setting (and toggle) updates to showing closed items. It shows the closed items that were already loaded. Since all items have been loaded, no other button is present.
Edited by 🤖 GitLab Bot 🤖