project_panel: Add diagnostic count badges and color priority#49802
Conversation
…r/warnings over git status)
smitbarmase
left a comment
There was a problem hiding this comment.
Thanks, this is a great addition. I left some comments.
|
Hi @smitbarmase, thanks so much for the review, I've addressed all three points:
I also updated the setting description in the settings UI to clarify that diagnostic badges no longer override git status colors. |
smitbarmase
left a comment
There was a problem hiding this comment.
Thanks! I pushed a commit on top with some cleanup and defaulted it to on, since this is nice addition.
One behavior change I made is badge counts now respect the show_diagnostics setting, so warnings won't show when it's set to "errors".
No pressure on the git status indicators, take your time whenever you get to it.
Discussed in zed-industries#6668 specifically this comment from @zackangelo: > The biggest thing keeping me from using Zed as a daily driver is error indication in the project panel. When I'm making big project-wide changes I can't clearly see which files have errors (in editors like VSCode the filenames turn red). > VSCode seems to use a letter on the right gutter to indicate git status and a number next to it to indicate diagnostic status. The color indicates either. This PR implements that, I added an opt-in `diagnostic_badges` setting (default is false) that shows error and warning counts as colored labels on the right side of each project panel entry. Counts bubble up to parent directories. When `diagnostic_badges` is enabled, diagnostic severity takes priority over git status for entry text color. Since warnings and git-modified share the same yellow, git status with this option on is readable through the file icon decoration and the absence of a number badge on the right. Example: <img width="522" height="785" alt="image" src="https://github.com/user-attachments/assets/2da62580-86fe-480b-9b57-ff137ea42285" /> <img width="884" height="580" alt="image" src="https://github.com/user-attachments/assets/198e9a45-dacd-4f1e-a66c-f2b84fd4db63" /> Release Notes: - Added diagnostic count badges to the project panel, displaying error and warning counts next to file names. You can modify this setting using the `diagnostic_badges` option, which is enabled by default. --------- Co-authored-by: Smit Barmase <[email protected]>
This PR adds Git status badges next to file names in the Project Panel, following my older PR #49802 These are enabled by having "git_status" true. Screenshot <img width="343" height="320" alt="image" src="https://github.com/user-attachments/assets/b2c208bf-5027-4947-a5ee-eeb74fadb02b" /> I'd love to hear feedback about any of this :) Especially feedback on these: - File name colour is determined only by Git status, the diagnostic badges remain separate. Should diagnostics also affect the filename colour? - (Unstaged) Modified files and staged modifications share the same colour, in vscode staged modifications use a brownish colour by default which I could not find the colours. I think differentiating them is definetely something to add. Release Notes - Added git status indicators in Project Panel. It can be enabled by setting `git_status_indicator` to `true` in `project_panel` settings. --------- Co-authored-by: Smit Barmase <[email protected]>

Discussed in #6668 specifically this comment from @zackangelo:
This PR implements that, I added an opt-in
diagnostic_badgessetting (default is false) that shows error and warning counts as colored labels on the right side of each project panel entry. Counts bubble up to parent directories.When
diagnostic_badgesis enabled, diagnostic severity takes priority over git status for entry text color.Since warnings and git-modified share the same yellow, git status with this option on is readable through the file icon decoration and the absence of a number badge on the right.
Example:

Release Notes:
diagnostic_badgesoption, which is enabled by default.