Skip to content

git_ui: Add stash toggle to git graph#60756

Draft
TunaDev0 wants to merge 1 commit into
zed-industries:mainfrom
TunaDev0:feat/git-graph-show-stashes
Draft

git_ui: Add stash toggle to git graph#60756
TunaDev0 wants to merge 1 commit into
zed-industries:mainfrom
TunaDev0:feat/git-graph-show-stashes

Conversation

@TunaDev0

Copy link
Copy Markdown

Objective

  • Make stash entries in the Git Graph configurable instead of always showing them.
  • This PR does not fix a tracked issue.

Solution

  • Add a new persistent setting: git_panel.show_stashes_in_graph.
  • Add a Settings UI entry so the behavior can be configured from the Git Panel settings.
  • Add a Show stashes toggle directly in the Git Graph UI and in the graph header menu for quicker access.
  • Filter refs/stash entries out of the Git Graph when the setting is disabled.
  • Refresh the graph when the setting changes, and only react to stash-change graph invalidation when stash entries are currently visible.

Testing

  • Tested with:
    • cargo check -p git_ui -p settings_ui -p settings_content
    • cargo test -p git_ui test_git_graph_hides_stashes_when_setting_disabled -- --nocapture
    • cargo test -p git_ui test_graph_data_reloaded_after_stash_change -- --nocapture
  • Added automated coverage for:
    • hiding stash commits when the setting is disabled
    • reloading graph data after stash changes
  • Reviewers can test by:
    • opening the Git Graph for a repository with stashes
    • toggling Show stashes from the graph UI
    • confirming stash entries appear/disappear immediately
    • changing the same option in Settings and confirming the graph updates
  • Tested on:
    • macOS
  • Not tested on:
    • Linux
    • Windows

Self-Review Checklist:

  • I've reviewed my own diff for quality, security, and reliability
  • Unsafe blocks (if any) have justifying comments
  • The content adheres to Zed's UI standards (UX/UI and icon guidelines)
  • Tests cover the new/changed behavior
  • Performance impact has been considered and is acceptable

Showcase

  • Adds a Show stashes toggle to the Git Graph so stash commits can be shown or hidden without leaving the view.

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Jul 10, 2026
@zed-community-bot zed-community-bot Bot added the first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions label Jul 10, 2026
@TunaDev0 TunaDev0 marked this pull request as draft July 10, 2026 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant