Skip to content
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

Add graphic for commit diffstat in Commits Panel #1899

Closed
ckcherry23 opened this issue Feb 9, 2023 · 2 comments · Fixed by #2010
Closed

Add graphic for commit diffstat in Commits Panel #1899

ckcherry23 opened this issue Feb 9, 2023 · 2 comments · Fixed by #2010

Comments

@ckcherry23
Copy link
Member

ckcherry23 commented Feb 9, 2023

What feature(s) would you like to see in RepoSense

Along with each commit on the Commits Panel, show the number of insertions and deletions with a simple visualization. This can be placed next to the LoC changed count.

Purpose

This graphic must be useful to get a high-level overview of the impact of a commit:

  • Compare the ratio of additions/deletions per commit
  • Compare commit sizes across commits

Existing design alternatives

1. GitHub style: Fixed-width

  • Histogram-style visualization of the number of additions and deletions in a fixed-width bar.
  • The number of green and red boxes is calculated based on the ratio of additions to deletions.
  • Due to the fixed size of each graphic, we cannot compare commit sizes across commits.
  • Example:
    image
    Image source

2. cgit style: Proportional to commit size

  • (Right-aligned) Contribution bar that visualizes the number of additions and deletions.
  • The size of each bar should be calculated based on the actual commit size, rather than ratio between additions/deletions.
  • Due to the varying size of each graphic, it may introduce some challenges in size calculations or alignment (responsiveness). Good to define a maximum width.
  • One large commit (like package.json) may make other significant commits seem too small.
  • Example:
    image
    Image source

Proposed solution

I believe the contribution bar proportional to commit size meets most of our requirements, though it may require more work to implement. We could also hide the contribution bar when the commit messages are hidden, to reduce clutter. Please do add any alternative suggestions or thoughts!

@damithc
Copy link
Collaborator

damithc commented Feb 9, 2023

Is it possible to reuse the code used to generate contribution bar in the ramp chart?

@ckcherry23
Copy link
Member Author

Yes, seems like we can refactor the code and reuse it. Some changes may be required if we are not okay with multi-line contribution bars on the commit panel.

@ckcherry23 ckcherry23 assigned ckcherry23 and unassigned ckcherry23 Jun 25, 2023
chan-j-d pushed a commit that referenced this issue Jul 28, 2023
A diffstat graphic is useful in providing a visual representation
of the changes within and between commits. 

Let's add a diffstat graphic emulating the diffstat used by cgit, 
to help users have a high-level overview of the impact of a
commit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Closed/Completed
Development

Successfully merging a pull request may close this issue.

2 participants