sindresorhus/refined-github

`edit-readme` broken #2982

fregante posted onGitHub

  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


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

posted by fregante almost 5 years ago

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. 🤷‍♂️

posted by fregante almost 5 years ago

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

Alright, let's do this.

posted by fregante almost 5 years ago

@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

posted by yakov116 almost 5 years ago

One is the the issue you are having is githubs issue

?

That edit button is added by github not refined-github

posted by yakov116 almost 5 years ago

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

posted by fregante almost 5 years ago

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');

posted by yakov116 almost 5 years ago

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
posted by fregante almost 5 years ago

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

posted by yakov116 almost 5 years ago

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) <img width="449" alt="Screen Shot 2020-04-13 at 02 37 48" src="https://user-images.githubusercontent.com/1402241/79083653-e0ff8b00-7d2f-11ea-8f1b-cff8ef34a743.png">

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

<img width="287" alt="Screen Shot 2020-04-13 at 02 38 17" src="https://user-images.githubusercontent.com/1402241/79083652-dfce5e00-7d2f-11ea-8de0-6656ccf040d4.png">

posted by fregante almost 5 years ago

I'll open a new specific issue

posted by fregante almost 5 years ago

Fund this Issue

$0.00
Funded

Pull requests