Skip to content

Conversation

@phlpsong
Copy link
Contributor

@phlpsong phlpsong commented Mar 21, 2024

Description

A small improvement to show Git branch information.

Get branch upstream track info when getting branch list and current branch, and show the ahead/behind info in the repo tab.

Checklist

  • I read and understood the contributing guide as well as the code of conduct
  • The issues this PR addresses are related to each other
  • My changes generate no new warnings
  • My code builds and runs on my machine
  • My changes are all related to the related issue above
  • I documented my code

Screenshots

Screenshot 2024-03-21 at 19 34 27

@austincondiff austincondiff self-requested a review March 21, 2024 19:55
Copy link
Collaborator

@austincondiff austincondiff left a comment

Choose a reason for hiding this comment

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

This looks really good! Two small changes...

  1. The added information to the right should have a foregroundStyle of secondary.
  2. There should be about 5px of spacing between the two indicators.

@phlpsong
Copy link
Contributor Author

Thank you for the comment.

  1. The track text style appears slightly different from Xcode after applying .foregroundStyle(.secondary), it will looks lighter than Xcode. Maybe keep the current style?
Screenshot 2024-03-22 at 15 49 33 Screenshot 2024-03-22 at 15 49 25
  1. Updated.

@Angelk90
Copy link
Contributor

@phlpsong , @austincondiff :

Xcode:
Screenshot 2024-03-22 alle 18 43 23

CE:
Screenshot 2024-03-22 alle 18 43 35

Some considerations above are the images to understand the differences:

  1. The current branch is always found as the first branch, all the others are in alphabetical order.
  2. When a branch is selected as seen in the icon images in this case it becomes white, in CE in this case you do not see blue being used as the primary system color, not the standard one.
  3. When the occupied space takes up all the text in this case I'm talking about current, and the CE text.

@austincondiff
Copy link
Collaborator

Yeah, to match Xcode, the icon and secondary text would both need to be white when the item is highlighted.

@phlpsong
Copy link
Contributor Author

phlpsong commented Mar 23, 2024

Thanks for your review comments. I have made some changes to these comments.

I can submit a separate pull request later to optimize these issues. For this pull request, I would like to focus solely on branch track info.

Screenshot 2024-03-23 at 09 22 42 Screenshot 2024-03-23 at 09 21 21

Let me know what you think.

@Angelk90
Copy link
Contributor

@phlpsong : why did the branches icon turn blue?

@phlpsong
Copy link
Contributor Author

phlpsong commented Mar 23, 2024

@phlpsong : why did the branches icon turn blue?

Yes, I noticed that too. What I changed locally for this icon color issue is not a valid solution which will affect others icon color, I'm still trying to find a workaround.

I also tried to use check selection to change the icon color but the transition seems has some delays which you may notice in below recording. This issue also happens in the Changes tab list. I will try if I could optimize this.

Screen.Recording.2024-03-23.at.15.58.15.mov

@Angelk90
Copy link
Contributor

@phlpsong :

Registrazione.schermo.2024-03-23.alle.12.37.33.mov

@austincondiff austincondiff merged commit e13e7da into CodeEditApp:main Mar 23, 2024
@phlpsong phlpsong deleted the git-branch-track-info branch March 23, 2024 14:21
@thecoolwinter thecoolwinter added the enhancement New feature or request label Jul 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants