Commit graph

315 commits

Author SHA1 Message Date
Piotr Osiewicz
e4e758db3a
Rust 1.85 (#25272)
Closes #ISSUE

Release Notes:

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

---------

Co-authored-by: Anthony Eid <hello@anthonyeid.me>
2025-02-28 18:33:35 +01:00
Joseph T. Lyons
a5f96909cb
Update to suggest commit message based on file staging (#25790)
Currently, you only get a suggested commit message if you have a single
changed file in the repository. After the PR, the suggest happens per
single-staged file.

https://github.com/user-attachments/assets/4cc19fe6-099c-4690-967d-898b8ca7540b

Release Notes:

- N/A
2025-02-28 00:19:58 +00:00
Cole Miller
62fb555e18
Use "restore" more consistently in the git panel (#25780)
This PR replaces almost all uses of "discard" in the git panel UI with
"restore", since that's the verb we settled on for the project diff.

The only exception is in the confirmation prompt for restoring files,
where I've kept the "discard changes" language. I think consistency is
less important here and it's helpful to rephrase the action that's being
taken to emphasize that it's destructive.

Release Notes:

- N/A
2025-02-27 18:45:56 -05:00
Cole Miller
482a45feac
Fix broken merge (#25776)
Closes #ISSUE

Release Notes:

- N/A *or* Added/Fixed/Improved ...
2025-02-27 20:48:14 +00:00
Cole Miller
7ec3702b47
Fix cursor position when navigating to a multibuffer's first excerpt (#25723)
This PR fixes an unexpected cursor position when jumping to the
beginning of the project diff editor's first excerpt if that excerpt
starts with a deleted region. Previously, the cursor would end up in the
*following* region in this situation; now it ends up at the start of the
deleted region, as happens already for excerpts that are not the first.

Release Notes:

- N/A

---------

Co-authored-by: Max <max@zed.dev>
2025-02-27 14:53:34 -05:00
Cole Miller
eb4fad52df
Fix panic when scrolling in project diff (#25771)
It may happen that the column for the scroll anchor is nonzero, and the
adjustment we're doing here could result in an invalid point in that
case.

Release Notes:

- N/A

Co-authored-by: Max <max@zed.dev>
2025-02-27 19:35:03 +00:00
Cole Miller
6856e869fc
Fix git panel's suggested commit message not updating (#25708)
Closes #ISSUE

Release Notes:

- N/A
2025-02-27 12:27:09 -05:00
João Marcos
cc3b5c729e
Keep cursor at top when diff view is first opened (#25682)
Previously, we had the cursor at the bottom while the scroll stayed at
the top.

Now, if you run `git: diff`, the cursor will also be at the top.

The cursor moving to the end was possibly a side-effect of using
`Bias::Right` for selections.

---

Release Notes:

- N/A

Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2025-02-27 17:19:44 +00:00
Anthony Eid
878b50c991
Update git panel entry checked box tooltip to say Stage/Unstage (#25678)
Before it would always say staged when a user hovered over the check
box. Now it will show the correct hover message depending on the state
of the entry

Release Notes:

- N/A
2025-02-27 00:29:26 -05:00
Marshall Bowers
da22f21dec
Move PopoverButton into ui (#25724)
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
2025-02-27 02:51:19 +00:00
Marshall Bowers
3505a17452
git_ui: Combine disjoint conditions into one (#25722)
This PR combines two disjoint conditions for the same value into one.

This makes it so the type checker can accurately reason about the
branches.

Release Notes:

- N/A
2025-02-27 02:33:25 +00:00
Marshall Bowers
81badd1fe6
Sort Cargo.tomls (#25721)
This PR sorts some `Cargo.toml`s that had become unsorted.

Release Notes:

- N/A
2025-02-27 02:28:59 +00:00
Mikayla Maki
8ba7b349a5
Make the branch picker in the commit modal a popover (#25697)
Release Notes:

- N/A

---------

Co-authored-by: Nate Butler <iamnbutler@gmail.com>
2025-02-27 01:56:07 +00:00
Cole Miller
7a34dd9888
Save buffers after restoring hunks in the project diff (#25620)
This PR fixes a bug where using the project diff editor to restore hunks
from a file that's not open in its own buffer would cause those reverts
to be lost once the project diff drops its excerpts for that file.

The fix is to save the buffers after restoring them but before the
excerpts are (potentially) dropped. This is done for the project diff
editor only. If we fail to save the affected files, we add their buffers
to the active workspace, so that the reverted contents are preserved and
the user can try again to save them.

- [x] Get it working
- [x] Test
- [ ] ~~Clean up boolean soup~~

Co-authored-by: Max <max@zed.dev>

Release Notes:

- N/A
2025-02-26 15:16:17 -05:00
Mikayla Maki
5edded5c02
Simplify project git code (#25662)
This was originally a part of another PR, but I wanted to get the
refactoring in and shift focus to working on bugs.

This causes all git commands via the `Repository` entity to be
serialized, and allows us to return values other than `Result<()>`

Release Notes:

- N/A
2025-02-26 18:16:10 +00:00
Nate Butler
1f80f58104
git_ui: Commit modal editor cleanup (#25645)
- Fixes cursor style in the commit modal
- Use commit button instead of kb hint
- Update layout to scale better for large commit messages

No message:

![CleanShot 2025-02-26 at 10 33
22@2x](https://github.com/user-attachments/assets/fb6fc4ff-1e1d-46ae-aee0-7e21d73aaf70)

Long Message:
![CleanShot 2025-02-26 at 10 33
55@2x](https://github.com/user-attachments/assets/71a7773c-386b-47d5-abed-9a301360c35b)

![CleanShot 2025-02-26 at 10 34
06@2x](https://github.com/user-attachments/assets/dc41f0b9-2277-4034-9af2-d77fec0488d8)

Release Notes:

- N/A
2025-02-26 15:55:38 +00:00
Conrad Irwin
dd1ff9b998
Git: Fix prompts with a very large number of filenames (#25629)
Closes #ISSUE

Release Notes:

- N/A
2025-02-25 23:29:17 -07:00
Conrad Irwin
7f214ed25a
git: Fix cmd-enter (#25628)
Closes #ISSUE

Release Notes:

- N/A
2025-02-25 23:07:55 -07:00
Conrad Irwin
08539b32d0
Fix some syncing issues with git statuses (#25535)
Like the real app, this one infinite loops if you have a diff in an
UnsharedFile.

Release Notes:

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

---------

Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2025-02-25 22:09:02 -07:00
Cole Miller
2978be95d7
Don't deploy git panel when opening the diff view (#25611)
Release Notes:

- N/A
2025-02-25 21:29:08 -05:00
Nate Butler
30568e6dd1
Add overflow menu to the git panel (#25618)
Before: 

![CleanShot 2025-02-25 at 20 11
48@2x](https://github.com/user-attachments/assets/2400270e-64fe-4711-a2aa-31588e73367a)

After:

![CleanShot 2025-02-25 at 20 13
18@2x](https://github.com/user-attachments/assets/70c88d2f-5e16-4f2d-9cc5-666b2f9b8de0)

Release Notes:

- N/A
2025-02-25 21:07:10 -05:00
5brian
cea06bc0ce
git_panel: Apply tooltip to checkbox instead of container (#25533)
Closes #ISSUE

Small tweak: The tooltip was activating on the icon

|Before|After|
|---|---|

|![image](https://github.com/user-attachments/assets/a1a5b4a7-f949-402e-a038-5f1b4445f068)|![image](https://github.com/user-attachments/assets/cb55f193-e665-4e88-b8d8-a437a7200eea)|

Release Notes:

- N/A
2025-02-25 00:28:35 -05:00
Anthony Eid
10fef92eea
Dismiss git commit modal when it's out of focus (#25518)
Release Notes:

- Fix git commit modal not being dismissed when pressing esc key or
clicking outside the modal
2025-02-25 00:09:46 +00:00
Conrad Irwin
53a5145dc8
Fix performance of GitPanel::update_visible_entries (#25504)
Co-authored-by: Anthony Eid <hello@anthonyeid.me>

Closes #19022

Release Notes:

- Fixes pessimal performance with the new git panel when a very large
number of files are untracked

Co-authored-by: Anthony Eid <hello@anthonyeid.me>
2025-02-24 15:55:44 -07:00
Nate Butler
30af8d0a81
git_ui: Commit modal refinement (#25484)
Closes #ISSUE

Release Notes:

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

---------

Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
2025-02-24 19:19:06 +00:00
João Marcos
ec7ce41324
Git: Fix Linux bindings (#25486)
- Tooltip with binding wasn't showing up
- Missing Linux bindings
- Commit modal wasn't opening when binding was pressed

Release Notes:

- N/A

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2025-02-24 18:49:17 +00:00
Mikayla Maki
ff6844300e
Git push/pull/fetch (#25445)
Release Notes:

- N/A

---------

Co-authored-by: Michael Sloan <mgsloan@gmail.com>
2025-02-24 18:29:52 +00:00
João Marcos
dd0de3cfa9
Git panel: Fix commit binding tooltip not showing up (#25472)
Co-authored by: Conrad <conrad@zed.dev>

Release Notes:

- N/A
2025-02-24 16:41:37 +00:00
João Marcos
d1302a7a08
Diff view: Fold excerpts of deleted files by default (#25436)
Release Notes:

- N/A
2025-02-24 12:52:13 -03:00
João Marcos
2b28b5969f
Remove unused variable distinguish_unstaged_diff_hunks (#25462)
Release Notes:

- N/A
2025-02-24 15:25:13 +00:00
Angelk90
17323ed7b2
Show git items in the panel only when in a git repository (#24865)
| Before | After | After2 |
| - | - | - |
| <img width="368" alt="Screenshot 2025-02-14 alle 13 45 41"
src="https://github.com/user-attachments/assets/9ed6f233-c7e3-45b4-b2cd-605b6f785cbe"
/> | <img width="367" alt="Screenshot 2025-02-14 alle 14 25 24"
src="https://github.com/user-attachments/assets/808da265-dd1d-4679-9b62-a4def459fc8f"
/> | <img width="371" alt="Screenshot 2025-02-14 alle 14 25 38"
src="https://github.com/user-attachments/assets/09d0e27e-1e58-43b4-9a35-eb14c0d14961"
/> |

Release Notes:

- If it is not a git repository it shows nothing.
- Fix stage and unstage title in context_menu
2025-02-21 12:11:17 -07:00
João Marcos
5e1dd91ee5
Fix UI font size changes not applying (#25307)
Related to #24857.

Release Notes:

- N/A
2025-02-21 06:24:02 -03:00
Conrad Irwin
4871d3c9e7
New commit review flow in project diff view (#25229)
Closes #ISSUE

Release Notes:

- N/A

---------

Co-authored-by: Nate Butler <iamnbutler@gmail.com>
2025-02-21 06:52:34 +00:00
Conrad Irwin
d0f7dede79
Git actions v2 (#25197)
Closes #ISSUE

Release Notes:

- Rename `editor::RevertSelectedHunks` and `editor::RevertFile` to
`git::Restore` and `git::RestoreFile` for consistency with git
2025-02-19 21:22:31 -07:00
Conrad Irwin
836661503f
Make ProjectDiff serializable (#25182)
Release Notes:

- N/A
2025-02-19 12:05:25 -07:00
Conrad Irwin
119bd896b0
Remove language::markdown (#25136)
The language::markdown crate had been superceded by markdown::Mardown.

After #25117, the only two remaining use-cases were rendering git commit
messages (which are arguably not really markdown) and the signature help
(which is definitely not markdown).

Updated the former to use the new markdown component, and the latter to
do syntax highlighting manually.

Release Notes:

- Allow selecting the commit message in git commits
2025-02-19 08:55:36 -07:00
Nate Butler
086f002f44
git_ui: Git panel polish (#25164)
- Hides header when no active repo/no repo
- Entire commit editor now has i-beam cursor on hover
- Adds an icon to the project diff tab

Release Notes:

- N/A
2025-02-19 15:33:41 +00:00
Michael Sloan
b1872e3afd
cx.background_executor().spawn(...) -> cx.background_spawn(...) (#25103)
Done automatically with

> ast-grep -p '$A.background_executor().spawn($B)' -r
'$A.background_spawn($B)' --update-all --globs "\!crates/gpui"

Followed by:

* `cargo fmt`
* Unexpected need to remove some trailing whitespace.
* Manually adding imports of `gpui::{AppContext as _}` which provides
`background_spawn`
* Added `AppContext as _` to existing use of `AppContext`

Release Notes:

- N/A
2025-02-18 20:30:33 +00:00
Conrad Irwin
be83074243
Git context menu (#24844)
Adds the non-entry specific right click menu to the panel, and the
features contained therin:

* Stage all
* Discard Tracked Changes
* Trash Untracked Files

Also changes the naming from "Changes"/"New" to better match Git's
terminology (though not convinced on this, it was awkward to describe
"Discard Changes" without a way to distinguish between the changes and
the files containing them).

Release Notes:

- N/A
2025-02-14 14:04:32 -07:00
Conrad Irwin
20460239a0
Fix scroll to top on multibuffer save (#24885)
Co-Authored-By: Cole <cole@zed.dev>

Closes #ISSUE

Release Notes:

- N/A

---------

Co-authored-by: Cole <cole@zed.dev>
2025-02-14 13:18:07 -05:00
Cole Miller
de0d9d678e
Save open buffers before staging or unstaging their backing files (#24767)
Release Notes:

- N/A
2025-02-13 15:07:28 +00:00
Conrad Irwin
d57f5937d4
Git panel: Right click menu (#24787)
Release Notes:

- N/A
2025-02-12 22:26:34 -07:00
Conrad Irwin
21a1541a70
Branch/co-authors in commit (#24768)
- **branch selector in commit box**
- **TEMP**
- **Add co-authors toggle button**

Closes #ISSUE

Release Notes:

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

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
2025-02-12 20:53:52 -07:00
Mikayla Maki
b014afa938
Add an undo button to the git panel (#24593)
Also prep infrastructure for pushing a commit

Release Notes:

- N/A

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Co-authored-by: Conrad <conrad@zed.dev>
Co-authored-by: Nate Butler <iamnbutler@gmail.com>
2025-02-12 15:57:08 -07:00
Cole Miller
ab4a6f1c79
Open git panel when deploying project diff via action (#24751)
Release Notes:

- N/A
2025-02-12 15:37:17 -05:00
Conrad Irwin
f5fd3d98ad
Fix project diff focus (#24691)
Release Notes:

- N/A
2025-02-11 16:40:40 -08:00
Kirill Bulatov
636253d2dc
Prefer names over github logins when filling co-authors (#24693)
Follow-up of https://github.com/zed-industries/zed/pull/24575

Release Notes:

- N/A
2025-02-11 21:32:03 +00:00
Joseph T. Lyons
b3814ce4e3
Fix "Project Diff Opened" event name (#24686)
Release Notes:

- N/A
2025-02-11 20:43:58 +00:00
Nate Butler
2d71733490
ui: Update Label component (#24653)
- Standardize style methods
- Convert label story to a component preview
- update component preview styles  

Release Notes:

- N/A
2025-02-11 20:16:59 +00:00
Cole Miller
8f75fe25e5
Add staged status information to diff hunks (#24475)
Release Notes:

- Render unstaged hunks in the project diff editor with a slashed
background

---------

Co-authored-by: maxbrunsfeld <max@zed.dev>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2025-02-10 21:43:25 -05:00