-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Add support for Recycle Bin #840
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
Conversation
This comment has been minimized.
This comment has been minimized.
Support for recycle bin would be great, I am not sure if we want to keep it pinned by default. Can you add a feature flag that turns on/off this feature? |
@yaichenbaum yup I can do that, perhaps also add it to the New Tab page? Anyway is not the UI part that worries me :) @duke7553 I've tried using the Shell32 api from the UWP side (meaning using the function SHGetFolderLocation and other IShellFolder related methods and for some reason I cannot enumerate the contents of the recycle bin. The same code works when executed in the fulltrust process. |
@gave92 I would add it to the new page, but it should be behind the feature flag as well. |
@yaichenbaum I'll do that. I'm gonna wait a bit though, until I get some feedback on proposed method for accessing the recycle bin (fulltrust process + appservice). |
@gave92
Second Third Fourth |
And last, i don't think it is a good idea to merge this PR without supporting restore and clear recycle bin functions. |
Other way, mark this feature as Experimental |
We can do this behind a feature flag, this way we are not making any commitment to the feature and the capabilities can be changed. |
Thanks for the feedbacks.
|
|
@yaichenbaum Ok I'll change the default to not pinned. |
@gave92 Is there a way I can test this out in the meantime? |
@yaichenbaum Yes please try again with the latest commit.
|
@gave92 I can now open recycle bin but it appears to be empty. |
@yaichenbaum Can you check whether while you are in the recycle bin folder (in Files UWP) there's a process called |
@gave92 I do not see |
Thanks for the feedback, the issue should now be fixed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the guarantee that this feature is behind a flag, and otherwise invisible, I'll approve this now.
Restore AppService after suspending Enumerate recycle bin items Use real (recycle bin) item path Display recyclebin localized name Fix up click button, test FileWatcher and Empty recyclebin Treat zip as files, Add file size in bytes Fix properties page, refresh on filesystem changes, move ShellFileItem to common project Fix create file in recyclebin Fix watchedItemsOperation null in recyclebin, fix EmptyTextState visibility on file delete
Fix crash when opening file in external app Fix OpenShellCommandInExplorer Add flag to pin recyclebin to sidebar Properly watch for recycle bin updates Recycle bin not pinned by default
Fix exception when deleting many files Simplified method to get file size string
@gave92 Thanks for clarifying this. As long as the recycle bin location is only visible when a flag inside the Experimental Settings page is toggled from its default state, we can merge this when you've finished work on it. |
Delete $I files from recycle bin
A little update on this:
What's missing:
Let me know what you think! |
@duke7553 @gave92 I should have clarified the first time that when I said feature flag, I meant the experimental settings page. |
@gave92 The app doesn't crash but it still won't load any items I have in recycle bin. |
Curious. Please check the following:
In the application data path ("%localappdata%\packages\FilesUWPDev_xxxxx\LocalState" there should be a "debug_fulltrust.txt" with the logged exception |
@gave92 FilesFullTrust.exe is running, I see the regular debug file but nothing for debug_fulltrust.exe. |
Ok so the fulltrust process is not crashing like before which is good... and now I'm confused.
|
I don't get a crash, it's just that the progress bar keeps loading in recycle bin and doesn't load any items that are there. |
@gave92 It finally loaded after a few minutes, I think we need to figure out a faster way to load recycle bin before shipping it. |
Ok just how much stuff is in your recycle bin? xD Edit2: I can confirm this, with a 1000 files it starts to slow down. The solution might be to load incrementally (like a 100 at a time) |
@gave92 It is much faster now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Maybe in the future we can use this AppService to load the extended properties of all StorageItems from the Shell, rather than using the Windows Runtime APIs.
Hello this pull request adds support for browsing the Recycle Bin!
"Support" here means that the recycle bin can be browsed just like any other folder in Files UWP, it's not just a "link" that opens the recycle bin in explorer.
How it works
As I'm not aware of any way to properly access the recycle bin folder from the UWP app, I'm making use of Files UWP full trust process. The fulltrust process enumerates the contents of the recycle bin using the Shell32 api and send the results to the UWP app. Communication between the fulltrust process and the UWP app is done through AppService.
NB: This requires to change the fulltrust process lifecyle: instead of starting a new instance every time to handle the commands to open CMD, toggle QuickLook, etc., a single instance keeps running until the UWP app is closed or suspended.
What works
What's missing
Let me know what you think of this, if you approve of the "architectural" changes I can keep working to complete what's missing.