fix(files): keep deleted and dismissed Office previews closed - #795
Merged
xintaofei merged 2 commits intoSep 22, 2026
Merged
Conversation
…ules The existence probe added for deleted documents sits on the watcher's hot path and its backing command stats every sibling, so the two bounds that make it affordable — one lookup per parent per envelope, none once a path is decided — are worth a regression test rather than a comment. Neither was covered: both survive being removed. Also pin the semantics change that came with it. A tab the user opened by hand now counts as a sighting, so closing it no longer hands the next watcher event a reason to reopen the document; say so where the branch is, and correct the catch comment, which claimed to be about removed parents while also swallowing openFilePreview's own failures. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Owner
|
codeg work task |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removing an Office document or its temporary directory can open a new preview of the deleted file and show "workspace root does not exist". The auto-preview listener treats every
changed_pathsentry as a document to open, including removals. Closing a preview and switching folders also resets its deduplication state, allowing the tab to return.Check directory metadata before opening, share sibling lookups, and retain the seen paths across folder changes. Pending checks are cancelled when the active workspace or preference changes. This uses the existing directory API without reading document contents.
Added six regression tests. All 138 tests across the workspace context, Office preview, workspace-state store and file-path handling pass, along with lint and formatting for the changed files.