Commit graph

766 commits

Author SHA1 Message Date
Danilo Leal
ec9ba5f069
Make restricted mode more obvious (#57056)
Closes TRA-150

This PR makes the restricted mode more obvious by:

- Immediately opening the restricted mode modal upon opening an
untrusted project
- Disabling dismissing the modal on escape or click away to force
choosing one of the two options (and avoid accidentally staying in
restricted mode by simply dismissing it)
- Showing the LSP button but with communication about language servers
being disabled for untrusted projects
- Showing a banner in the project settings with the same communication

The motivation for this change was that we tried to be minimal with how
we communicate a project is untrusted, but it was so minimal that people
were confused as to why language servers and other settings weren't
working. It was easy to miss the title bar button, for some reason. The
changes in this PR makes it so acting on this decision (trust or not a
project) is mandatory in order to even start to interact with the
project. I appreciate changes here are more aggressive, but I think it's
better to make you think about this decision vs. letting you be confused
as to why you don't see LS completions or formatting.

Release Notes:

- Made restricted mode more obvious, demanding immediate action when
opening an untrusted project.
2026-05-18 16:18:59 +00:00
Koya Masuda
8ce894b909
git_ui: Count commit title length by characters instead of bytes (#57025)
Some checks are pending
Congratsbot / check-author (push) Waiting to run
Congratsbot / congrats (push) Blocked by required conditions
deploy_nightly_docs / deploy_docs (push) Waiting to run
run_tests / extension_tests (push) Blocked by required conditions
run_tests / orchestrate (push) Waiting to run
run_tests / check_style (push) Waiting to run
run_tests / clippy_windows (push) Blocked by required conditions
run_tests / clippy_linux (push) Blocked by required conditions
run_tests / clippy_mac (push) Blocked by required conditions
run_tests / clippy_mac_x86_64 (push) Blocked by required conditions
run_tests / run_tests_windows (push) Blocked by required conditions
run_tests / run_tests_linux (push) Blocked by required conditions
run_tests / run_tests_mac (push) Blocked by required conditions
run_tests / miri_scheduler (push) Blocked by required conditions
run_tests / doctests (push) Blocked by required conditions
run_tests / check_workspace_binaries (push) Blocked by required conditions
run_tests / build_visual_tests_binary (push) Blocked by required conditions
run_tests / check_wasm (push) Blocked by required conditions
run_tests / check_dependencies (push) Blocked by required conditions
run_tests / check_docs (push) Blocked by required conditions
run_tests / check_licenses (push) Blocked by required conditions
run_tests / check_scripts (push) Blocked by required conditions
run_tests / check_postgres_and_protobuf_migrations (push) Blocked by required conditions
run_tests / tests_pass (push) Blocked by required conditions
# What

- Replace `title.len()` with `title.chars().count()` in the commit title
length check, so the limit is measured in Unicode characters instead of
UTF-8 bytes.
- Applied in two places that share the same logic:
  - `crates/git_ui/src/git_panel.rs` — Git panel's inline warning
  - `crates/git_ui/src/commit_modal.rs` — commit modal's inline warning

# Why

The commit title length check used str::len(), which returns UTF-8 byte
length rather than character count. As a result, titles containing
multi-byte characters (Japanese, Chinese, emoji, etc.) triggered the
warning far below the configured commit_title_max_length — around 24
characters instead of the default 72.


Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
  - Before


https://github.com/user-attachments/assets/a895530c-2f73-470c-97fa-29d9467c14e1

  - After


https://github.com/user-attachments/assets/ffbe1ba2-0ccc-4b02-87f5-836da7841dd9


- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes #ISSUE

Release Notes:

- Fixed commit title length check miscounting multi-byte characters as
multiple characters.
2026-05-18 13:13:41 +00:00
Danilo Leal
e1b06d1baf
git_ui: Improve history tab focus display (#56813)
Follow-up to https://github.com/zed-industries/zed/pull/56743 where we
only show the focused styles in history tab items if you're navigating
it with the keyboard. We were previously flashing the focused border
styles on click and they're not necessary if you're pointer-based.

Release Notes:

- N/A
2026-05-15 12:46:37 +00:00
Danilo Leal
e80b7443ea
git_ui: Improve GitHub avatar display (#56755)
We had a problem that became more evident to me in the newly-introduced
History tab in the Git panel where the avatars wouldn't show up for a
long time. Problem was that we were trying to render the avatar before
the GitHub user email came in, and that wouldn't work well because it
would 1) skip the fast CDN (which could get rate-limited fast), and 2)
cache the `None` result. So this improvement works by only attempting to
render the avatar when the email is available.

Release Notes:

- Git UI: Improve the display of user avatars in Git-related surfaces.
2026-05-14 14:43:03 +00:00
Danilo Leal
c937fc6e33
git_panel: Allow to switch between changes and history tab with keyboard (#56743)
Follow-up to https://github.com/zed-industries/zed/pull/56500. Was
missing this ability very much :)

Release Notes:

- Git Panel: Added the ability to switch between the changes and history
tabs with the keyboard.
2026-05-14 13:11:14 +00:00
Ben Brandt
cad7406d52
agent_ui: Require an open project for agent panel (#56577)
A bit brute force, but it works.

<img width="1106" height="988" alt="image"
src="https://github.com/user-attachments/assets/d23f9a80-01c5-4ad3-a280-faf8b8bc9dbe"
/>


Self-Review Checklist:

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

Release Notes:

- N/A

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
2026-05-14 01:24:30 +00:00
Anthony Eid
41c710b0a2
git: Allow choosing branch diff target in branch diff view (#56569)
Some checks are pending
Congratsbot / check-author (push) Waiting to run
Congratsbot / congrats (push) Blocked by required conditions
deploy_nightly_docs / deploy_docs (push) Waiting to run
run_tests / orchestrate (push) Waiting to run
run_tests / check_style (push) Waiting to run
run_tests / clippy_windows (push) Blocked by required conditions
run_tests / clippy_linux (push) Blocked by required conditions
run_tests / clippy_mac (push) Blocked by required conditions
run_tests / clippy_mac_x86_64 (push) Blocked by required conditions
run_tests / run_tests_windows (push) Blocked by required conditions
run_tests / run_tests_linux (push) Blocked by required conditions
run_tests / run_tests_mac (push) Blocked by required conditions
run_tests / doctests (push) Blocked by required conditions
run_tests / check_workspace_binaries (push) Blocked by required conditions
run_tests / build_visual_tests_binary (push) Blocked by required conditions
run_tests / check_wasm (push) Blocked by required conditions
run_tests / check_dependencies (push) Blocked by required conditions
run_tests / check_docs (push) Blocked by required conditions
run_tests / check_licenses (push) Blocked by required conditions
run_tests / check_scripts (push) Blocked by required conditions
run_tests / check_postgres_and_protobuf_migrations (push) Blocked by required conditions
run_tests / extension_tests (push) Blocked by required conditions
run_tests / tests_pass (push) Blocked by required conditions
### Summary

Added a branch diff base branch picker that shows the selected diff base
and prioritizes branches on the active branch’s remote. This also
generalizes the branch picker’s checkout vs. select only behavior so its
UI/search/rendering can be reused by a future git graph picker, and
makes branch diff drop stale in progress base update tasks when the base
or repository changes for faster response.

Self-Review Checklist:

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

Closes  #54050

Release Notes:

- git: Allow choosing branch diff base in branch diff view

---------

Co-authored-by: Remco Smits <djsmits12@gmail.com>
2026-05-13 23:15:35 +00:00
Smit Barmase
64f624773f
git_ui: Add force delete for worktrees (#56519)
Follows similar approach as
https://github.com/zed-industries/zed/pull/55927

Adds a force-delete path to the worktree picker. Normal delete now
prompts when Git reports modified or untracked files, and
Alt/Option-delete can force delete directly.

  Release Notes:

- Added support for force deleting worktrees that contain modified or
untracked files.
2026-05-12 19:17:49 +00:00
Ben Kunkle
bb473f5ece
git: Refresh git: branch diff when project changes and command is rerun (#56552)
Self-Review Checklist:

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

Closes #ISSUE

Release Notes:

- Fixed an issue where re-running the `git: branch diff` after changing
the active project would not refresh the branch diff to show the branch
diff of the active project
2026-05-12 16:29:14 +00:00
Danilo Leal
61da34c69f
git_panel: Add commit history view (#56500)
This PR adds a history view to the git panel. It draws from similar
implementations of commit listing in other places like the file history
view and the git graph.

| Changes View | History View |
|--------|--------|
| <img width="2600" height="2026" alt="Screenshot 2026-05-12 at 3 
38@2x"
src="https://github.com/user-attachments/assets/00d7d21b-8516-481a-a34e-86589b8ced52"
/> | <img width="2688" height="2114" alt="Screenshot 2026-05-12 at 3 
39@2x"
src="https://github.com/user-attachments/assets/4a87c04a-011b-40fc-a04c-b791720d9abc"
/> |

Release Notes:

- Git: Added a history view to the Git panel that allows to quickly see
in a list all the commits for a given branch.

---------

Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-05-12 15:52:52 +00:00
Danilo Leal
1a2e50e3f2
git_panel: Improve empty states (#56454)
This PR makes the empty states of the Git panel a little bit more
polished by making font sizes and button placement more consistent. Also
ended up cleaning up the `panel_button` abstraction as that felt a bit
unnecessary. We're just using the buttons directly like we do in other
places in the codebase.

Release Notes:

- N/A
2026-05-12 01:34:14 +00:00
alkinun
e621d0dd05
git_ui: Escape markdown in discard confirmation dialog (#56197)
## Summary

Filenames containing markdown syntax (e.g. `__somefile__`, `*somefile*`)
were being rendered as formatted text in the git discard confirmation
dialog.

Follow-up to #55697 for the git discard confirmation path mentioned in
#53060.

## Changes

Wrapped the git discard confirmation filename with `MarkdownInlineCode`
in `git_panel.rs`, so special markdown characters like `_`, `*`, and `[`
render literally.

## Testing

Added `test_discard_prompt_escapes_markdown_in_file_name` in
`git_panel.rs` to verify filenames with markdown special characters
render literally in the discard confirmation dialog.

Run:
```bash
cargo test -p git_ui test_discard_prompt_escapes_markdown_in_file_name
```

Release Notes:

- Fixed file names containing markdown special characters (e.g.
`__somefile__`) being rendered as formatted text in the git discard
confirmation dialog.
2026-05-08 20:06:36 +00:00
Kirill Bulatov
c049193fd9
Make all status bar tools able to hide its button via UI (#54971)
Closes https://github.com/zed-industries/zed/discussions/53471

Adds a requirement on status bar items to provide a way to hide
themselves.

<img width="329" height="153" alt="image"
src="https://github.com/user-attachments/assets/b98ee5ba-a439-44d7-9ab5-f4511b66a574"
/>

<img width="464" height="40" alt="image"
src="https://github.com/user-attachments/assets/b41d9189-3475-4e61-b3a4-bc731dd52c53"
/>


Release Notes:

- Added a way to hide sidebar buttons
2026-05-08 10:36:03 +00:00
Cole Miller
10afe2ff28
git: Make git::Commit do an amend when amending is pending (#54472)
Self-Review Checklist:

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

Release Notes:

- The `git::Commit` action (cmd-enter or ctrl-enter) will now commit a
pending amend.
2026-05-07 17:26:06 +00:00
Cameron Mcloughlin
68256f2e1d
git: Add dev: show git job queue (#55904)
Adds a command to help debugging stuck git job queues

Release Notes:

- N/A or Added/Fixed/Improved ...

---------

Co-authored-by: Anthony Eid <hello@anthonyeid.me>
2026-05-07 15:56:32 +00:00
Smit Barmase
0de588c0c9
git_ui: Add force delete for unmerged branches (#55927)
Git's `-d` flag deletes a branch only if it's fully merged into its
upstream or HEAD - this is what we were using before, which caused the
"not fully merged" error. The `-D` flag force deletes a branch even with
unmerged changes (equivalent to `--delete --force`).

### Before

Deleting an unmerged branch failed with a "not fully merged" error
toast.

### After

- Deleting an unmerged branch prompts for confirmation to force delete
- Delete button tooltip shows "Hold alt to force delete" hint
- Holding **alt** turns the delete icon red and tooltip changes to
"Force Delete Branch"
- Force delete keybinding: `cmd-alt-shift-backspace`

Release Notes:

- Added confirmation prompt when deleting unmerged git branches, with
option to force delete.
- Added alt+click on delete button to force delete a branch immediately.
2026-05-06 20:08:42 +00:00
Mikhail Pertsev
b470b50d52
editor: Extract rewrap and config out of editor.rs (#55855)
cc @SomeoneToIgnore

## Summary

Follow-up to https://github.com/zed-industries/zed/discussions/55352,
where the conclusion was to split `editor.rs` incrementally by topic
instead of all at once.

This mechanically extracts editor config and reflow-related code into
`crates/editor/src/config.rs` and `crates/editor/src/rewrap.rs`, while
preserving existing behavior and keeping externally-used APIs public
where needed.

Self-Review Checklist:

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

Release Notes:

- N/A
2026-05-06 11:57:36 +00:00
Jake Norris
11f0ca5881
Fix git graph file diff view opening wrong file if a previous one is already open (#55595)
Fixed the portion of the open() function of the CommitView struct that
checked to see if the commit view was already open in a tab. Previously,
it did not account for files being filtered, and called
pane.activate_item() when it found a matching commit SHA open. Now, the
pane item is deleted and replaced with the new CommitView, respecting
the position of the tab. This allows for the filtered files to be
updated and work according to the expectations laid out in the mentioned
issue.

Self-Review Checklist:

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

Closes #55446

Release Notes:

- Fix git graph file diff view opening wrong file if a previous one is
already open

---------

Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com>
2026-05-06 01:49:36 +00:00
Conrad Irwin
be705e677b
Merge gpui::Task and scheduler::Task (#53674)
Release Notes:

- N/A or Added/Fixed/Improved ...
2026-05-05 22:41:13 +00:00
Remco Smits
3fab3af56b
git_panel: Fix commit message text behind Open Commit Modal button (#55565)
This PR fixes an issue where the your commit message inside the git
panel commit editor could be behind the `Open Commit Modal` button.

**Before**
<img width="391" height="180" alt="Screenshot 2026-05-03 at 18 11 33"
src="https://github.com/user-attachments/assets/f9c68665-ca82-4fb0-80e1-d501891f5ef5"
/>

**After**
<img width="359" height="179" alt="Screenshot 2026-05-05 at 18 18 58"
src="https://github.com/user-attachments/assets/1ff610c7-5758-4446-9666-67c194b1d3f9"
/>

Self-Review Checklist:

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

Release Notes:

- Fix git commit message editor text could be behind the `Open Commit
Modal` button
2026-05-05 17:33:57 +00:00
Cameron Mcloughlin
0434f036c3
git: Remove potentially confusing words from worktree names (#55314)
Changes the list of words used when generating random worktree names to
avoid anything even tangentially related to software engineering.

Release Notes:

- N/A or Added/Fixed/Improved ...
2026-04-30 11:39:06 +00:00
Mikhail Pertsev
fffd3e55cb
git_ui: Fix the Git panel commit message editor ignoring buffer_font_size (#55233)
Closes #55227

Updates the Git panel commit message editor to respect the configured
`buffer_font_size` when using buffer/editor typography. This keeps the
commit box visually consistent with other editor text while preserving
the existing UI-font sizing path for non-buffer panel editor styles.

Self-Review Checklist:

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

Release Notes:

- Fixed the Git panel commit message editor ignoring `buffer_font_size`
2026-04-30 11:33:31 +00:00
Dong
dc5af1de64
git_panel: Fix empty state label not align to center (#55235)
When the git panel is too narrow for "No changes to commit" or "No Git
Repositories" to fit on a single line, the wrapped lines were
start-aligned while the button below remained centered, breaking the
visual stack.

This wraps each label in a stretched, text-centered `div`, matching the
pattern already used by `render_unsafe_repo_ui` in the same file. The
bare string is kept (no `Label`) so the parent `v_flex`'s
`text_color(Color::Placeholder)` continues to apply unchanged.

### Repository detect

| As-is | To-be |
| --- | --- |
| <img width="400"
src="https://github.com/user-attachments/assets/d4388d15-057f-4ea2-ac02-528aa165578a"
/> | <img width="400"
src="https://github.com/user-attachments/assets/a7901061-9ff2-4bbc-b135-728089d6f43e"
/> |

### Repository not detect

| As-is | To-be |
| --- | --- |
| <img width="400"
src="https://github.com/user-attachments/assets/cc41387a-108e-43c1-848e-f7241dd33c73"
/> | <img width="400"
src="https://github.com/user-attachments/assets/c8a2f263-9fe4-450f-9d54-174bfa68e483"
/> |



Self-Review Checklist:

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

Closes N/A

Release Notes:

- git_panel: Fixed empty state labels in the git panel becoming
left-aligned when wrapped to multiple lines
2026-04-30 11:30:06 +00:00
Neel
f88ab1bb47
git_ui: Add option to jump to project file from commit (#55088)
Using the `Open File` action from a file in commit context takes you to
a read-only snapshot of the file at the point in time of the commit.
This change makes it so you navigate to the current working copy of the
file, if one exists. This has similar semantics to copy file reference.

For a file that still exists at HEAD:
<img width="715" height="469" alt="image"
src="https://github.com/user-attachments/assets/e217e0be-b549-46fa-9d1b-eba92728fa4a"
/>

For a file that no longer exists:
<img width="438" height="271" alt="image"
src="https://github.com/user-attachments/assets/ac87465b-971b-4413-8bf3-71e49a71bdea"
/>

Release Notes:

- Add affordance to jump to project file from commit view
2026-04-29 12:07:39 +00:00
Yara 🏳️‍⚧️
320888142f
Rust 1.95 (#55104)
Self-Review Checklist:

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

Closes #ISSUE

Release Notes:

- N/A
2026-04-29 10:27:47 +00:00
Dino
4e636bf07a
git_panel: Add support for vertically expanding the commit editor (#55043)
Using the existing commit editor in the Git Panel to type out longer
commit messages has been somewhat hard. I believe this happens because
it takes a very small portion of the UI which, unfortunately, when `git:
expand commit editor` is used, a modal ends up taking the center of the
editor, making it possible to have the commit editor open on the side,
while the `git: diff` view is open.

As such, this Pull Request introduces a new
`git::ToggleFillCommitEditor` action that allows users to update the
commit editor's height so as to take as much vertical space as possible,
hiding the entries status and simply rendering the Git Panel's footer.

This makes it easier to be able to write longer commit messages while
still having the `git: branch diff` on the side, something that's very
complicated with the default number of lines in the commit editor and
impossible using the `CommitModal`.

Self-Review Checklist:

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

Release Notes:

- Added a `git::ToggleFillCommitEditor` action that expands the commit
editor to fill the git panel's available vertical space.

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
2026-04-28 16:09:23 +00:00
Austin Cummings
1376130066
git_ui: Replace commit message generation spinner with a cancel button (#49540)
When a model produces poor output during commit message generation,
there was no way to cancel it. This replaces the non-interactive spinner
with a Stop button that cancels the generation task. Partial generated
text is kept in the editor.

Partially addresses #33556


<img width="1200" height="900" alt="2026-02-18-160103_hyprshot"
src="https://github.com/user-attachments/assets/760e9681-b374-4f40-a4b1-0bb6775db17c"
/>

---

Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- Added a button to stop commit message generation in the git panel

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
2026-04-27 09:54:48 +00:00
Dino
1afe44c1b6
git: Improve handling of unsafe repositories (#43693)
These changes update Zed's Git Panel to be able to detect unsafe git
repositories, where the user running Zed doesn't own the `.git`
directory, and show a dedicated empty view in the Git Panel that not
only explains the situation but also allows the user to choose whether
to trust this directory, which will end up running `git config --global
--add safe.directory <path>`.

While testing those changes, it was noted that attempting to add or
reset files after trusting the directory would fail, as expected, but
the UI wouldn't react to the fact that those operations failed. What
this means is, if the user tried to add a file, the UI would show a
checkmark for that file and, after the operation failed, the checkmark
would remain. We now revert that, for both `git add` and `git reset`.

Some more technical notes on this change:

- Introduce `project::git_store::GitAccess` enum to express whether we
actually have access to the repository, exposed via
`git::Repository::access`, which probes the backend with a `git status`
command and classifies the result.
- On unsafe repositories,
`project::git_store::LocalRepositoryState::new` fails to spawn the git
worker, which now cleanly signals `GitAccess::No` rather than leaving
the panel in a broken state.
- Updated `git_ui::git_panel::GitPanel::render_empty_state` with a third
alternative, when `GitAccess::No`, that basically renders a view
explaining why the repository is considered unsafe, together with
buttons for git's documentation on safe directories and a button to add
the repository's folder as a safe directory
- Updated `project::git_store::GitStore` to now watch `~/.gitconfig` and
`$XDG_CONFIG_HOME/git/config`. Watching this files allows the Git Panel
to react when the git configuration is updated, which will be the case
if the user decides to trust the repository. When either changes, a
`GitStoreEvent::GlobalConfigurationUpdated` event is emitted and the
panel refetches repository state.
- Added `project::git_store::Repository::refetch_repo_state` field,
which stores a closure to allow recreating the
`Repository::repository_state` and the job sender after the repository's
directory is trusted, without requiring a project reload.
- Added a `fs::Fs::git_config` trait method, wrapping a real `git
config` invocation. In order to be able to call this, both
`git_store::GitStore::git_config` and `project::Project::git_config`
wrappers have also been introduced. Worth mentioning that this isn't yet
supported for remote projects or collab guests.
- Updated `fs::Fs::git_clone` argument order to match
`fs::Fs::git_config` and `fs::Fs::git_init`.
- Added a new
`project::git_store::pending_op::PendingOps::last_op_errored` method
that allows determining whether the last pending operation failed. This
now allows us to filter out failed operations when determining whether
`git add` or `git reset` failed, so that we can fall through to the real
git status.
- Updated `git_ui::git_panel::GitPanel::change_file_stage` to now call
`update_counts` in its error branch so the cached staged counters stay
consistent with the reverted per-entry state, seeing as we now handle
reverting the UI state if an operation fails.
- Fixed `fs::RealFs::git_init` to fall back to the provided branch name
when `git config --global --get init.defaultBranch` fails, for example,
when the user hsan't configured one.

Co-authored-by: cameron <cameron.studdstreet@gmail.com>

Closes #42286

Release Notes:

- Added a dedicated empty state in the Git Panel for unsafe
repositories, with a "Trust Directory" button that adds the repository
to `safe.directory`
- Fixed stage and unstage checkboxes in the Git Panel not reverting when
a `git add` or `git reset` command failed

---------

Co-authored-by: cameron <cameron.studdstreet@gmail.com>
Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
2026-04-24 17:14:24 +00:00
Danilo Leal
f2e9c5a025
Fix when agent-powered merge conflict button shows up (#54791)
This PR fixes the logic to dismiss the "resolve merge conflict with
agent" button. Previously, we were just observing
`merge_heads_by_conflicted_path`, which seems to be intentionally
sticky, preserving the conflicted paths until changes are either
committed or aborted. This would make the button to resolve conflicts
show up even _after_ the changes get resolved. Now, we're checking
whether paths are _currently_ conflicted (`is_conflicted()`), and if
they are not, we don't display the button, even though the resolution
might have not been committed or aborted yet.

As a bonus, in this PR, I'm also putting the resolve conflict button
_before_ the activity indicator, so as to avoid bounciness, and did a
quick polish of the activity indicator button itself, by using the
`Button` component.

Release Notes:

- Fixed a bug with the merge conflict "resolve with agent" button where
it would be displayed even though all conflicts have already been
resolved.
2026-04-24 14:41:44 +00:00
Lukas Wirth
c5a2807492
Remove smol as a dependency from a bunch of crates (#53603)
We aren't making use of it in these crates and it unblocks some
web-related work

Release Notes:

- N/A or Added/Fixed/Improved ...
2026-04-24 10:29:51 +00:00
Anthony Eid
0194fe0576
git: Replace file history view with git graph (#50288)
## Summary

This PR replaces the git file history view with the git graph view that
doesn't render the graph canvas. This has several advantages

1. Benefits from the graphs performance and lazy loading
2. Gets the graph's search for free
3. Resizable columns
4. The commit information panel
5. Is persistent 
6. Cleans up a lot of code

The one con of this change is the graph doesn't have support
remote/collab support yet, but that is a WIP and should be merged within
a week.

Also, the git graph now propagates errors to the UI, which is the last
thing on the graph's stable launch todo list!

Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- N/A *or* Added/Fixed/Improved ...

---------

Co-authored-by: dino <dinojoaocosta@gmail.com>
Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
Co-authored-by: Joseph T. Lyons <JosephTLyons@gmail.com>
2026-04-24 02:51:19 +00:00
Finn Evers
9b40411c6a
Fix bad GitHub merge queue merge (#54721)
No, sadly, the title is not a typo. See
https://www.githubstatus.com/incidents/zsg1lk7w13cf for the context.
I'll read with joy and popcorn through that root cause analysis.

It makes literally zero sense what happened here, but for some completly
bonkers reason GitHub completely messed up the merge queue with
https://github.com/zed-industries/zed/pull/54632.

I have no idea how it happened. It makes literally zero sense. A PR
going into the merge queue should have the same LoC when getting out of
it. GitHub obviously does not check this. GitHub causes extra work with
a feature that is supposed to save time.

Thanks, I guess.

Release Notes:

- N/A

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
2026-04-23 23:47:30 +00:00
Joseph T. Lyons
4fc8a581e9
Add a git: copy branch name action (#54702)
I frequently use the branch name copy action in GitHub Desktop.
I want to do this in Zed.

Self-Review Checklist:

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

Release Notes:

- Added a `git: copy branch name` action.
2026-04-23 19:51:57 +00:00
Danilo Leal
0ab64d6414
branch_picker: Add button to filter remote branches (#54632)
This PR brings back the button to filter remote branches when accessing
the title bar's branch picker with the mouse. It was unintentionally
removed when we introduced the new worktree picker.

Release Notes:

- N/A
2026-04-23 18:26:44 +00:00
Cameron Mcloughlin
cf8eb424b0
Add warning when git commit title is longer than 72 chars (#54653)
Adds a warning to the git commit panel when the message title (i.e.
first line) is longer than 72 (configurable) chars.

<img width="406" height="227" alt="image"
src="https://github.com/user-attachments/assets/08b900d0-3865-4530-8495-e301d5b8c452"
/>

<img width="754" height="482" alt="image"
src="https://github.com/user-attachments/assets/574ebaa5-d6b7-48cd-9ca4-6ee01172ccb4"
/>


Release Notes:

- Added: Display a warning when git commit message title exceeds a
configurable limit

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
2026-04-23 17:02:36 +00:00
Danilo Leal
a00f07381c
git_panel: Add some UI improvements (#54630)
Nothing major, just some small quality of life improvements here:

- Makes the header's checkmark always visible and the entire row surface
area a clickable target
- Only displays the project picker when there is more than one repo;
this avoids having to show a disabled button

Release Notes:

- N/A
2026-04-23 15:12:45 +00:00
Anthony Eid
b830524713
git: Fix create worktree hook tasks running when switching worktrees (#54612)
This PR fixes a regression that was likely caused by:
https://github.com/zed-industries/zed/pull/54183 and wasn't caught
because I didn't add a regression test when I originally created the
feature.

The fix was only running the hooks when the worktree was just created,
and I added an integration test to prevent regressions from occurring
again in the future.

Self-Review Checklist:

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

Closes #54598

Release Notes:

- git: Fix create worktree hook tasks running when switching worktrees
2026-04-23 11:05:54 +00:00
NaritaHARUKI
9c5d609543
Add side-by-side split diff view to FileDiffView (#50046)
## Summary
- Enable VSCode-like side-by-side file comparison in FileDiffView using
SplittableEditor
- Leverages existing SplittableEditor infrastructure that ProjectDiff
already uses
- Controlled by the user's `diff_view_style` setting (split/unified)

## Changes
- `crates/git_ui/src/file_diff_view.rs`: Refactored to use
SplittableEditor instead of plain Editor (+66/-30 lines)

## Test plan
- [ ] Open a file with git changes and verify the diff view renders
correctly
- [ ] Toggle between split and unified diff view styles via settings
- [ ] Verify side-by-side comparison shows old/new content correctly

Release Notes:

- Enabled side by side diffs in the file diff view

Co-authored-by: Lukas Wirth <me@lukaswirth.dev>
2026-04-23 10:08:01 +00:00
Anthony Eid
f1ce3728cf
git_ui: Use switch wording in branch picker (#54606)
Closes #54467

This PR changes the branch picker’s confirm label from "Select" to
"Switch" to better match the rest of the codebase and the action
performed when confirming in the picker.

I originally considered using "checkout", but since most places in our
codebase use "switch" as the branch command name, I stuck with that.

Release Notes:

- N/A
2026-04-23 07:15:03 +00:00
Korbin de Man
e4e656fb42
Add "Add to .gitignore" action in project_panel (#47377)
This PR adds a "Add to .gitignore" action to the project panel's
right-click context menu. Similar to the "Restore File" action that I
previously added, I frequently find myself wanting this in the project
panel.

<img width="380" height="391" alt="image"
src="https://github.com/user-attachments/assets/e4438fbe-b070-40c8-9e57-84b003fa5c15"
/>

With the restore file option:
<img width="382" height="408" alt="image"
src="https://github.com/user-attachments/assets/84425de8-04e5-4969-8991-edc46e6420dc"
/>

Notes:
- **Implementation**: The `add_to_gitignore` function is essentially
copy-pasted from `git_panel.rs`.

- **Error handling**: Added toast notification on error, which is
consistent with `restore_file` in project_panel and `perform_checkout`
in git_panel.
Note that `add_to_gitignore` in git_panel does NOT show a toast (just
uses `detach_and_log_err`). I don't know if this is on purpose.
To follow up, I can either: match the project_panel implementation to
the git_panel one (no toast), or update the git_panel implementation to
also show a toast on error.

- **Menu grouping**: Previously "Restore File" and "View File History"
were in separate sections, but both relate to git. With this third git
action, I grouped all three together under a single separator (see
screenshot).
We could also keep "View File History" separate and only group "Restore
File" + "Add to .gitignore" together (both modify the working tree state
in some way), if we don't want to alter the existing UI too much.

Release Notes:

- Added "Add to .gitignore" option to the project panel context menu for
files in git repositories.

---------

Co-authored-by: Chris Biscardi <chris@christopherbiscardi.com>
2026-04-23 05:46:58 +00:00
Bennet Bo Fenner
a658e1d3b0
git_ui: Fix double borrow when showing worktree error message (#54555)
Fixes ZED-6Q0

Self-Review Checklist:

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

Closes #54544

Release Notes:

- Fixed a crash that could occur when git worktree creating fails
2026-04-23 00:30:05 +02:00
Chris Biscardi
8e4c679723
Handle git push when there is no remote (#54522)
Previously hitting `Publish` in the git panel would silently fail with
no error message if the git repo was new or didn't have a remote.

Now, when hitting `Publish` or attempting to push when there is no
remote using keyboard shortcuts, or using `Push To` or force push
options, an error message will be displayed.

<img width="1135" height="522" alt="Screenshot 2026-04-22 at 10 02
26 AM"
src="https://github.com/user-attachments/assets/93c5e7ee-371e-4c2c-961b-42501cbd7119"
/>

<img width="1135" height="522" alt="Screenshot 2026-04-22 at 10 02
36 AM"
src="https://github.com/user-attachments/assets/a923e5f2-4099-45b5-8fe2-eb78f4fc9f10"
/>


Self-Review Checklist:

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

Release Notes:

- Fixed handling of `git push` when there is no remote available to push
to
2026-04-22 11:15:22 -07:00
Cole Miller
7fd07dda55
git: Only show header staging checkboxes when hovering the header itself (#54204)
Previously, we would show these checkboxes whenever hovering anywhere in
the `entries` group, which covers all headers and status entries. This
seems excessive, and also has a problem that the header checkboxes
disappear when the mouse moves over a non-header (status entry)
checkbox, presumably because those have `stop_propagation`. Now, we only
show the checkbox for a header when that specific header is hovered.

Self-Review Checklist:

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

Release Notes:

- N/A
2026-04-22 12:53:30 -04:00
Cameron Mcloughlin
3cd0f4c419
git: Improve diff performance (#54435)
Previously, passing an empty range to `range_to_buffer_range` would
return no ranges, which would trigger a fallback case in the git diff
that caused the entire multibuffer to be invalidated every frame.

This PR fixes `range_to_buffer_range`, so that it returns a sensible
range if the input range is empty, preventing the fallback behaviour and
edit expansion.

Self-Review Checklist:

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

Closes #ISSUE

Release Notes:

- N/A or Added/Fixed/Improved ...

---------

Co-authored-by: Cole Miller <cole@zed.dev>
Co-authored-by: Anthony Eid <hello@anthonyeid.me>
2026-04-22 02:42:11 +00:00
Jason Lee
84dcf38dbe
gpui: Improve Anchored to support center position (#47154)
Release Notes:

- N/A

Ref https://github.com/longbridge/gpui-component/pull/1956 extract my
fork version of `anchored.rs` to let GPUI to support position Anchored
at center.


https://github.com/user-attachments/assets/8d0230ed-4b75-440b-b8c3-9bde3decd141

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-21 09:01:42 +00:00
Cole Miller
b8bec905de
git: Fix a panic when updating the split diff (#54352)
Self-Review Checklist:

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

Release Notes:

- Fixed a panic when using the split diff view.
2026-04-20 18:33:42 -04:00
Finn Eitreim
68541960a7
fuzzy_nucleo: Add strings module and route several pickers through it (#54123)
Stacked on top of #54112
This is part 2 of 3 towards #51197
More details from the original PR #53551

This PR includes the changes from #54112 , im not sure how to avoid
that, my understanding is that after that one is merged, this PR can be
rebased onto main and everything will be correct. You can also view the
version of this that does reflect the changes more directly here:
https://github.com/feitreim/zed/pull/1

## Changes

In this PR I added a more general string matching functionality to
`fuzzy_nucleo`, in order to have proper testing for this, I also changed
the command palette, tab switching picker, branch picker, and recent
projects picker to use this new implementation. I think the command
palette change in particular is awesome, just super nice to vaguely
gesture at the command i want and have it pop right up.

The main change here and departure from
https://github.com/zed-industries/zed/pull/37123 is realizing that the
primary reason for the regressions is actually how nucleo handles smart
case, the old `fuzzy` crate only uses the smart case argument to score
things differently, while nucleo actually filters on the case, eg. with
smart case query "Apple" wouldnt match "apple". To get around this we
always pass `CaseMatching::Ignore` to nucleo and implement the same
score modifications from fuzzy in our code.

There is a performance cost to that, of course, but from my testing it
is fairly static, not growing as the size increases, so maybe a query
takes 35 µs instead of 25 µs, but a query that takes 800 µs will only
take 820 µs.

Benchmark:
| kind | query | size | nucleo | fuzzy | nucleo/fuzzy |
  |---|---|---:|---:|---:|---:|
  | string | 1-word | 100 | 9.15 µs | 24.6 µs | 0.37× |
  | string | 1-word | 1000 | 150.2 µs | 207.2 µs | 0.72× |
  | string | 1-word | 10000 | 1.34 ms | 2.07 ms | 0.65× |
  | string | 2-word | 100 | 5.16 µs | 2.94 µs | 1.75× |
  | string | 2-word | 1000 | 29.0 µs | 11.0 µs | 2.63× |
  | string | 2-word | 10000 | 210.6 µs | 55.5 µs | 3.79× |
  | string | 4-word | 100 | 2.57 µs | 2.33 µs | 1.10× |
  | string | 4-word | 1000 | 6.98 µs | 5.85 µs | 1.19× |
  | string | 4-word | 10000 | 20.0 µs | 12.0 µs | 1.66× |

When I added the 4-word queries to the benchmarks I was actually really
concerned that the performance would be awful, making it unsuitable for
the command palette especially. However, I think due to the CharBag
pre-filtering when the query is longer, the performance is actually way
better than the 2 word case.

Video:


https://github.com/user-attachments/assets/3cd7221b-424f-4fd3-8df1-5543dcc340a3

Self-Review Checklist:

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

Release Notes:

- Improved fuzzy matching in the command palette, branch picker, tab
switcher, and recent projects picker to support multi-word queries.

---------

Co-authored-by: Yara <git@yara.blue>
2026-04-20 14:41:29 +02:00
Danilo Leal
9daf886775
Move the worktree picker to the title bar + make it always visible (#54183)
This PR makes Zed only have one worktree picker, as opposed to a flavor
of it in the title bar and another in the agent panel. It then moves it
to the title bar, making it always present, so that its trigger is
separate from the branch picker (which now contains only two views:
branches and stashes). For the worktree picker, I'm mostly favoring the
behavior we've introduced in the agent-panel-flavored version.

It also updates the title bar settings migration to use the JSON
`migrate_settings` helper instead of a shallow Tree-sitter rewrite, so
old `show_branch_icon = true` values are promoted to
`show_branch_status_icon = true` across root, platform, release-channel,
and profile settings scopes.

- [x] Move worktree creation logic to the `git_ui` crate to make this
more generic and less agent-specific
- [x] Double-check the remote use case and ensure nothing broke there
- [x] Improve the UX for the detached HEAD state; better invite people
to create a branch
- [x] Migrate `show_branch_icon = true` to `show_branch_status_icon =
true` across nested settings scopes

Suggested .rules additions

When migrating renamed settings keys that can appear in platform
overrides, release-channel overrides, or profiles, prefer the JSON
`migrations::migrate_settings` helper over shallow Tree-sitter key
rewrites unless tests explicitly cover every nested scope that can
contain the key.

Release Notes:

- Improved migration of the title bar branch status icon setting.

---------

Co-authored-by: Nathan Sobo <nathan@zed.dev>
Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
2026-04-20 09:29:51 +00:00
Yara 🏳️‍⚧️
73126dcb81
editor: Introduce Bookmarks (#54174)
Adds basic bookmark functionality to the editor, allowing users to mark
lines and later navigate between them. This is an MVP and will later be
expanded with a picker, vim marks integration and syntax tree based
bookmark positions. In this MVP bookmarks shift under external edits.

# UI
## Adding/Removing bookmarks
To add a bookmark:
- run the toggle bookmark action 
- hold secondary and click in the gutter
- open the context menu by right clicking in the gutter and select add
bookmark To remove a bookmark:
- run the toggle bookmark action 
- click on the bookmarks icon in the gutter
- open the context menu by right clicking in the gutter and select
remove bookmark

remove all bookmarks with `workspace: clear bookmarks`


# Implementation
This mirrors the implementation of breakpoints. The rendering of the
gutter was refactored to make place for bookmark icons and buttons:
- Code was extracted to a `Gutter` struct
- Runnables, breakpoints and bookmarks are now collected ahead of
layouting. Just before layouting we remove the items that collide and do
not have priority.
- The `phantom_breakpoint` is replaced by a `gutter_hover_button`

## In depth phantom breakpoint discussion:
This was phantom_breakpoint. It worked as follows:
 - A fake breakpoint was added to the list of breakpoints.
- While rendering the breakpoints it a breakpoint turned out to be fake
it would get a different description and look.
- The breakpoint list was edited run_indicators ("play buttons")
rendering to removes the fake breakpoint if it collided.

This would not scale to more functionality. Now we only render
breakpoints, bookmarks and run indicators. Then we render a button if
there is not breakpoint, bookmark or run indicator already present. We
can do so since the rendering of such "gutter indicators" has been
refactored into two phases:
 - collect the items.
 - render them if no higher priority item collides.

This is far easier and more readable which enabled me to easily take the
phantom_breakpoint system and use it for placing bookmarks as well :)

Note: this was previously merged but it needed a better squashed commit
message. For the actual PR see: 51404. This reverts commit
7e523a2d2b.

Release Notes:

- Added Bookmarks

Co-authored-by: Austin Cummings <me@austincummings.com>
2026-04-17 13:54:43 +02:00
Yara 🏳️‍⚧️
7e523a2d2b
Revert "editor: Bookmarks MVP" to update its description (#54163)
Reverts zed-industries/zed#51404 because I forgot to updated the
squashed commits description ....
2026-04-17 10:55:05 +00:00