reposense / RepoSense

Contribution analysis tool for Git repositories
https://reposense.org
MIT License
250 stars 153 forks source link

Add optimise timeline feature #2180

Closed jonasongg closed 6 months ago

jonasongg commented 7 months ago

Fixes #2162 Part of #2157

Proposed commit message

Add optimise timeline feature

Currently, the ramps have a lot of empty space if the since and until
dates are specified far apart. 

Let's add a checkbox that can eliminate this empty space for each ramp.
This is especially useful if RepoSense is to be used to set up a report
of an individual's past OSS contributions.

Other information

jonasongg commented 7 months ago

@sopa301 thank you and fixed!

ckcherry23 commented 7 months ago

Example repo before and after the optimise timelines option is activated.

Before:

Screenshot 2024-04-20 at 6 29 51 PM

After:

Screenshot 2024-04-20 at 6 29 35 PM
damithc commented 7 months ago

Good inputs @ckcherry23

  • [Discuss] When the report is grouped by repos, the various authors under the repo may have different timelines. This discrepancy may make it difficult to compare when different teammates are contributing relatively. We may want to make the timeline duration consistent across a repo group (@damithc). However, when grouping by authors, this doesn't matter.

One option (probably easier too) is to take the stance that 'optimized' timelines isn't suitable for timeline comparisons. What do you all think?

  • [Discuss] We may want to think of a more intuitive name for "Optimise timeline", because it is not immediately clear what this feature does to end users. I would suggest something along the lines of "Condense charts".

'Trim'?

jonasongg commented 7 months ago

@ckcherry23 @damithc thank you for your comments! will do the necessary changes asap.

as for when we are grouping by repos, it shouldn't be too difficult to make the timeline consistent across a group (i think we can just select the minimum and maximum commit date of the group instead of the user). i'm ok to implement either option!

i think "trim timeline" works!

damithc commented 7 months ago

as for when we are grouping by repos, it shouldn't be too difficult to make the timeline consistent across a group (i think we can just select the minimum and maximum commit date of the group instead of the user). i'm ok to implement either option!

@jonasongg This might dilute the effect of the feature, if different authors have authored code at different times. For exampe, if the following author did one more commit in the place pointed by the arrow.

image

So, I'd rather keep the current behavior first, and revisit this after using it for a while.

damithc commented 7 months ago

@jonasongg BTW, just now I realized the zoom feature and this feature must have lot in common, this that this one is like an auto-zoom. Is there some code reuse? Just curious.

jonasongg commented 7 months ago

@damithc got it. for the code reuse question, there is a bit of reuse in the sense that the logic to calculate the position of the ramp slices is the same, but the code that this feature adds is just finding the minimum and maximum commit dates

jonasongg commented 6 months ago

@MarcusTXK the tests were actually added in this PR under optimiseTimeline.cy.js - should I change this?

MarcusTXK commented 6 months ago

@jonasongg Ah OK, apologies I missed it. No worries, this works, let's leave it as it is then.

github-actions[bot] commented 6 months ago

The following links are for previewing this pull request: