Skip to content

Fix Git toolbar button sizing - #62030

Closed
chirivelli wants to merge 1 commit into
zed-industries:mainfrom
chirivelli:fix/dynamic-git-toolbar-button-widths
Closed

Fix Git toolbar button sizing#62030
chirivelli wants to merge 1 commit into
zed-industries:mainfrom
chirivelli:fix/dynamic-git-toolbar-button-widths

Conversation

@chirivelli

@chirivelli chirivelli commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator

Objective

Fix Git diff toolbar buttons with longer labels, such as Unstage All, overflowing their fixed-width bounds at some font sizes and UI scaling settings.

Solution

Removed the fixed 80 px / 5 rem widths from the relevant Git toolbar buttons and allowed the existing button component to size itself based on its label.

This applies to the following actions across project, staged, unstaged, and single-file diff toolbars:

  • Stage All
  • Unstage All
  • Restore All

Testing

  • Reviewed the diff for all affected Git toolbar implementations.
  • Ran git diff --check successfully.
  • Started cargo check -p git_ui; it progressed without errors but did not complete within the two-minute command timeout.
  • Started the workspace formatting check; it did not complete within the two-minute command timeout.

Reviewers can test this by opening the project, staged, unstaged, and single-file diff views, then staging or unstaging all changes. Verify that the toolbar buttons fit their complete labels at different UI font sizes and display scaling settings.

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
Click to view showcase

Before:

618014578-d009e836-ce39-4997-995a-e59bf33fc2c9.mov

After:

Screen.Recording.2026-08-01.at.10.26.39.AM.mov

Release Notes:

  • Fixed Git diff toolbar action labels overflowing their buttons at some font sizes and display scaling settings.

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Aug 1, 2026
@zed-community-bot zed-community-bot Bot added the guild Pull requests by someone in Zed Guild. NOTE: the label application is automated via github actions label Aug 1, 2026
@SomeoneToIgnore

Copy link
Copy Markdown
Contributor

Thank you for the PR.

It talks about visual changes, but provides no screenshots despite https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#sending-changes

@chirivelli

Copy link
Copy Markdown
Collaborator Author

@danilo-leal

this is a fix for the issue I pointed out here #60464 (comment)
can you reopen this PR

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 guild Pull requests by someone in Zed Guild. NOTE: the label application is automated via github actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants