Skip to content

fix(files): keep deleted and dismissed Office previews closed - #795

Merged
xintaofei merged 2 commits into
xintaofei:mainfrom
Adam-Dalloul:fix/office-preview-deleted-files
Sep 22, 2026
Merged

xintaofei merged 2 commits into
xintaofei:mainfrom
Adam-Dalloul:fix/office-preview-deleted-files

Conversation

@Adam-Dalloul

Copy link
Copy Markdown
Contributor

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_paths entry 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.

Adam-Dalloul and others added 2 commits September 21, 2026 09:40
…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>
@xintaofei

Copy link
Copy Markdown
Owner

codeg work task 222 is done — #795 (2 files, +67/-1).

@xintaofei
xintaofei merged commit b3219b0 into xintaofei:main Sep 22, 2026
7 checks passed
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.

2 participants