Skip to content

Conversation

@alphathekiwi
Copy link

@alphathekiwi alphathekiwi commented Nov 3, 2025

Closes unknown

image

This PR places the file_name before the file_path so that when the panel is slim it is still usable, mirrors the behaviour of the file picker (cmd+P)

Release Notes:

  • Improved readability of files in the git changes panel

@cla-bot
Copy link

cla-bot bot commented Nov 3, 2025

We require contributors to sign our Contributor License Agreement, and we don't have @alphathekiwi on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@alphathekiwi
Copy link
Author

@cla-bot check

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Nov 3, 2025
@cla-bot
Copy link

cla-bot bot commented Nov 3, 2025

The cla-bot has been summoned, and re-checked this pull request!

@alphathekiwi alphathekiwi changed the title Initial attempt at this change Improves readability of files in the git changes panel Nov 3, 2025
@maxdeviant maxdeviant changed the title Improves readability of files in the git changes panel Improve readability of files in the git changes panel Nov 3, 2025
@cole-miller
Copy link
Member

Thanks for opening a PR! We're discussing internally whether this design is something we want for the git panel, and will let you know what the outcome of that discussion is.

@xipeng-jin
Copy link
Contributor

Hi @alphathekiwi , I like your idea. Previously, I saw there is a similar PR #27230 before. It was being closed due to Zed team would like to handle this case with a different design for Tree-View Git Panel in this ticket #35803. I have been working on that and get a initial setup, but I think the same UI issue is still exist since there is a switch button on top so that you can click on it switch between the tree-view or flat-view as shown here

Screenshot 2025-11-04 at 12 50 55 PM

If you switch to Flat-View you will get the same design as right now, which means the readability of files in git changes are still not great!.
If Zed team is interested in accepting your PR, I am looking forward to integrating it into the final design for git panel with Tree-view. I think that would make the final UI looks even better. I am happy to have a further discussion on this. Thank you. cc @cole-miller

@alphathekiwi
Copy link
Author

The use case of file name first is perfect for when you are editing a bunch of files that all have different names and it is how we do it in the file picker and how VScode does their git view.

The use case for file path first is when edit a lot of files that have the same name translation.json inside of lang/en, lang/cz, etc so i don't want to discredit this as being bad it just should perhaps be a selectable option.

I would hope we could maybe have all three options available to us, perhaps we could expand the selector you have to be like the crude screenshot I have shown

usecase

@alphathekiwi
Copy link
Author

Hi @alphathekiwi , I like your idea. Previously, I saw there is a similar PR #27230 before. It was being closed due to Zed team would like to handle this case with a different design for Tree-View Git Panel in this ticket #35803. I have been working on that and get a initial setup, but I think the same UI issue is still exist since there is a switch button on top so that you can click on it switch between the tree-view or flat-view as shown here

Screenshot 2025-11-04 at 12 50 55 PM If you switch to Flat-View you will get the same design as right now, which means the readability of files in git changes are still not great!. If Zed team is interested in accepting your PR, I am looking forward to integrating it into the final design for git panel with Tree-view. I think that would make the final UI looks even better. I am happy to have a further discussion on this. Thank you. cc @cole-miller

I didn't know about #27230 so the fact that two people wanted this code change enough to make it into a PR and each with different reasons probably indicates there is a non zero amount of people who would like this to exist in some form or fashion. This is my first attempt to make a PR and I don't really understand how the Zed settings system works, otherwise I probably would have made this a setting.

Regardless of the outcome though I want to take the time to thank you for your comprehensive reply and for also taking the time to be very welcoming, I hope to contribute more to the project in future.

@ConradIrwin
Copy link
Member

I think this makes sense, but as a setting (there are some projects where the directory contains a bunch of index.js and tests.js and you need to see the project folder to know).

I do think this makes sense as a default (it'd be better for most projects I use) even though it breaks the obvious sorting behaviour.

I know there's also work going on for the tree view, and other display options here so maybe something like:

{"git_panel": {"filenames": "filename_first"}} // "tree_view" | "full"

But defer to @cole-miller who's working on this

@alphathekiwi
Copy link
Author

@cole-miller at your convenience I would love to pair on making this have a setting, I loosely understand how settings work currently with the exception of the Settings UI portion and would love to work on this, I am hanging out in the zed/git1.0 channel fairly regularly most mornings NZT (afternoon/evenings in American time)

@cole-miller
Copy link
Member

@alphathekiwi Sorry for the delay! We'd like to help get this ready to merge, could you book a pairing time here? https://cal.com/esther-trapadoux-zed/30min

@Anthony-Eid
Copy link
Contributor

@alphathekiwi To add a setting to the settings ui you mainly have to add it to this Vec

pub(crate) fn settings_data(cx: &App) -> Vec<SettingsPage> {
vec![
.

@zed-industries-bot
Copy link

zed-industries-bot commented Nov 14, 2025

Warnings
⚠️

This PR is missing release notes.

Please add a "Release Notes" section that describes the change:

Release Notes:

- Added/Fixed/Improved ...

If your change is not user-facing, you can use "N/A" for the entry:

Release Notes:

- N/A

Generated by 🚫 dangerJS against 3193aa8

@alphathekiwi
Copy link
Author

alphathekiwi commented Nov 14, 2025

@alphathekiwi To add a setting to the settings ui you mainly have to add it to this Vec

pub(crate) fn settings_data(cx: &App) -> Vec<SettingsPage> {
vec![

.

Cool have added settings now have also allowed an option for:
#41857
Although probably that's incorrect as now that I'm thinking about it that should be added with their PR not mine - late night coding lol 🤣

@Anthony-Eid Anthony-Eid self-assigned this Nov 18, 2025
Comment on lines 5479 to 5509
SettingsPageItem::SettingItem(SettingItem {
title: "Show Change Counters",
description: "When to show change counters in the git gutter.",
field: Box::new(SettingField {
json_path: Some("git.show_change_counters"),
pick: |settings_content| settings_content.git.as_ref()?.show_change_counters.as_ref(),
write: |settings_content, value| {
settings_content.git.get_or_insert_default().show_change_counters = value;
},
}),
metadata: None,
files: USER,
}),
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks like a different setting than the GitPathStyle setting your PR added. Is this a setting that was missing from the settings UI?

The second to last step to finalizing this PR is adding the GitPathStyle setting to the UI

Copy link
Contributor

Choose a reason for hiding this comment

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

It seems like CICD is failing because show_change_counter isn't a real value. I'll be happy to help you fix this though.

Copy link
Author

Choose a reason for hiding this comment

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

Ahhh sorry about that, its a combination of broken rust-analyser and trying to work on two things at once.

Copy link
Contributor

Choose a reason for hiding this comment

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

Having a file like this would be very helpful, but it should be added through its own PR.

I also think this file is a bit too information-dense in some areas and misses the why the settings are structured the way they are. I'll be happy to help you clean it up for a different PR 😀

Copy link
Author

Choose a reason for hiding this comment

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

Okay sounds good :)

h_flex()
.items_center()
.flex_1()
// .overflow_hidden()
Copy link
Contributor

Choose a reason for hiding this comment

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

While we're editing this code could you also please remove this comment?

Copy link
Author

Choose a reason for hiding this comment

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

Done

@alphathekiwi alphathekiwi force-pushed the git/file_name_first branch 2 times, most recently from af64793 to c166537 Compare November 18, 2025 20:06
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants