Skip to content

Conversation

@lzakharov
Copy link
Contributor

@lzakharov lzakharov commented Sep 11, 2025

See related discussion #37046.

Screenshots

No Changes

Added

Changed

Deleted

Conflicts

Release Notes:

  • Show git status indicator icon in the title bar
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Sep 11, 2025
@mdj-uk
Copy link

mdj-uk commented Sep 11, 2025

Looks great!

@cole-miller cole-miller self-assigned this Sep 12, 2025
Copy link
Member

@cole-miller cole-miller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for opening a PR. I think it's reasonable to have a visual indication of the repository status here, but we should use color-coding like we already do for tab titles and multibuffer headers instead of a + or *.

Comment on lines 519 to 530
.map(|name| {
if !settings.show_branch_status || repo.cached_status().next().is_none() {
name
} else if repo
.cached_status()
.all(|entry| entry.status.staging().is_fully_staged())
{
format!("{}+", name)
} else {
format!("{}*", name)
}
})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't iterate over the cached status here, instead we should call RepositorySnapshot::status_summary and branch on that (coloring of paths in the project panel should provide an example here).

Copy link
Contributor Author

@lzakharov lzakharov Sep 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I tried to add coloring of the branch name by analogy with the coloring of the paths in the project panel, but it looks rather motley (subjectively, but I found it very inconvenient). At the same time, an idea came up that it is possible to add multi-colored icons before the branch name (expand the current logic of displaying the branch icon). What do you think?

Screenshots
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, seems like a reasonable solution to me.

@lzakharov lzakharov changed the title title_bar: Show git status indicator next to the branch name Sep 18, 2025
@lzakharov lzakharov force-pushed the title-bar-git-status-indicator branch from d480824 to fda67ca Compare September 18, 2025 06:54
@lzakharov lzakharov force-pushed the title-bar-git-status-indicator branch from fda67ca to 7ee194e Compare September 18, 2025 06:56
@cole-miller cole-miller merged commit 3707102 into zed-industries:main Oct 6, 2025
22 checks passed
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

3 participants