-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
title_bar: Show git status indicator icon in the title bar #38029
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
title_bar: Show git status indicator icon in the title bar #38029
Conversation
|
Looks great! |
cole-miller
left a comment
There was a problem hiding this 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 *.
crates/title_bar/src/title_bar.rs
Outdated
| .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) | ||
| } | ||
| }) |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
d480824 to
fda67ca
Compare
fda67ca to
7ee194e
Compare
…tries#38029) See related discussion zed-industries#37046. <details> <summary>Screenshots</summary> **No Changes** <img src="https://github.com/user-attachments/assets/e814da6e-bc9b-4edd-b37a-6bb4680d5bb3" /> **Added** <img src="https://github.com/user-attachments/assets/07ffdf90-08cb-43f4-b2bd-9966a21e08de" /> **Changed** <img src="https://github.com/user-attachments/assets/7e13b999-83b3-41ea-b2ab-baaa1541b169" /> **Deleted** <img src="https://github.com/user-attachments/assets/a77fc7e3-a026-419a-87bd-7146c3ca46a9" /> **Conflicts** <img src="https://github.com/user-attachments/assets/17e7e35c-d81b-4660-808d-08e12107ea2d" /> </details> Release Notes: - Show git status indicator icon in the title bar




See related discussion #37046.
Screenshots
No Changes

Added

Changed

Deleted

Conflicts

Release Notes: