Previously, when clicking on the branch, the popover would obscure the
button you just clicked, which was awkward.
Release Notes:
- Improved the placement of the repo and branch picker popovers in the
git panel.
- Added a 'SelectRepo' action that opens the repository selector in a
modal.
Closes #ISSUE
Release Notes:
- Git action buttons are now synced between the project diff and git
panel
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Co-authored-by: Piotr Osiewicz <peterosiewicz@gmail.com>
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>
- [x] Fix `[un]stage` hunk operations cancelling pending ones
- [x] Add test
- [ ] bugs I stumbled upon (try to repro again before merging)
- [x] holding `git::StageAndNext` skips hunks randomly
- [x] Add test
- [x] restoring a file keeps it in the git panel
- [x] Double clicking on `toggle staged` fast makes Zed disagree with
`git` CLI
- [x] checkbox shows ✔️ (fully staged) after a single
stage
Release Notes:
- N/A
---------
Co-authored-by: Cole <cole@zed.dev>
Co-authored-by: Max <max@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 adds the ability for the editor to implement hard wrap (similar to
"textwidth" in vim).
If you are typing and your line extends beyond the limit, a newline is
inserted before the most recent space on the line. If you are otherwise
editing the line, pasting, etc. then you will need to manually rewrap.
Release Notes:
- git: Commit messages are now wrapped "as you type" to 72 characters.
This moves spawning of the git subprocess to the main thread. We're not
yet
sure why, but when we spawn a process using GCD's background queues,
sub-processes like git-credential-manager fail to open windows.
This seems to be fixable either by using the main thread, or by using a
standard background thread,
but for now we use the main thread.
Release Notes:
- Git: Fix git-credential-manager
---------
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
Closes #ISSUE
Release Notes:
- Fix Bug where unstage/stage all in project diff wouldn't work while
git panel was closed
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Closes #ISSUE
Release Notes:
- Git Beta: fixed an issue where pressing `up` or `down` in the git
panel's commit message editor would change the selected status entry
Known Issues:
- When items can horizontal scroll, the right selected border is hidden
TODO:
- [ ] Width calculation is off
- [ ] When scrollbars should autohide they don't until hovering the
panel
- [ ] When switching to and from scrollbar track being visible we are
missing a notify somewhere.
Release Notes:
- Git Panel: Added horizontal scrolling in the git panel
---------
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-authored-by: Cole Miller <m@cole-miller.net>
Co-authored-by: Cole Miller <cole@zed.dev>
The notifications from git output could take up variable amounts of
screen space, and they were quite obnoxious when a git command printed
lots of output, such as fetching many new branches or verbose push
hooks.
This change makes the push/pull/fetch buttons trigger a small
notification toast, based on the output of the command that was ran. For
errors or commands with more output the user may want to see, there's an
"Open Log" button which opens a new buffer with the output of that
command.
It also uses this behavior for long error notifications for other git
commands like `commit` and `checkout`. The output of those commands can
be quite long due to arbitrary githooks running.
Release Notes:
- N/A
---------
Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
Closes#26273
Release Notes:
- git: Fixes opening the branch selector in the commit modal with
cmd-option-b
- git: Truncates the branch selector in the commit modal
Final product:

Release Notes:
- Added more information about Git branches to the branch picker.
---------
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: Marshall Bowers <git@maxdeviant.com>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
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
Closes #ISSUE
Release Notes:
- Git Beta: Fixed a bug that caused the project diff not to update in
response to git-related events
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
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>
- Truncate branch names based on the width of the picker
- Use a footer for "Create branch" instead of a picker entry
Still to do:
- [x] Select the footer button when no matches and run the create logic
on `enter`
- [x] Make it possible to quickly select the footer button from the
keyboard when there are matches
Release Notes:
- Git Beta: Removed limitation that made it impossible to create a
branch from the branch picker when it too closely resembled an existing
branch name
Let's play around with it. This should not be added to tomorrow's
preview.
Release Notes:
- Git Beta: Added a panel header with an open diff and stage/unstage all
buttons.
Release Notes:
- Git Beta: added `git:Add` as an alias for the existing `git::Diff`
- Git Beta: Fixed a bug where the 'generate commit message' keybinding
wasn't working.
- Git Beta: Made the empty project diff state a little more helpful with
a button to push, and a button to close the item.
This gives us _very_ rudimentary support for `git switch` and `git
checkout` now, by making them aliases for our existing `git::branch`
call.
Release Notes:
- Git Beta: Added `git::Switch` and `git::CheckoutBranch` as aliases for
the existing `git::Branch`
205f9a9f03/crates/editor/src/element.rs (L1643)
Due to the snippet above, Zed is supposed to have `row` larger or equal
to `start_row` here:
205f9a9f03/crates/editor/src/element.rs (L1694)
yet the panic were reported when clicking in the project diff.
That project diff has a lot of highlighting happening already, so the PR
disables inline diagnostics within a git diff view.
Release Notes:
- N/A
Closes#26062
Removing the width here causes zed to use the default value (inside
default settings) after restart like other panels.
Release Notes:
- Fixed issue where git panel wasn't using default width after restart
Co-authored-by: Mikayla Maki <mikayla@zed.dev>