Skip to content

feat(files-changed): externalFileStatus overrides for in-project + cross-project deletions (#844) - #307

Merged
jeonghun-jj-lee merged 1 commit into
local/amicodefrom
844-external-file-status
Sep 7, 2026
Merged

feat(files-changed): externalFileStatus overrides for in-project + cross-project deletions (#844)#307
jeonghun-jj-lee merged 1 commit into
local/amicodefrom
844-external-file-status

Conversation

@jeonghun-jj-lee

Copy link
Copy Markdown
Contributor

What

When the filesystem watcher detects an external deletion, the status override now applies to all watched files — not just cross-project ones. Previously, in-project files relied solely on the server refetch, which didn't always clear the entry (the snapshot-based diff still returned the file as added). This caused deleted files to persist in Files Changed and to be resurrectable via save.

Changes

  • accumulate-diffs.ts — Add externalFileStatus to MergeOpts. Apply the override to normalizedServerDiffs (not just cross-project tool diffs), so in-project files returned by the server get their status overridden when the watcher says they are deleted.
  • session.tsx — Add externalFileStatus signal, onFsDiffInvalidate handler (no projectPrefix guard), watch-files sender effect, and pass externalFileStatus() to the merge.
  • accumulate-diffs.test.ts — 5 new tests: cross-project override, no-match passthrough, empty map no-op, in-project server-diff override, in-project no-match passthrough.

Testing

  • 32 bun tests pass (was 27)
  • Manually verified: create a file via session then delete externally — Files Changed marks it as deleted instead of persisting

Companion: harmoniqs/amicode#845

…oss-project deletions (#844)

The filesystem watcher detects external deletions but previously only
tracked them for cross-project files. In-project files trusted the
server refetch, which didn't always clear the entry (snapshot-based
diff still returns the file as 'added').

- Rename crossProjectStatus → externalFileStatus on MergeOpts
- Apply the override to normalizedServerDiffs (not just cross-project
  tool diffs), so in-project files returned by the server get their
  status overridden when the watcher says they're deleted
- Remove the projectPrefix guard in onFsDiffInvalidate so deletion
  tracking applies to all watched files
- Add watch-files sender effect and externalFileStatus signal
- 5 new tests covering both in-project and cross-project overrides
@coderabbitai

coderabbitai Bot commented Sep 7, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: 91396a12-fc61-40ae-b2fd-f4b187d276a0


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@jeonghun-jj-lee
jeonghun-jj-lee merged commit 22993f3 into local/amicode Sep 7, 2026
3 checks passed
@jeonghun-jj-lee
jeonghun-jj-lee deleted the 844-external-file-status branch September 7, 2026 02:18
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.

1 participant