[Bug] Items disappear when not in the view after deletion of other files
Issue/Description: When deleting items in COSMIC Files that are not currently visible (because they are out of thr view due to scroll), the items seem to disappear after deletion. However, they reappear once the page is refreshed.
Version:
cosmic-files:
Installed: 0.1.0~1754342035~24.04~e3c793a
Steps to Reproduce:
- Open a directory with enough items to require scrolling.
- Scroll to a certain position so some items are not visible.
- Select and delete items that are currently visible.
- When autoscrolled or scrolled up
- Observe that the items are missing until the page is refreshed (divider exist).
Expected Behavior: Deletion shouldn't affect the visibility of available items, even if they were not initially in view, without requiring a refresh.
Other Notes:
https://github.com/user-attachments/assets/9378e57c-791a-4171-8a7f-2daa67ecb5b4
3 items were out of view during deletion | 1 item was out of view during deletion
Related to https://github.com/pop-os/cosmic-files/issues/1101
The same behavior follows when Show hidden files is toggled
https://github.com/user-attachments/assets/33dd61be-c7f0-445b-af29-e4b30ec83be7
Also, the scrolling position never resets. For example, navigate to a directory with many files and scroll to the end of the list. Then go back to the parent directory and revisit the previous directory, the scroll position remains at the end instead of resetting. Resetting scroll position is a expected behavior
The easy way to reproduce is to open two cosmic-files windows on top of each other, scroll down one, then close the other window.