Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions crates/flint_actions/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,10 @@ pub mod git {
Branch,
/// Opens the git stash selector.
ViewStash,
/// Shows unstaged changes across the project.
ViewUnstagedChanges,
/// Shows staged changes across the project.
ViewStagedChanges,
/// Opens the git worktree selector.
Worktree,
/// Creates a pull request for the current branch.
Expand Down
20 changes: 20 additions & 0 deletions crates/git_ui/src/git_panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,16 @@ fn git_panel_context_menu(
.action("View Stash", flint_actions::git::ViewStash.boxed_clone())
.separator()
.action("Open Diff", project_diff::Diff.boxed_clone())
.action_disabled_when(
!state.has_unstaged_changes,
"View Unstaged Changes",
flint_actions::git::ViewUnstagedChanges.boxed_clone(),
)
.action_disabled_when(
!state.has_staged_changes,
"View Staged Changes",
flint_actions::git::ViewStagedChanges.boxed_clone(),
)
.separator()
.action_disabled_when(
!state.has_tracked_changes,
Expand Down Expand Up @@ -6388,6 +6398,16 @@ impl GitPanel {
.separator()
.action("Open Diff", menu::Confirm.boxed_clone())
.action("Open Diff (File)", menu::SecondaryConfirm.boxed_clone())
.action_disabled_when(
!entry.status.staging().has_unstaged(),
"View Unstaged Changes",
flint_actions::git::ViewUnstagedChanges.boxed_clone(),
)
.action_disabled_when(
!entry.status.staging().has_staged(),
"View Staged Changes",
flint_actions::git::ViewStagedChanges.boxed_clone(),
)
.when(!is_created, |context_menu| {
context_menu
.separator()
Expand Down
Loading
Loading