sindresorhus/refined-github

Add indicator for last commit that was code reviewed #4573

mhatvan posted onGitHub

Whenever I review code, I sometimes come back a while later and forgot which commits I already saw before and which ones are new.

It would be great to have a little check mark or border indicating the commits that are newer than the ones that were code reviewed previously on the GitHub commits view like here: https://github.com/sindresorhus/refined-github/pull/4554/commits


GitHub already does this:

<img width="948" alt="Screen Shot" src="https://user-images.githubusercontent.com/1402241/126030948-0962dac5-b265-4842-a3cf-9aaf7ee4ba66.png">

posted by fregante over 3 years ago

I think the OP is talking about doing something similar on the "Commits" tab of a PR page.

posted by cheap-glitch over 3 years ago

Yeah, GitHub does this, but the general PR view often gets cluttered up with comments and other history entries apart from commits, so it would be great to have it on the "Commits" tab of a PR page like @cheap-glitch said.

posted by mhatvan over 3 years ago

I see. Determining this "last review" time and actually displaying it accurately is difficult, especially if there's a force push. Examples:

  • do we use the "last viewed" date like in my screenshot to match GitHub’s behavior? Then we need to probably fetch the whole Conversation tab page and hope to find it
  • do we just keep the "last opened" time locally? Then cross-browser/cross-device reviews are lost
  • do we just use the last review’s time? This is the most reasonable

In most cases we also need to fetch the full commit list and their dates.


If we can avoid the time/commit match, maybe we just need to store/fetch the last commit seen and then find it on the list. This would partially fix the "force push" problem because if the commit no longer exists, no indicator is added.

Any other implementation suggestions?

posted by fregante over 3 years ago

Probably saving a timestamp for the time when a user submits a code review makes most sense. Then you know everything > timestamp is unseen.

posted by mhatvan over 3 years ago

But as mentioned that doesn’t cover 2 situations:

  • reviews from other devices/browsers
  • force pushes
posted by fregante over 3 years ago

Yeah true, no knowledge about the implementation details of this repo so don't know what options there are.

posted by mhatvan over 3 years ago

Closing as too fickle/complex, I suggest asking GitHub

posted by fregante over 3 years ago

Fund this Issue

$0.00
Funded

Pull requests