Find a file
zed-zippy[bot] 084ce16b1f
Some checks failed
run_tests / orchestrate (push) Has been cancelled
run_tests / check_style (push) Has been cancelled
run_tests / clippy_windows (push) Has been cancelled
run_tests / clippy_linux (push) Has been cancelled
run_tests / clippy_mac (push) Has been cancelled
run_tests / clippy_mac_x86_64 (push) Has been cancelled
run_tests / run_tests_windows (push) Has been cancelled
run_tests / run_tests_linux (push) Has been cancelled
run_tests / run_tests_mac (push) Has been cancelled
run_tests / miri_scheduler (push) Has been cancelled
run_tests / doctests (push) Has been cancelled
run_tests / check_workspace_binaries (push) Has been cancelled
run_tests / build_visual_tests_binary (push) Has been cancelled
run_tests / check_wasm (push) Has been cancelled
run_tests / check_dependencies (push) Has been cancelled
run_tests / check_docs (push) Has been cancelled
run_tests / check_licenses (push) Has been cancelled
run_tests / check_scripts (push) Has been cancelled
run_tests / check_postgres_and_protobuf_migrations (push) Has been cancelled
run_tests / extension_tests (push) Has been cancelled
run_tests / tests_pass (push) Has been cancelled
project_panel: Confirm before trashing unsaved file on undo (#62294) (cherry-pick to stable) (#62481)
Cherry-pick of #62294 to stable

----
# Objective

Ensure that, when users undo project panel operations, we don't trash
files with unsaved edits as that could lead to data loss, as outlined

[here](https://github.com/zed-industries/zed/issues/62243#issuecomment-5203625087).

Closes #62243

## Solution

Update `UndoManager::trash` to require confirmation before moving files
to the trash. For files with unsaved edits, users can save, discard, or
cancel the operation while clean files receive a standard trash
confirmation, same as shown when trashing a file through the Project
Panel.

This helps avoid the issue where, if an user undoes a file creation for
a file that has unsaved edits and then quits Zed, the edits that were
saved in memory, as well as the Project Panel history, will now be gone
and there's no way to recover the data.

Batch operations have also been updated to now show a single
confirmation before making filesystem changes, preventing partial
execution when cancelled and warning about unsaved edits.

Lastly, the trash/delete prompt building has been refactored in order
for the Project Panel and Undo Manager to share the same wording,
file-list truncation, and unsaved-change warnings.

## Testing

Tested both manually as well as added the following tests:

*  `project_panel::tests::undo::undo_create_cancel_trash`
*  `project_panel::tests::undo::undo_create_dirty_file`
*  `project_panel::tests::undo::cancel_partial_trash_batch`
*  `project_panel::tests::undo::batch_trash_warns_about_unsaved_changes`

## 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
- [x] Performance impact has been considered and is acceptable

## Showcase

The screen recording below shows the trash confirmation dialog on both a
clean and dirty files, on both undo and redo flows.



https://github.com/user-attachments/assets/0f9b96f5-0357-4e3f-8ec2-141486942c89

---

Release Notes:

- Fixed issue with undoing or redoing project panel operations that
could lead to a file with unsaved edits being trashed without
confirmation.

Co-authored-by: Dino <dinojoaocosta@gmail.com>
2026-08-12 09:24:06 +00:00
.agents/skills
.cargo
.cloudflare
.config
.factory
.github ci: Grant version bump token more permissions (#61709) 2026-07-27 10:28:32 +00:00
.zed
assets Fix parameter colors for gruvbox themes (#61983) (cherry-pick to preview) (#61986) 2026-07-31 11:09:36 +00:00
ci
crates project_panel: Confirm before trashing unsaved file on undo (#62294) (cherry-pick to stable) (#62481) 2026-08-12 09:24:06 +00:00
docs Document Claude Opus 5 hosted model pricing (#62450) (cherry-pick to stable) (#62452) 2026-08-10 19:46:50 +00:00
extensions
legal
nix agent: Re-enable sandbox (#61711) 2026-07-29 13:03:22 +00:00
script Fix musl linking failure in bundle-linux by setting CC for musl target (#61203) 2026-07-22 09:37:55 +00:00
tooling ci: Grant version bump token more permissions (#61709) 2026-07-27 10:28:32 +00:00
.git-blame-ignore-revs
.gitattributes
.gitignore csv_preview: Add single-line row displaying mode (#61127) 2026-07-16 19:28:22 +00:00
.mailmap
.prettierrc
.rules Fix typo in .rules (#61693) 2026-07-27 05:59:53 +00:00
AGENTS.md
Cargo.lock agent: Fix NTFS warning breaking terminal tool when WSL not available (#62049) (cherry-pick to preview) (#62129) 2026-08-03 17:24:57 +00:00
Cargo.toml agent: Fix NTFS warning breaking terminal tool when WSL not available (#62049) (cherry-pick to preview) (#62129) 2026-08-03 17:24:57 +00:00
CLAUDE.md
clippy.toml
CODE_OF_CONDUCT.md
compose.yml
CONTRIBUTING.md CONTRIBUTING.md: Document the cap on simultaneous PRs (#61516) 2026-07-23 14:34:29 +00:00
debug.plist
default.nix nix: Use flake-parts, partitions, and treefmt-nix (#45321) 2026-02-02 14:26:42 +00:00
Dockerfile-collab
Dockerfile-collab.dockerignore
Dockerfile-cross.dockerignore
Dockerfile-distros
Dockerfile-distros.dockerignore
flake.lock
flake.nix
GEMINI.md
LICENSE-APACHE
LICENSE-GPL
livekit.yaml
lychee.toml
Procfile
Procfile.web
README.md
renovate.json
REVIEWERS.conl
rust-toolchain.toml
rustfmt.toml
shell.nix
typos.toml

Zed

Zed CI

Welcome to Zed, a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.


Installation

On macOS, Linux, and Windows you can download Zed directly or install Zed via your local package manager (macOS/Linux/Windows).

Other platforms are not yet available:

Developing Zed

Contributing

See CONTRIBUTING.md for ways you can contribute to Zed.

Also... we're hiring! Check out our jobs page for open roles.

Licensing

Zed source code is licensed primarily under GPL-3.0-or-later, with Apache-2.0 components where marked.

License information for third party dependencies must be correctly provided for CI to pass.

We use cargo-about to automatically comply with open source licenses. If CI is failing, check the following:

  • Is it showing a no license specified error for a crate you've created? If so, add publish = false under [package] in your crate's Cargo.toml.
  • Is the error failed to satisfy license requirements for a dependency? If so, first determine what license the project has and whether this system is sufficient to comply with this license's requirements. If you're unsure, ask a lawyer. Once you've verified that this system is acceptable add the license's SPDX identifier to the accepted array in script/licenses/zed-licenses.toml.
  • Is cargo-about unable to find the license for a dependency? If so, add a clarification field at the end of script/licenses/zed-licenses.toml, as specified in the cargo-about book.

Sponsorship

Zed is developed by Zed Industries, Inc., a for-profit company.

If youd like to financially support the project, you can do so via GitHub Sponsors. Sponsorships go directly to Zed Industries and are used as general company revenue. There are no perks or entitlements associated with sponsorship.