-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Handle deleted files in open editors widget #10361
Handle deleted files in open editors widget #10361
Conversation
5b72c8f
to
11969d2
Compare
packages/editor-preview/src/browser/editor-preview-tree-decorator.ts
Outdated
Show resolved
Hide resolved
packages/editor-preview/src/browser/editor-preview-tree-decorator.ts
Outdated
Show resolved
Hide resolved
packages/navigator/src/browser/open-editors-widget/navigator-open-editors-tree-model.ts
Outdated
Show resolved
Hide resolved
739b6c1
to
648f12a
Compare
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.
I confirmed the following behavior 👍
- confirmed that the strike-through decoration is applied when the resource is deleted
- confirmed that the decoration persists if the deleted editor is moved (different groups)
- confirmed that restoring the file removes the decoration (from outside the application)
- confirmed that restoring the file removes the decoration through git
- confirmed when deleted that the decoration is removed if the file is re-created manually in the app
An earlier version of this PR implemented the strikethrough decoration in the The previous approach required a fair bit of code to track which editors corresponded to deleted files; the current approach is a fair bit simpler. It might be possible to achieve almost the same simplicity by implementing a decorator (perhaps a decorator service, rather than a tree decorator) in the |
Along with what @colin-grant-work mentioned, I also thought about not having the deleted decoration as part of At the moment
Perhaps we can generalize the behavior to decorate from that extension. |
That sounds like a good approach. I'll give that a shot 👍 |
648f12a
to
21b0fca
Compare
@vince-fugnitto @colin-grant-work |
packages/filesystem/src/browser/filesystem-frontend-contribution.ts
Outdated
Show resolved
Hide resolved
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.
I confirmed that the functionality works as intended 👍
- deleting a file outside the app causes the
line-through
for open editors - restoring the file removes the decoration
- the decoration persists when the file is moved to different editor groups
- the decoration now works with workspaces outside of version control 👍
- restoring the file in-app (by recreating it manually) removes the decoration
packages/filesystem/src/browser/filesystem-frontend-contribution.ts
Outdated
Show resolved
Hide resolved
packages/navigator/src/browser/open-editors-widget/navigator-deleted-editor-decorator.ts
Outdated
Show resolved
Hide resolved
packages/navigator/src/browser/open-editors-widget/navigator-deleted-editor-decorator.ts
Outdated
Show resolved
Hide resolved
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.
The changes work well for me, I'll let @colin-grant-work take a look if he wants 👍
packages/filesystem/src/browser/filesystem-frontend-contribution.ts
Outdated
Show resolved
Hide resolved
packages/navigator/src/browser/open-editors-widget/navigator-deleted-editor-decorator.ts
Outdated
Show resolved
Hide resolved
203ddc3
to
cc34e5a
Compare
Thanks Vince, he's out today but should be back tomorrow |
packages/navigator/src/browser/open-editors-widget/navigator-deleted-editor-decorator.ts
Outdated
Show resolved
Hide resolved
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.
This is working well for me. 👍 Thanks for moving to a URI-tracking system rather than an editor-tracking system. I think it should be more robust and more (potentially) useful elsewhere.
9611c6f
to
0d79e96
Compare
Thanks for the review @colin-grant-work and @vince-fugnitto. Merging now 👍 |
What it does
Fixes #10322 by adding support for deleted editors in the Open Editors widget. Adds a strikethrough decoration when a deleted editor is detected.
How to test
Close On File Delete
preference is set to falsegit restore
) and observe the strikethrough is removedReview checklist
Reminder for reviewers