Repository navigation
Extend git status coloring in the project panel and editor tabs
#60273
Replies: 2 comments
|
I switched to Zed from IntelliJ a while back, and not being able to tell staged/unstaged/renamed files apart at a glance in the project panel and tabs is one of the few things I still missed from IntelliJ’s file tree. It’s a small detail, but it genuinely slowed down my daily review-changes-file-by-file workflow — so thanks for writing this up, @norberthanderek, it matches exact my pain point. I ended up scoping and implementing exactly this: #64311. It makes unstaged (worktree) status show at full strength, fades fully-staged (index-only) files to read as “done”, and gives renamed files their own distinct color instead of falling through to the default. As a bonus it also adds a dedicated, theme-configurable color for untracked files, since those previously looked identical to newly added ones. Greetings Micha. |
|
@fenta23 yeah, my thoughts exactly. I've also switched from IntelliJ to Zed, but for some reason I can't stick with it. I keep switching between IntelliJ and Zed. Partially, I think, because of this issue. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
What are you proposing?
Extend the existing git status coloring in the project panel and editor tabs to distinguish more states. As of now
project_panel.git_statusandtabs.git_statustint file names by added / modified / deleted / conflicted only.I'd like them to also reflect staged and moved.
Why does this matter?
File tree reads flat and it's hard now to navigate around changes in the file tree.
Personally after making changes I like to review them file by file and having all states of git reflected in the file tree helps me distinguish whether something is done or todo. Also during this process I often end up changing files again, so in Zed I am never sure what is the state of my work.
Other editors (VS Code, neovim and CLI tools like lazygit) surface staged vs unstaged directly in their file/change lists, and it's something I miss daily in Zed. TBH for now I edit in Zed and peek into neovim every once in a while just to visualise the state of file tree. I am aware there is a git panel built-in but it's a flat list and suits a different purpose.
Are there any examples or context?
Example from my neovim setup
(don't mind the theme, icons or glyphs, I just want to showcase the color differences)
Possible approach
The data is already there and it funnels through a single function:
entry_git_aware_label_colorincrates/editor/src/items.rs(used by both the project panel and tabs).Its first line collapses staging:
GitSummarykeeps.index(staged) and.worktree(unstaged) separate, andStageStatusalready models this incrates/git/src/status.rs, the info is discarded here, not missing.There's also no
renamedbranch despiteversion_control_renamedalready existing incrates/theme/src/styles/colors.rs.I've scoped this and I'm happy to implement it, the render side is contained.
The only thing I'd rather agree on first is the theme model:
version_control_*keysLet me know which way you'd prefer and I'll get started 😄
All reactions