Show a disabled stage all button for no entries (#26436)

Closes #ISSUE

Release Notes:

- N/A
This commit is contained in:
Conrad Irwin 2025-03-10 22:25:33 -06:00 committed by GitHub
parent ff1d78df3b
commit 42c655751b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2451,7 +2451,7 @@ impl GitPanel {
let text;
let action;
let tooltip;
if self.total_staged_count() == self.entry_count {
if self.total_staged_count() == self.entry_count && self.entry_count > 0 {
text = "Unstage All";
action = git::UnstageAll.boxed_clone();
tooltip = "git reset";
@ -2492,6 +2492,7 @@ impl GitPanel {
action.as_ref(),
&self.focus_handle,
))
.disabled(self.entry_count == 0)
.on_click(move |_, _, cx| {
let action = action.boxed_clone();
cx.defer(move |cx| {