# project_panel: Avoid recording record excluded files changes \(\#61106\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/819fe337999551ce8177b14c8db1127645617ae4)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 819fe337999551ce8177b14c8db1127645617ae4

Requested commit: 819fe337999551ce8177b14c8db1127645617ae4

Commit: 819fe337999551ce8177b14c8db1127645617ae4

Tree: 453aca497a00ba2373192b78af4f45b022f9d1b1

Author: Dino

Committer: GitHub

## Message

```
project_panel: Avoid recording record excluded files changes (#61106)

# Objective

Fix error shown when attempting to undo/redo operations on excluded
files, for example, undoing a creation of a file in an excluded path.

## Solution

Since `worktree::Snapshot::entry_for_path` always returns `None` for
excluded files, these changes will simply avoid calling
`UndoManager::record` in `ProjectPanel::confirm_edit` if the created
entry is excluded. This can be confusing if the user is renaming a file
to another path that is excluded, as that will not be recorded and can't
be undone but we accept it as a limitation for now and will document
that.

In the future we can potentially support undoing of operations for
excluded file paths but that would mean not only introducing new methods
that operate directly on the absolute path instead of the entry id, as
well as changes to the proto messages, in order to ensure it's also
fixed in remote and collab.

## Testing

Tested manually, as shown in the "Showcase" section below and also
introduced a test for this –
`project_panel::tests::undo::excluded_create_is_not_recorded` .

## Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [ ] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [ ] Performance impact has been considered and is acceptable

## Showcase

<details>
  <summary>Before</summary>


https://github.com/user-attachments/assets/7f8fca3e-2716-40bb-95db-c7119bb39b83

</details>

<details>
  <summary>After</summary>
  

https://github.com/user-attachments/assets/47b0322e-a323-4648-8a56-6e96266888d3

</details>

---

Release Notes:

- N/A
```

## Parents

- [68b165e450b47311567f97e81b2117417c414099](https://git.cafe/gitcafe/zed/commit/68b165e450b47311567f97e81b2117417c414099?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/819fe337999551ce8177b14c8db1127645617ae4?format=markdown)
