Skip to content

Desktop: Resolves issue #12039: Checks whether there exists a deleted folder in order to determine if Trash is collapsible #12051

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from

Conversation

MorbidMiyako
Copy link

The new approach simply checks if there exists a folder with a deleted_time.
It seems that the only aspect influencing whether Trash is collapsible is the presence of a folder.
If this is to change, then its likely this information can be found in the store.
There are also a few safeguards implemented.
FIrstly, if the issue of the Trash folder.childern.size reporting 0 regardless is resolved, it will simply skip over this addition.
Secondly, by breaking as soon as proof is found Trash contains a folder any unnecessary iterations are prevented.

Using the store might allow for determining the number of items in the Trash, something that was commented to be considered tricky. Although I assume communication regarding this subject should be moved to the forum.

Following is a visual explanation of the new behaviour:

By clicking the collapse all button its now possible to go between the following two states:
image
image

See issue #12039 for more information regarding the bug that's resolved.

Copy link
Contributor

github-actions bot commented Apr 3, 2025

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@MorbidMiyako
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

github-actions bot added a commit that referenced this pull request Apr 3, 2025
@MorbidMiyako MorbidMiyako marked this pull request as ready for review April 4, 2025 10:40
@laurent22
Copy link
Owner

Thanks for looking into it. Does that also collapse/expand the nested notebooks inside the trash folder?

@laurent22
Copy link
Owner

Also it would be good to add tests if possible. I seem to remember I've added some for the collapse/expand logic

@MorbidMiyako
Copy link
Author

In response to your first question, yes all folders inside of Trash are also collapsed/expanded.
I did not find a test for this file yet, but I've made one.
It works on the same assumption that if there is a folder in Trash then Trash should be collapsable/expandable.

Copy link
Collaborator

@personalizedrefrigerator personalizedrefrigerator left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for working on this (and adding tests)!

I've left two comments.

@MorbidMiyako
Copy link
Author

All issues should now be resolved, let me know if there is anything else

@MorbidMiyako
Copy link
Author

@personalizedrefrigerator Please let me know if there are any other changes needed/desired.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants