Closes#26847
Release Notes:
- Updated Git panel background to use panel_background instead of
ElevationIndex::Surface.bg(cx) for consistency with other panels.
- Removed redundant GitStatusColors struct from status.rs and refactored
to use existing theme colors.
- Adjusted Color enum mappings in color.rs to reference
version_control_* colors instead of status() for better alignment with
the theme system.
- Cleaned up unused or redundant code.
This is the core change:
https://github.com/zed-industries/zed/pull/26758/files#diff-044302c0d57147af17e68a0009fee3e8dcdfb4f32c27a915e70cfa80e987f765R1052
TODO:
- [x] Use AsyncFn instead of Fn() -> Future in GPUI spawn methods
- [x] Implement it in the whole app
- [x] Implement it in the debugger
- [x] Glance at the RPC crate, and see if those box future methods can
be switched over. Answer: It can't directly, as you can't make an
AsyncFn* into a trait object. There's ways around that, but they're all
more complex than just keeping the code as is.
- [ ] Fix platform specific code
Release Notes:
- N/A
Release Notes:
- Improved performance when using the scroll wheel and some other mouse
interactions.
Based on some cache details about GPUI `AnyView::cached` that I found in
the discussion of
https://github.com/zed-industries/zed/discussions/24260#discussioncomment-12135749,
and combined with the optimization points found in actual applications.
This change may have some scenarios that I have not considered, so I
just make a draft to put forward my ideas first for discussion.
From my analysis, `AnyView::cached` will always invalid by Div's mouse
events, because of it called `window.refresh`. I understand that (mouse
move event) this is because the interface changes related to hover and
mouse_move will be affected style, so `window.refresh` is required.
Since Div does not have the `entity_id` of View, it is impossible to
know which View should be refreshed, so the entire window can only be
refreshed.
With this change, we can reduce a lot of `render` method calls on
ScrollWheel or Mouse Event.
### DISCLAIMER
> As of 6th March 2025, debugger is still in development. We plan to
merge it behind a staff-only feature flag for staff use only, followed
by non-public release and then finally a public one (akin to how Git
panel release was handled). This is done to ensure the best experience
when it gets released.
### END OF DISCLAIMER
**The current state of the debugger implementation:**
https://github.com/user-attachments/assets/c4deff07-80dd-4dc6-ad2e-0c252a478fe9https://github.com/user-attachments/assets/e1ed2345-b750-4bb6-9c97-50961b76904f
----
All the todo's are in the following channel, so it's easier to work on
this together:
https://zed.dev/channel/zed-debugger-11370
If you are on Linux, you can use the following command to join the
channel:
```cli
zed https://zed.dev/channel/zed-debugger-11370
```
## Current Features
- Collab
- Breakpoints
- Sync when you (re)join a project
- Sync when you add/remove a breakpoint
- Sync active debug line
- Stack frames
- Click on stack frame
- View variables that belong to the stack frame
- Visit the source file
- Restart stack frame (if adapter supports this)
- Variables
- Loaded sources
- Modules
- Controls
- Continue
- Step back
- Stepping granularity (configurable)
- Step into
- Stepping granularity (configurable)
- Step over
- Stepping granularity (configurable)
- Step out
- Stepping granularity (configurable)
- Debug console
- Breakpoints
- Log breakpoints
- line breakpoints
- Persistent between zed sessions (configurable)
- Multi buffer support
- Toggle disable/enable all breakpoints
- Stack frames
- Click on stack frame
- View variables that belong to the stack frame
- Visit the source file
- Show collapsed stack frames
- Restart stack frame (if adapter supports this)
- Loaded sources
- View all used loaded sources if supported by adapter.
- Modules
- View all used modules (if adapter supports this)
- Variables
- Copy value
- Copy name
- Copy memory reference
- Set value (if adapter supports this)
- keyboard navigation
- Debug Console
- See logs
- View output that was sent from debug adapter
- Output grouping
- Evaluate code
- Updates the variable list
- Auto completion
- If not supported by adapter, we will show auto-completion for existing
variables
- Debug Terminal
- Run custom commands and change env values right inside your Zed
terminal
- Attach to process (if adapter supports this)
- Process picker
- Controls
- Continue
- Step back
- Stepping granularity (configurable)
- Step into
- Stepping granularity (configurable)
- Step over
- Stepping granularity (configurable)
- Step out
- Stepping granularity (configurable)
- Disconnect
- Restart
- Stop
- Warning when a debug session exited without hitting any breakpoint
- Debug view to see Adapter/RPC log messages
- Testing
- Fake debug adapter
- Fake requests & events
---
Release Notes:
- N/A
---------
Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
Co-authored-by: Anthony Eid <hello@anthonyeid.me>
Co-authored-by: Anthony <anthony@zed.dev>
Co-authored-by: Piotr Osiewicz <peterosiewicz@gmail.com>
Co-authored-by: Piotr <piotr@zed.dev>
This PR makes it so the tool selector will stay open when toggling tools
instead of closing after each selection:
https://github.com/user-attachments/assets/eb987785-cfb5-4b07-8d63-510fbd9d9bf1
This involved making a change to `ContextMenu` to allow it to rebuild
its menu items after each confirmation in order for them to reflect
their selected/unselected status. I intend to clean up the `ContextMenu`
API a bit at a later point, but that is out of scope for this PR.
Release Notes:
- N/A
Release Notes:
- Multibuffers now use less vertical space for excerpt boundaries.
Additionally the expand up/down arrows are hidden at the start and end
of the buffers
---------
Co-authored-by: Nate Butler <iamnbutler@gmail.com>
Co-authored-by: Zed AI <claude-3.5-sonnet@zed.dev>
This PR cleans up some color & elevation misc.
### Don't allow deriving Color from Hsla
The point of the [ui::Color] enum is to encourage consistent color
usage, and the the Color::Custom case is really only meant for cases
where we have no other choice.
`impl From<Hsla> for Color` encourages blindly passing colors into
`Color::Custom` – with this in place we might as well remove the entire
`Color` enum.
The usages that were updated due to this removal were for colors that
already exist in the Color enum, making it even more clear that it
didn't make sense to have this.
### `ElevationIndex` -> `Elevation`
This name would make more sense if we had an `Elevation` in the first
place. The new name is more clear.
#### `Button::elevation`
As part of this change I also updated button's `layer` method to
`elevation`, since it takes an elevation. This method still has the
following issue:
You want to use `Button::elevation` when it's default colors are
invisible on the layer you are rendering the button on. However, current
this method uses the elevation's `bg` color, rather than it's
`on_elevation_bg`.
Ideally when you use `Button::elevation` you want to pass the elevation
you are _on_, not choosing one that will show up the elevation you are
on.
This change will be in a separate PR, as it likely will have widespread
visual impact across the app.
Release Notes:
- N/A
This PR refactors the `ContextMenu::render` method to extract a couple
smaller methods from it.
The existing `render` method was suffering from its size, with some of
the `match` arms not being able to be formatted with `rustfmt`.
Release Notes:
- N/A
Fix KeyBinding::for_action() to use the active focus handle instead of
what was
rendered last.
This makes the UI consistently chose the cmd-escape binding for close
(because escape in the editor is editor::Cancel?),
so force it to be "escape"
Release Notes:
- git: Fixed escape tooltip in commit modal
Polish PR
- [ ] Horizontal scrollbar for git panel
- [ ] Allow shift clicking a checkbox in any section to stage the whole
section
- [ ] Clean up design of no changes/pending push state in panel
- [x] Ensure checkbox placeholder dot is centered in the checkbox
- [x] Improve spacing between elements in git panel entries
- [x] Update git branch icon to match branch selector text when disabled
- [x] Truncate last commit message less aggressively in panel
- [x] Clean up new panel header design
- [x] Remove `_background` version control keys (backgrounds are derived
from the foreground colors)
### Previous message truncation:
Before:

After:

### Make branch icon match when menu is disabled
Before:

After:

Release Notes:
- N/A *or* Added/Fixed/Improved ...
---------
Co-authored-by: Cole Miller <cole@zed.dev>
Co-authored-by: Cole Miller <m@cole-miller.net>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
https://github.com/user-attachments/assets/b16e32e6-46c6-41dc-ab68-1824d288c8c2
This PR adds the first part of our planned extended notification system:
StatusToasts.
It also makes various updates to ComponentPreview and adds a `Styled`
extension in `ui::style::animation` to make it easier to animate styled
elements.
_**Note**: We will be very, very selective with what elements are
allowed to be animated in Zed. Assume PRs adding animation to elements
will all need to be manually signed off on by a designer._
## Status Toast

These are designed to be used for notifying about things that don't
require an action to be taken or don't need to be triaged. They are
designed to be ignorable, and dismiss themselves automatically after a
set time.
They can optionally include a single action.
Example: When the user enables Vim Mode, that action might let them undo
enabling it.

Status Toasts should _not_ be used when an action is required, or for
any binary choice.
If the user must provide some input, this isn't the right component!
### Out of scope
- Toasts should fade over a short time (like AnimationDuration::Fast or
Instant) when dismissed
- We should visually show when the toast will dismiss. We'll need to
pipe the `duration_remaining` from the toast layer -> ActiveToast to do
this.
- Dismiss any active toast if another notification kind is created, like
a Notification or Alert.
Release Notes:
- N/A
---------
Co-authored-by: Cole Miller <m@cole-miller.net>
This fixes a major performance issue in the current git beta.
This PR also removes the PopoverButton component, which was easy to
misuse.
Release Notes:
- Git Beta: Fix frame drops caused by opening the git panel
---------
Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
If the user already binds `tab`/`alt-tab`/`alt-l` to a different action
in a conflicting context and hasn't assigned a different keybinding for
`editor::AcceptEditPrediction`, we would show broken popovers with no
bindings:

Instead, they will now see an error-variant of every popover which
includes a tooltip with a short description and buttons to open the
keymap, and open a new docs section explaining the issue in detail and
how to fix it.

Note: I included the docs change in this PR because it's ok to deploy
before the release, as it also applies to existing versions.
Release Notes:
- edit predictions: Improve UX when there's no keybinding for accepting
predictions
---------
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: Danilo <danilo@zed.dev>
Closes#10167
This is take 2 on https://github.com/zed-industries/zed/pull/2341 which
was closed due to lack of migrator.
This PR contains rename of following keymap actions:
```sh
1. ["editor::GoToPrevHunk", { "center_cursor": true }] -> ["editor::GoToPreviousHunk", { "center_cursor": true }]
2. "editor::GoToPrevDiagnostic" -> "editor::GoToPreviousDiagnostic"
3. "editor::ContextMenuPrev" -> "editor::ContextMenuPrevious"
4. "search::SelectPrevMatch" -> "search::SelectPreviousMatch"
5. "file_finder::SelectPrev" -> "file_finder::SelectPrevious"
6. "menu::SelectPrev" -> "menu::SelectPrevious"
7. "editor::TabPrev" -> "editor::Backtab"
```
Release Notes:
- Renamed several keymap actions for consistency (e.g., `GoToPrevHunk` →
`GoToPreviousHunk`, `TabPrev` → `Backtab`). Your existing configured
keybindings will still work. You can click **"Backup and Update"** at
the top of your keymap file to easily update to the new actions.
Co-authored-by: Joseph T. Lyons <JosephTLyons@gmail.com>
When a context menu item has a documentation aside element attached to
it, we're now hiding the keybinding (which wouldn't trigger anything
anyway) to make room for displaying an info icon, with the purpose of
indicating the existence of the docs aside, which will typically explain
the reason why the item’s disabled in the first place.
Also, changed the label color to use the `Disabled` token; more
appropriate for this, and just slightly darker, which is great!
<img
src="https://github.com/user-attachments/assets/a7f9f022-16d1-41d5-b1b5-3cbcc9630cc8"
width="500px"/>
Release Notes:
- N/A
This PR adds toasts for reporting success and errors from remote git
operations. This PR also adds a focus handle to notifications, in
anticipation of making them keyboard accessible.
Release Notes:
- N/A
---------
Co-authored-by: julia <julia@zed.dev>
This PR updates the ui of the git panel. It removes the header from the
panel and unifies the repository, branch and commit controls in the
bottom section.
It also adds a secondary menu to the primary button giving access to a
variety of actions for managing local and remote changes:

Known issues (will be fixed in a later pr)
- Spinner showing git operation progress was removed, will be re-added
- Clicking expand with the panel editor focused will commit (due to
shared action name. Already tracked)
Before | After

(Also adds `component`, `linkme` to cargo-machete ignore as they are
used in the `IntoComponent` proc-macro and will always be incorrectly
flagged as unused)
Release Notes:
- N/A
---------
Co-authored-by: Cole Miller <m@cole-miller.net>
Co-authored-by: Cole Miller <53574922+cole-miller@users.noreply.github.com>
Co-authored-by: Cole Miller <cole@zed.dev>
Going for a different, arguably simpler design for the Assistant 2 empty
state here. Also took the opportunity to adjust other elements like the
toolbar, message editor, and some items in the configuration page.
<img
src="https://github.com/user-attachments/assets/03fd1d48-a675-4eac-b694-bbe4eeaf06e9"
width="700px"/>
Release Notes:
- N/A
This PR moves the `PopoverButton` component into the `ui` crate.
The `popover_button` crate only depended on `ui`, so there doesn't seem
to be a need for it to live in its own crate and add another step in the
crate graph.
Release Notes:
- N/A
Closes#16544
Release Notes:
- Added support for AWS Bedrock to the Assistant.
---------
Co-authored-by: Marshall Bowers <git@maxdeviant.com>
Co-authored-by: Anthony <anthony@zed.dev>
Co-authored-by: Anthony Eid <hello@anthonyeid.me>
Closes https://github.com/zed-industries/zed/issues/24883
While this PR closes the issue above, it still doesn't implement a
bullet-proof solution for the context menu docs aside, meaning, it might
not work the best way if there are other places using it (like the
Editor Controls menu). For that, I think we'll want a more robust
collision-aware solution, possibly similar to the LSP completion menu.
Release Notes:
- N/A
---------
Co-authored-by: Agus Zubiaga <hi@aguz.me>
Co-authored-by: Nate Butler <1714999+iamnbutler@users.noreply.github.com>
This PR addresses 3 issues with the common scrollbar component used in
the Terminal, Outline Panel, etc.
1. Extremely small or invisible scrollbar for long content.
2. Flickering issue when the thumb is already at the bottom-most
position, and the user tries to overscroll.
3. Scrollbar appearing even when there is no excessive content to
scroll.
Before:
<img width="300" alt="image"
src="https://github.com/user-attachments/assets/8a124a72-3b56-4bef-858a-a4942c871829"
/>
After:
<img width="300" alt="Screenshot 2025-02-21 at 3 26 32 AM"
src="https://github.com/user-attachments/assets/2a8a5796-b332-4c06-84b2-226d2de6e300"
/>
Release Notes:
- Fixed extremely small scrollbar thumb for long content in Terminal,
Outline Panel, and more.
---------
Co-authored-by: Danilo <danilo@zed.dev>
Co-authored-by: Richard Feldman <oss@rtfeldman.com>
Closes#24931
We've flipped back and forth at least once on whether the last or first
added keybinding should be shown in different contexts (See
[this](https://github.com/zed-industries/zed/issues/23621#issuecomment-2614061385)
as well as #23621 and the subsequent #23660)
This PR attempts to pick a side to stick with so that we are at least
consistent until #23660 is resolved and we have a way to determine which
keybinds to display in a manner that is both consistent and not
confusing
Release Notes:
- N/A
Felt like this was relevant particularly as we're living with both
`trigger` and `trigger_with_tooltip`. At some point, I believe there
should be only one (`trigger_with_tooltip`) and that should be then
renamed to just `trigger` back again! We're supporting both for now just
for ease of migration/avoiding big changes.
Release Notes:
- N/A
Vim itself shows keybindings cased according to the character, and so
it's confusing for people coming from vim that we show all key-bindings
uppercase with an icon denoting shift (c.f. #14287).
So, in #24322 we changed Zed to use lowercase for bindings in vim mode.
Unfortunately this (in practice) looks awful because our key icons are
designed to be paired with uppercase letters.
Instead, we now (for vim mode) show the same syntax as would be used in
the keymap file for Zed. This is different from vim (i.e. we show
shift-z instead of Z, and cmd-d instead of <D-z>) but hopefully avoids
the original confusion, and as a bonus makes it easy to figure out the
syntax you need for a workspace::SendKeystrokes.
Closes #ISSUE
Release Notes:
- N/A *or* Added/Fixed/Improved ...
This Pull Request tackles the issue outline in #14287 by changing the
way `KeyBinding`s for vim mode are displayed in the command palette.
It's worth pointing out that this whole thing was pretty much
implemented by Conrad Irwin during a pairing session, I just tried to
clean up some other changes introduced for a different issue, while
improving some comments.
Here's a quick list of the changes introduced:
- Update `KeyBinding` with a new `vim_mode` field to determine whether
the keybinding should be displayed in vim mode.
- Update the way `KeyBinding` is rendered, so as to detect if the
keybinding is for vim mode, if it is, only display keys in uppercase if
they require the shift key.
- Introduce a new global state – `VimStyle(bool)` - use to determine
whether `vim_mode` should be enabled or disabled when creating a new
`KeyBinding` struct. This global state is automatically set by the `vim`
crate whenever vim mode is enabled or disabled.
- Since the app's context is now required when building a `KeyBinding` ,
update a lot of callers to correctly pass this context.
And before and after screenshots, for comparison:
| before | after |
|--------|-------|
| <img width="1050" alt="SCR-20250205-tyeq"
src="https://github.com/user-attachments/assets/e577206d-2a3d-4e06-a96f-a98899cc15c0"
/> | <img width="1050" alt="SCR-20250205-tylh"
src="https://github.com/user-attachments/assets/ebbf70a9-e838-4d32-aee5-0ffde94d65fb"
/> |
Closes#14287
Release Notes:
- Fix rendering of vim commands to preserve case sensitivity
---------
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Closes https://github.com/zed-industries/zed/issues/23505
Now `zed::IncreaseBufferFontSize` (and all the same UI- and
Buffer-related settings) action is parameterized with `{ "persist": true
}` (default).
Using `"persist": false` brings back resizing behavior prior to
https://github.com/zed-industries/zed/pull/23265
Release Notes:
- Added a way to toggle font size without settings adjustments