Refined-github: `edit-readme` broken

Created on 8 Apr 2020  ·  12Comments  ·  Source: sindresorhus/refined-github

  1. Visit https://github.com/fregante/tiny-version-compare/tree/v2.0.0
  2. Click edit button on top right of readme
  3. See 404 at https://github.com/fregante/tiny-version-compare/edit/v2.0.0/README.md

This button shouldn't appear on tag pages

bug good first issue help wanted

All 12 comments

Does that even work? We had this exact issue on both features before: https://github.com/sindresorhus/refined-github/issues/2261

Maybe we should undo that. The edit button isn't available on tagged blobs either: https://github.com/sindresorhus/refined-github/blob/19.7.19/source/libs/on-file-list-update.ts

Maybe we should require the user to first click the default-branch-button and then the edit button will appear there, regularly.


GitHub themselves is inconsistent:

GitHub adds “edit readme” links on commits as well but they will point to master, like /edit/master/readme.md so we should do the same

This happens on the readme, but not other files. 🤷‍♂️

in edit-files-faster we do this.
Do the same here?

Alright, let's do this.

@fregante 2 issues.
One is the the issue you are having is githubs issue
https://github.com/sindresorhus/refined-github/blob/45ab67ec7f1675cc29182a993688e7a45fa429bc/source/features/edit-readme.tsx#L13-L15

number 2 is the whole feature is broken since the selector was changed

One is the the issue you are having is githubs issue

?

That edit button is added by github not refined-github

GitHub adds it to your repos
RG adds it to repos you can't edit, e.g.: https://github.com/sindresorhus/refined-github#readme

Right and that is broken
https://github.com/sindresorhus/refined-github/blob/45ab67ec7f1675cc29182a993688e7a45fa429bc/source/features/edit-readme.tsx#L8

Needs to be changed to const readmeHeader = select('#readme .Box-header h2');

Lol you're right, it's their own bug. I guess edit-readme should have 2 parts:

  • add button if missing
  • fix button if it's a tagged page

Lol you're right, it's their own bug. I guess edit-readme-faster should have 2 parts:

  • add button if missing
  • fix button if it's a tagged page

But....

The selector can be a h2 or a h3.

On the master branch it looks like its a h3 on tags it looks like its a h2

On the master branch it looks like its a h3 on tags it looks like its a h2

I'm not seeing that difference, it's also an h2. This on my repo (link by GitHub)
Screen Shot 2020-04-13 at 02 37 48

This on another repo (edit-readme-faster missing)

Screen Shot 2020-04-13 at 02 38 17

I'll open a new specific issue

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vanniktech picture vanniktech  ·  3Comments

hkdobrev picture hkdobrev  ·  3Comments

juliocanares picture juliocanares  ·  3Comments

MilesBHuff picture MilesBHuff  ·  3Comments

fregante picture fregante  ·  3Comments