sindresorhus/refined-github

Add more information to `useful-not-found-page` #4617

fregante posted onGitHub

Description

Renamed files turn into 404s, but we add a link to the commit history:

<img width="877" alt="Screen Shot 9" src="https://user-images.githubusercontent.com/1402241/127319360-a6f19e37-3c3b-4c98-81d2-9058f80e3208.png">

What we if were more explicit about what happened to the file and link to the last known version?

Example:

  • the file was deleted by bab4ba 3 months ago
  • the file was renamed to a.jsx
  • the branch doesn't exist
  • see the last version

Arguably these links are more useful than the breadcrumbs resolution and can be appended to the page as the API calls resolve

Example URL

https://github.com/gorhill/uBlock/blob/master/assets/ublock/resources.txt


Hi there!

I would like to take up this issue, but I noticed that it has the under discussion label. Is there something I should know before taking it up or could I take a crack at it?

Thanks

posted by gamemaker1 over 3 years ago

under discussion means that the details are not exact and further suggestions are welcome. You could either propose an improved UI to include all of that information or just add one or 2 more links.

I think the core code change here is fetching the last commit that affected the file and then find out what happened to it (deleted or renamed) and then point to the previous commit.

But again I haven't looked into the details, so alternative/better implementations are welcome.

posted by fregante over 3 years ago

Hi!

Thanks for the reply. I couldn't think of an improved UI to display this info, so I took a crack at adding it to the page. I opened a draft PR for this (#4646), it would be great if you could take a look at the changes I made.

Thanks a lot!

posted by gamemaker1 over 3 years ago

Fund this Issue

$0.00
Funded

Pull requests