Skip to content

git_ui: Hide staged section when no files are staged - #62397

Closed
hexadecimal233 wants to merge 1 commit into
zed-industries:mainfrom
hexadecimal233:git/hide-empty-staged
Closed

git_ui: Hide staged section when no files are staged#62397
hexadecimal233 wants to merge 1 commit into
zed-industries:mainfrom
hexadecimal233:git/hide-empty-staged

Conversation

@hexadecimal233

Copy link
Copy Markdown

Objective

Introduced in #60976, there is now a placeholder showing all the time in the Git Panel when there is no staged files, so the "Stage all" button is placed below the Staged section.

When Staging all files, the OG cursor position often hovers on 2nd/3rd item which might lead to bad UX design.

Solution

  • Automatically hides the staged section when there is no files staged to reduce item movement, like how VSCode does.
  • The unstaged section remains the same.

Testing

  • Tests have been run on git_ui.

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

Click to view showcase Before: 截屏2026-08-10 08 07 12

After:
截屏2026-08-10 07 56 29


Release Notes:

  • Hide staged section when no files are staged

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Aug 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 Aug 10, 2026
@ChristopherBiscardi

Copy link
Copy Markdown
Contributor

Thanks for the PR, but I don't see a good reason to do this and the mentioned PR that introduced this ( #60976 ), did so intentionally.

When grouping by staged & unstaged, both sections now stay visible even when empty, showing a placeholder message ("No staged changes yet" / "No unstaged changes"). Previously an empty section disappeared entirely, which made the panel layout jump around as you staged and unstaged files, and made it harder to tell at a glance that nothing was staged yet.

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.

2 participants