Commit graph

307 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
Richard Feldman
5f5dd7ae30
Migrate Rules to global Skills and AGENTS.md (#56672)
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
Adds a one-time, idempotent startup migration that moves every user Rule
out of the `PromptStore` LMDB database into the new Skills + AGENTS.md
world, in a single pass:

- **Non-Default Rules → global Skills.** Each one becomes
`~/.agents/skills/<slug>/SKILL.md` with `disable-model-invocation:
true`, preserving the original behavior that non-Default Rules were only
ever invoked when the user named them. They're now invokable via
`/skill-name` (and still `@`-mentions).
- **Default Rules → global AGENTS.md.** Each one is appended to
`paths::agents_file()` (e.g. `~/.config/zed/AGENTS.md` on macOS/Linux,
`%APPDATA%\Zed\AGENTS.md` on Windows) under an `## H2` heading
containing the rule's title. Default Rules used to be auto-included in
every conversation; the global AGENTS.md is loaded into the system
prompt of every conversation, so the behavior is preserved.
- **Customized built-in prompts → global AGENTS.md** (currently just the
commit-message prompt). If the user has edited a built-in away from
Zed's shipped `default_content()`, the edited body is appended at the
top of the AGENTS.md block. Uncustomized built-ins (still on the shipped
default) are skipped so we don't pollute AGENTS.md with text the user
never wrote.

The migration is gated on the `skills` feature flag — users without the
flag never have their Rules touched in any way. A single global KVP flag
(`rules_to_skills_migration_done`) short-circuits the migration on
subsequent launches, so it runs at most once per machine even across
release channels. A process-lifetime `AtomicBool` guard additionally
prevents racing duplicate spawns when the underlying `cx.on_flags_ready`
callback fires multiple times at startup.

Migration is intentionally non-destructive: rule rows in the LMDB
database stay in place. Users can still see and edit them through the
existing UI, and a downgrade to a Zed build without skills support won't
lose anything.

Slug generation (`agent_skills::slugify_skill_name`) lowercases ASCII
letters, turns spaces into dashes, and drops every other
non-alphanumeric character entirely — so `foo!bar` becomes `foobar`, not
`foo-bar`. `&` is special-cased to become `and` (so `rock&roll` →
`rock-and-roll`). Slug collisions and pre-existing skill directories are
handled by appending `-2`, `-3`, etc.

A title-bar onboarding banner ("Skills have replaced Rules") surfaces
for every user on the `skills` feature flag. Clicking it opens a small
`AlertModal`-based explainer that summarizes the two destinations and
points users at the new `/skill-name` slash command (and notes that
`@`-mentions still work).

Closes AI-227
Closes AI-232

Release Notes:

- N/A
2026-05-14 16:30:08 +00:00
Danilo Leal
477e524e56
Improve update button version display (#56647)
This PR adds a small refinement to the update button, removing
truncation from the version we display. Instead of just showing the
short version of a SHA, we now display it in full, providing more
detailed information that sometimes was lost. Also am making the button
disabled when it's in the checking, downloading, and installing states,
given clicking on it at these moments doesn't do anything.

Release Notes:

- N/A
2026-05-13 16:29:58 +00:00
Marshall Bowers
31661a8383
client: Rename UserId to LegacyUserId (#56185)
This PR renames the `UserId` type in the `client` crate to
`LegacyUserId`.

The `id` field on the `User` has also been renamed to `legacy_id`.

This is strictly a rename, no change in behavior.

Release Notes:

- N/A
2026-05-08 15:53:40 +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
Danilo Leal
950161ff0f
title_bar: Display subfolders in the project button (#54796)
Follow up to https://github.com/zed-industries/zed/pull/54406.
Closes https://github.com/zed-industries/zed/issues/54782.

In the PR linked above, we made the label that's displayed in the
project button be always the repository name. However, if you're opening
up a subfolder of that repository as the main-root of a given
project/workspace, we wouldn't display that anymore. This PR fixes that
by _still_ displaying the repo name, but the subfolder, too, in the
titlebar:

<img width="500" alt="Screenshot 2026-04-24 at 4  52@2x"
src="https://github.com/user-attachments/assets/04c2c61d-874d-4694-88c9-06bad9677e49"
/>

Release Notes:

- Fixed a bug where we don't display subfolders of a repository in the
title bar's project button.
2026-04-30 16:11:06 +00:00
Max Brunsfeld
caccc65b1e
Improve bare repo support (#55153)
Fixes https://github.com/zed-industries/zed/issues/54830

This fixes a bugs where
* when there's no main worktree, we treated the first linked worktree as
main
* the titlebar and sidebar showed two different things when opening a
linked wortree directly

When there's no main worktree, our "project group key" will be the bare
repo path. For displaying this to the user, we try to present something
meaningful:
* If the bare repo is `foo.git`, we'll say "foo"
* If the bare repo is "bar/.bare", we'll "bar"

Release Notes:

- Fixed bugs in Zed's sidebar and titlebar when editing in git worktrees
created from bare repositories.
2026-04-29 13:16:37 +00:00
Danilo Leal
cd2248f76e
title_bar: Add "panel layout" menu to the user menu (#54771)
Closes https://github.com/zed-industries/zed/issues/54545

With the release of the parallel agents feature, we changed the default
panel positions optimizing for an agentic-first layout. Even though we
introduced a settings backfill _and_ the ability to revert after
interacting with the announcement toast, this change seems to be causing
a bit of frustration still. In response, this PR adds a "Panel Layout"
menu in the user menu that allows to quickly toggle between the
"Classic" layout and the "Agentic" layout. If you have a different set
up, you'll see a "custom" item there just confirming that.

| Panel Layout | Custom set up |
|--------|--------|
| <img width="1110" height="866" alt="Screenshot 2026-04-24 at 12 
52@2x"
src="https://github.com/user-attachments/assets/197fc4ec-b4b3-4b13-bcb3-9d3495cf0d0a"
/> | <img width="1156" height="866" alt="Screenshot 2026-04-24 at 12 
55@2x"
src="https://github.com/user-attachments/assets/ca791b1b-eb6a-47a9-8aa5-c2015f33e5bd"
/> |

Release Notes:

- Added a menu item in the user menu called "Panel Layout" which offers
the ability to quickly swap between the two standard panel layouts:
classic (project panel, git panel, etc., on the left) and agentic (agent
panel on the left, everything else on the right).
2026-04-24 12:47:15 +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
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
Danilo Leal
ad2939f2e0
Don't show branch and worktree title bar buttons if Git is disabled (#54667)
Closes https://github.com/zed-industries/zed/issues/54628

Release Notes:

- Fixed a bug where the worktree and branch buttons in the title bar
were still being displayed despite `disable_git` being turned on.
2026-04-23 15:33:34 +00:00
Danilo Leal
0858f1c0c4
title_bar: Fix worktree label showing main when opening a worktree directly (#54406)
This PR fixes an issue where we'd show incorrect worktree labels when
opening a linked worktree directly. The linked worktree name would be
displayed in the project button but the dedicated worktree button would
be displaying "main", which is incorrect.

Now that we have a dedicated worktree button in the title bar, we can
make the project button always show the root repository name,
effectively matching the threads sidebar.

Release Notes:

- Fixed the title bar worktree button showing "main" when opening a
linked git worktree directly.
2026-04-21 09:14:10 -03: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
Lukas Wirth
a62ae579ab
Performance tweaks (#54321)
Release Notes:

- N/A or Added/Fixed/Improved ...
2026-04-21 07:25:22 +00: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
Marshall Bowers
5c7325ad9a
title_bar: Don't show a badge for organizations without a plan (#53841)
This PR makes it so we don't show a plan badge for organizations that
don't have a plan.

Closes CLO-654.

Release Notes:

- N/A
2026-04-14 09:27:06 -04:00
Marshall Bowers
850c94c683
title_bar: Hide plan badge next to username when there are organizations (#53826)
This PR makes it so we hide the plan badge next to the username in the
user menu when there are organizations.

We instead show the plans next to each organization:

<img width="257" height="317" alt="Screenshot 2026-04-13 at 1 29 26 PM"
src="https://github.com/user-attachments/assets/0111e7ff-af09-48ba-a043-9e25c2dd24bd"
/>

Closes CLO-649.

Release Notes:

- N/A
2026-04-13 13:39:22 -04:00
Nathan Sobo
55e47138e9
agent_ui: Unify draft and background threads into retained threads (#53737)
> **Foundation PRs:** #53732, #53733, #53734 — These three draft PRs
contain the base refactors (retained workspaces, agent panel overlay
split, ThreadId introduction) that this PR builds on.

## Goal

Remove `DraftId` and merge `draft_threads` + `background_threads` into a
single `retained_threads: HashMap<ThreadId, Entity<ConversationView>>`
in `AgentPanel`. A draft is just a thread that hasn't sent its first
message — no separate identity or storage needed.

## Changes

### agent_panel.rs
- Remove `DraftId` / `DraftIdCounter` / the `Global` impl
- Merge the two maps into `retained_threads`
- Add `thread_id: ThreadId` field to `BaseView::AgentThread`
- Rename methods: `create_draft` → `create_thread`, `activate_draft` →
`activate_retained_thread`, `remove_draft` → `remove_thread`, etc.
- Replace `clear_active_thread` with `show_or_create_empty_draft`
- Update `update_thread_work_dirs` to sync `ThreadMetadataStore` paths
when worktrees change
- Keep `load_agent_thread(...)` cleanup so activating a real thread
removes empty retained drafts

### sidebar.rs
- Remove `active_entry` derivation from `rebuild_contents` (was racing
with deferred effects)
- Add `sync_active_entry_from_panel` called from event handlers instead
- Simplify `ActiveEntry` — remove `ThreadActivation` struct, make
`session_id` optional
- Move `seen_thread_ids` to global scope (was per-group, causing
duplicate thread entries)
- Remove dead code: `clear_draft`, `render_draft_thread`
- Generalize `pending_remote_thread_activation` into
`pending_thread_activation` so all persisted-thread activations suppress
fallback draft reconciliation
- Set the activation guard before local persisted-thread activation
switches workspaces
- Make `reconcile_groups(...)` bail while a persisted-thread activation
is in flight
- On `ActiveViewChanged`, clear empty group drafts as soon as a pending
persisted-thread activation resolves

### thread_metadata_store.rs
- Make `ThreadMetadata.title` an `Option<SharedString>` with
`display_title()` fallback
- Add `update_worktree_paths` for batched path updates when project
worktrees change

### Other crates
- Update all `ThreadMetadata` construction sites and title display sites
across `agent_ui` and `sidebar`

## Fallback draft invariant

This PR now tightens the retained-thread invariant around fallback
drafts vs real thread activation/restoration:

- Fallback drafts are always empty
- User-created drafts worth preserving are non-empty
- While a persisted thread is being activated/restored/loaded, sidebar
reconciliation must not create an empty fallback draft for that target
group/workspace
- Once the real thread becomes active, empty fallback drafts in that
target group are removed

This is enforced by the sidebar-side activation guard plus existing
`AgentPanel` empty-draft cleanup after real-thread load.

## Tests

Added and/or kept focused sidebar regression coverage for:

-
`test_confirm_on_historical_thread_in_new_project_group_opens_real_thread`
-
`test_unarchive_into_inactive_existing_workspace_does_not_leave_active_draft`
-
`test_unarchive_after_removing_parent_project_group_restores_real_thread`
- `test_pending_thread_activation_suppresses_reconcile_draft_creation`

Focused test runs:

- `cargo test -p sidebar activate_archived_thread -- --nocapture`
- `cargo test -p sidebar unarchive -- --nocapture`
- `cargo test -p sidebar archive_last_thread_on_linked_worktree --
--nocapture`
- `cargo test -p sidebar
test_confirm_on_historical_thread_in_new_project_group_opens_real_thread
-- --nocapture`
- `cargo test -p sidebar
test_unarchive_into_inactive_existing_workspace_does_not_leave_active_draft
-- --nocapture`
- `cargo test -p sidebar
test_unarchive_after_removing_parent_project_group_restores_real_thread
-- --nocapture`
- `cargo test -p sidebar
test_pending_thread_activation_suppresses_reconcile_draft_creation --
--nocapture`

## Test fix

Fixed flaky `test_backfill_sets_kvp_flag` — added per-App `AppDatabase`
isolation in `setup_backfill_test` so backfill tests no longer share a
static in-memory DB.

Release Notes:

- N/A

---------

Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2026-04-13 09:07:09 +00:00
Max Brunsfeld
b15969086e
Set active repository when picking a root folder in recent project menu (#53645)
This changes the behavior of the recent project picker in multi-folder
projects, so that when you select a folder that is a repository, it sets
the active repository in the Git panel as well.

Release Notes:

- N/A
2026-04-10 12:12:42 -07:00
Angel P.
1fcf9749a6
Fix auto update status not being shown in the title bar (#53552)
Fixes a UI regression introduced in
https://github.com/zed-industries/zed/pull/48467, which prevented
automatic update statuses from being shown in the title bar unless the
update was checked for manually by the user, causing some users to
unknowingly cancel updates in progress by closing the application, since
there was no indication.


https://github.com/user-attachments/assets/ea16a600-3db4-49dc-bca5-11c8fcfff619

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 https://github.com/zed-industries/zed/issues/50162

Release Notes:

- Fixed missing indication that an update was currently being downloaded
or installed in the title bar
2026-04-10 06:38:50 +00:00
Lukas Wirth
1391918bc7
Remove storybook and story crates (#53511)
Remove the standalone storybook binary and the story crate, as component
previews are now handled by the component_preview crate.

Also removes the stories features from the ui and title_bar crates.

Release Notes:

- N/A or Added/Fixed/Improved ...
2026-04-09 12:32:27 +00:00
Danilo Leal
a0a74019a8
title_bar: Improve display of sign in state (#53255)
Closes https://github.com/zed-industries/zed/issues/52488

Release Notes:

- Improved the display of the sign in state in the title bar, by namely
showing "Signing in" when in an active process of signing in.
2026-04-08 07:58:50 -03:00
Mikayla Maki
6286b7c5fb
Fix workspace removal, and chase down all the ramifications (#53366)
This PR adjusts how project group removal works in the sidebar to be
project group aware. Removal is now a batched operation, and supports a
contextually appropriate fallback active workspace fallback. In the
process of removing this, I had to chase down and fix other broken code:
- Removes the "move to new window" actions
- Changed the sidebar to store things in "most recently added" order
- The recent project UI was still using workspaces, instead of project
groups
- Adjusted the archive command to use the new APIs to remove the
workspace associated with that worktree (cc: @rtfeldman)
- The property tests where still using indexes and workspaces instead of
project groups

Self-Review Checklist:

- [ ] 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-08 09:21:39 +00:00
Mikayla Maki
a018333d41
Introduce the temporary/retained workspace behavior based on whether the sidebar is open (#53267)
Self-Review Checklist:

- [ ] 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-06 21:42:04 +00:00
Conrad Irwin
4087d9f2ca
Remove Claude upsell (#52831)
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

Release Notes:

- Removed the (broken) Claude ACP upsell dialogue
2026-03-31 20:10:05 -06:00
Cameron Mcloughlin
d72a03827d
sidebar: Switch with ctrl-tab (#52423)
Overrides `ctrl-tab` when the sidebar/agent panel is focused to switch
between recently viewed threads

Release Notes:

- N/A or Added/Fixed/Improved ...
2026-03-28 17:48:34 +00:00
Mikayla Maki
8eb86241f6
Add a setting for moving the sidebar to the right (#52457)
## Context

This adds a setting for controlling the sidebar side

## Self-Review Checklist

<!-- Check before requesting review: -->
- [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: Eric <eric@zed.dev>
2026-03-26 01:35:10 +00:00
Danilo Leal
1358e42d26
title_bar: Display the org name in the user avatar trigger when not the personal (#52356)
Follow up to https://github.com/zed-industries/zed/pull/52343

We'll be experimenting showing the org name in the avatar trigger button
when that's not the personal one.

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <git@maxdeviant.com>
2026-03-24 19:29:32 -03:00
Danilo Leal
23ac4fd9d2
title_bar: Move the organization items inside the user menu (#52343)
Closes CLO-339

This PR moves the organization menu items inside the user menu, instead
of a standalone button within the title bar. We did it so because 1)
we're not fully sure how useful _always_ seeing in which org you are in
will be, and 2) seeing in which org you're in and seeing in which _plan_
you are in are very similar in terms of use case, and we don't currently
display the plan in the title bar... thus, that served as argument for
the same level of visibility.

---

- [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: Gaauwe Rombouts <mail@grombouts.nl>
2026-03-24 15:34:52 -03:00
Danilo Leal
eeafae370b
sidebar: Fix title bar upon moving workspace to a new window (#52266)
## Context

This PR adds a function to sync up the title bar state if a workspace is
moved to a new window through the threads sidebar. This is needed
because otherwise the padding for the traffic control buttons on macOS
wasn't being taken into consideration.

## How to Review

- Move a project to a new window from the sidebar 
- See that the title bar for that new window looks normal, as it should

---

- [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-03-24 09:28:41 -03:00
Mufeed Ali
60a29857f1
title_bar: Respect Linux titlebar config (#47506)
Currently, Zed always places three fixed window buttons (Minimize,
Maximize and Close) on the right side of the window in a fixed order
ignoring any user configuration or desktop environment preference (like
elementary).

This PR adds support for GNOME-style layout strings (`minimize:close`).
By default, we pull it from the gsettings portal, but we also allow
manual configuration via `title_bar.button_layout` config key.

<img width="1538" height="797" alt="image"
src="https://github.com/user-attachments/assets/5db6bfa2-3052-4640-9228-95c37f318929"
/>

Closes #46512

I know it's a relatively large PR for my first one and I'm new to Rust.
So, sorry if I've made any huge mistakes. I had just made it for
personal use and then decided to try to clean it up and submit it.

I've tested with different configs on Linux. Untested on other
platforms, but should have no impact.

If it's not up to par, it's okay, feel free to close :)

Release Notes:

- Added support for GNOME's window buttons configuration on Linux.

---------

Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
2026-03-23 22:01:12 +05:30
Danilo Leal
e126857732
sidebar: Add another round of refinements (#52101)
- Change the branch button's tooltip to be more accurate given it
displays more stuff than only branches
- Hide the worktree dropdown menu when in a non-Git repo project
- Improve provisioned title truncation
- Remove the plus icon from the "view more" item to improve sidebar's
overall feel
- Remove the always visible "new thread" button but make it visible only
when you're in an empty thread state
- Add worktree icon in the thread item and tooltip with full path
- Space out the worktree name from the branch name in the git picker in
the title bar
- Swap order of views in the git picker to "worktree | branches | stash"
- Improve the "creating worktree" loading indicator

---
<!-- Check before requesting review: -->
- [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-03-21 16:22:32 -03:00
Jason Lee
61c2a4334c
gpui: Add disabled state to app menu items (#44191)
Continue #39876 to add `disabled` state to `MenuItem`.

Make this change for #44047 ready to have disabled state.

1. Add `disabled` state to `MenuItem`.
2. Add some builder methods to `Menu` and `MenuItem`.
3. Improve `set_menus` method to receive a `impl IntoIterator<Item =
Menu>`.

Release Notes:

- N/A

--

<img width="294" height="204" alt="image"
src="https://github.com/user-attachments/assets/688e0db8-6c4e-4f9b-a832-8228db0e95d8"
/>

```bash
cargo run -p gpui --example set_menus
```
2026-03-20 11:00:00 +00:00
Danilo Leal
690d5af735
sidebar: Add several refinements (#51980)
## Context

- Improve how we detect when the sidebar should render the empty state.
It was previously wrong using `content.entries.is_empty`, which would
also happen if there are no search matches.
- Improved archive view keyboard nav and design. Not using the ListItem
here anymore so as to avoid confusing hover and active states.
- Move archive and open folder buttons to the bottom of the sidebar.
- Add a new flavor of the recent projects for the sidebar that only
serves as a way to _add_ projects.
- Add the ability to add (and remove) folders to a given project group
in the sidebar through a dropdown menu
--- 
- [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-03-19 22:11:22 -03:00
Jakub Konka
01fe4f694e
Add screen-sharing support on Wayland/Linux (#51957)
Release Notes:

- Added screen-sharing support on Wayland/Linux.

---------

Co-authored-by: Neel Chotai <neel@zed.dev>
2026-03-19 22:10:42 +01:00
Caio Raphael
806a72c540
title_bar: Prefer most specific repository for nested git repos (#51898)
## Context

I have a project with a nested git repo inside a parent repo (separate
`.git` directory, not a submodule). The title bar shows the parent's
branch instead of the nested repo's own branch.

The issue is in `get_repository_for_worktree()` — it iterates
`git_store.repositories()` (an `FxHashMap`) and returns the first
`starts_with` match. Both the parent and nested repo match, and
whichever one FxHashMap iterates first wins. There's no reason it should
be one or the other.

The fix already exists elsewhere in the codebase —
`GitStore::repository_and_path_for_project_path()` at
`git_store.rs:1826` uses `.max_by_key()` to pick the most specific
(longest path) match. This PR applies the same approach to three
functions that have the same problem:

- `TitleBar::get_repository_for_worktree()` — branch display in title
bar
- `resolve_active_repository()` in `git_ui` — repository selection for
the git panel
- `get_branch_for_worktree()` in `recent_projects` — branch display in
the project switcher

Two other locations use a similar `starts_with` pattern
(`effective_active_worktree()` in `title_bar.rs` and worktree selection
in `recent_projects.rs`) but those iterate worktrees against a single
known repo, not repos against a worktree — so first-match and
longest-match give the same result. Left those unchanged.

Closes #7566

## How to Review

All three changes are the same transformation: first-match loop (or
`.find()`) → `.filter().max_by_key()` on path length. The reference is
at `crates/project/src/git_store.rs:1826`.

The primary fix is `get_repository_for_worktree()` in `title_bar.rs`.
The other two are the same pattern.

One difference from the reference: I used `.as_os_str().len()` instead
of `.clone()` for the `max_by_key` key — avoids cloning an `Arc<Path>`
per comparison. Among prefix-related paths (which is all that passes the
filter), the longer path is always the more specific match, so length
comparison is equivalent.

`title_bar` has no existing test infrastructure. Happy to add a test if
you'd like — the setup would follow the pattern in
`test_git_traversal_with_nested_repos`
(`crates/project/tests/integration/git_store.rs`).

```
cargo test -p title_bar -p git_ui -p recent_projects
./script/clippy
```

## 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 branch picker showing parent repository's branch instead of the
nested repository's branch when working in submodules or nested git
repos.

---------

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
2026-03-19 15:52:12 +00:00
Danilo Leal
b9beb94d36
sidebar: Move toggle to the status bar instead (#51916)
- [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-03-19 07:41:10 -03:00
Danilo Leal
54ebf32062
sidebar: Add another round of UX refinements (#51884) 2026-03-18 23:04:54 -03:00
Max Brunsfeld
f0625add66
Show linked worktree names consistently in sidebar and titlebar (#51883)
This is a follow-up to https://github.com/zed-industries/zed/pull/51775,
making worktree names in the sidebar appear consistent with the
titlebar.

## Context

- [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: Eric Holk <eric@zed.dev>
2026-03-19 00:32:13 +00:00
Max Brunsfeld
2cc7d17f34
Fix usability issues with automatically-created git worktrees (#51775)
* [x] Display original project name as root folder in project panel,
titlebar
* [x] When manually creating worktrees, ensure final path component is
original project name
* [x] Display original project name, worktree name, and branch name in
titlebar
* [x] Only show main checkout in project switcher

Release Notes:

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

---------

Co-authored-by: Richard Feldman <oss@rtfeldman.com>
2026-03-18 22:49:16 +00:00
Finn Evers
de4522ed8f
title_bar: Fix share button being hidden when any modal is open (#51862)
This check was initially added in
https://github.com/zed-industries/zed/pull/19885/changes but has
regressed since. Making it explicit here again to stop this from
happening.

Release Notes:

- N/A
2026-03-18 19:29:58 +00:00
Mikayla Maki
67d7f99891
Fix shared database test isolation (#51809)
All of the important changes are in
[`db.rs`](https://github.com/zed-industries/zed/pull/51809/changes#diff-2f644eab943bfa58feec29256281a3d9e8d4d7784cd34783e845af8beb15b16d).
Consider reading the commit log in order to review this work.

The DB crate's macro and API was changed to fix flakiness observed in
the MultiWorkspace tests when run locally. This flakiness was caused by
a shared `static LazyLock`, that caused concurrent test runs to interact
with the same underlying in-memory database. This flakiness wasn't
possible on CI due to it's usage of `cargo nextest`, whose
process-per-test approach masked this problem.

Essentially, I've changed the `static_connection` macro to remove the
static database variable and redone the internal model. Now, all
database types are thin wrappers around a generic `AppDatabase`. The
`AppDatabase` collects all of the individual table's migrations via the
`inventory` crate, and so only runs the migrations once on startup,
rather than a dozen times on startup.

The new API requires a `cx` so that we can replace the database returned
at runtime, rather than relying exclusively on a process-global
thread-local. However, we are still using a `static LazyLock` so that we
only need to take an `&App`, instead of an `&mut App`. These databases
types are `Clone + Send + Sync`, so you can easily capture-and-move the
database into background tasks and other places that don't have a `cx`.

For tests that require database isolation, it is now possible to set
their own database in init. See
[`workspace::init_test`](https://github.com/zed-industries/zed/pull/51809/changes#diff-041673bbd1947a35d45945636c0055429dfc8b5985faf93f8a8a960c9ad31e28R13610),
for the flakiness fix.

Best part, this change should be entirely compiler driven, so the Zed
agent was able to make the app-wide refactor easily.

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

---------

Co-authored-by: Anthony Eid <hello@anthonyeid.me>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2026-03-18 12:05:57 -07:00
Jakub Konka
7ba5315329
collab_ui: Add call diagnostics (#51816)
Release Notes:

- Added call diagnostics when collaborating with other Zed users in
collab.

---------

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
Co-authored-by: Piotr Osiewicz <piotr@zed.dev>
Co-authored-by: Danilo Leal <danilo@zed.dev>
2026-03-18 16:25:06 +01:00
Danilo Leal
d04a60e452
sidebar: Add some more improvements (#51799)
Follow up to https://github.com/zed-industries/zed/pull/51763

Release Notes:

- N/A
2026-03-17 23:28:50 -03:00
Danilo Leal
9f3e3be65f
agent: Improve sidebar design and behavior (#51763)
- Selection/focus improvements (reduces flickers, move selection more
correctly throughout the list)
- Adds open folder button in the sidebar header
- Fixes sidebar header design, including the thread view one, too
- Fixes behavior of cmd-n when focused in the sidebar
- Changes the design for the "new thread" button in the sidebar and adds
a preview of the prompt on it
- Rename items in the "start thread in" dropdown

Release Notes:

- N/A

---------

Co-authored-by: cameron <cameron.studdstreet@gmail.com>
2026-03-17 20:44:20 -03:00
Max Brunsfeld
977cd6ac7e
Move sidebar back out of the panel (#51723)
Reverts https://github.com/zed-industries/zed/pull/51241

Release Notes:

- N/A
2026-03-17 03:48:20 +00:00
Danilo Leal
4e8937b62d
ui: Refactor the Button component icon methods (#51496)
Previously, if you wanted to have a button that contains icons on both
edges, you'd need to use a `ButtonLike` component, which takes any
children. Meanwhile, the `Button` would only take one icon, where you
could control its position through the `IconPosition` enum. This has
always felt unnecessarily limiting. So, this PR removes this limitation
by adding two new methods to the button: `start_icon` and `end_icon`.

In the meantime, I have also been bothered by the unnecessary
indirection in the `IconButton` due to the existence of the `ButtonIcon`
component. So I figured I could also completely eliminate that by adding
some of its methods directly to the `IconButton` and in the Button, just
using a regular `Icon` component.

---
## Before
```rust
Button::new("id", "Label")
    .icon(IconName::Plus)
    .icon_position(IconPosition::Start)
    .icon_size(IconSize::Small)
    .icon_color(Color::Muted)
```

## After
```rust
Button::new("id", "Label")
    .start_icon(Icon::new(IconName::Check))
    .end_icon(Icon::new(IconName::ChevronDown).size(IconSize::XSmall))
```

This should have no visual impact to the UI.

Release Notes:

- N/A
2026-03-13 14:13:12 -03:00
Marshall Bowers
becb24cd19
cloud_api_types: Add ZedBusiness variant to Plan (#51329)
This PR adds a `ZedBusiness` variant to the `Plan` enum.

Closes CLO-480.

Release Notes:

- N/A
2026-03-11 21:28:29 +00:00
Max Brunsfeld
b5666319b4
Move threads sidebar into agent panel (#51241)
* [x] Put back persistence of sidebar open state
* [x] when agent panel is docked right, put sidebar on the right side
* [x] remove stale entries from `SidebarsByWindow`

Release Notes:

- N/A

---------

Co-authored-by: Eric Holk <eric@zed.dev>
Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
Co-authored-by: Anthony Eid <hello@anthonyeid.me>
2026-03-10 23:45:55 -07:00
Danilo Leal
a26f0f8b60
sidebar: Adjust design for the "Open Project" button (#51145)
This PR makes the "Open Project" button in the sidebar also open the
"Recent Projects" popover, while also anchoring that popover to the the
button on the sidebar instead.

Release Notes:

- N/A
2026-03-09 22:01:40 -03:00