`clean-readme-url` - Fix Readme sidebar link by wakamex · Pull Request #10035 · refined-github/refined-github · GitHub
Skip to content

clean-readme-url - Fix Readme sidebar link - #10035

Closed
wakamex wants to merge 1 commit into
refined-github:mainfrom
wakamex:fix-clean-readme-link
Closed

clean-readme-url - Fix Readme sidebar link#10035
wakamex wants to merge 1 commit into
refined-github:mainfrom
wakamex:fix-clean-readme-link

Conversation

@wakamex

@wakamex wakamex commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Fixes #10030

I kept GitHub's #readme-ov-file link unchanged. It looks like a broken anchor while README is already selected, but GitHub also uses it to switch from License, Contributing, Security, and other overview tabs back to README. This matches the original reproduction in #6904 and the tab behavior described in #8370 (comment).

The fix adds a real #readme target when the asynchronously rendered repository-files navigation appears, plus a click fallback that scrolls without preventing GitHub's tab handler. After GitHub selects README, the existing cleaner still removes only the redundant ?tab=readme-ov-file parameter and corrects the final scroll position. Other ?tab=…-ov-file URLs remain untouched.

I tested removing the existing 500 ms delay separately. The correct tab was selected, but the target finished 111 px too low in Chrome and 202 px too low in Firefox, so this keeps the delay.

Tested in Chrome 151 and Firefox 154:

  • Clicking Readme from the default repository view
  • Switching from License back to Readme
  • Loading a direct #readme URL
  • Preserving the License tab and its URL
  • React-rendered element replacement

npm test: 564 passed, 28 skipped.

Test URLs

@wakamex
wakamex marked this pull request as ready for review September 3, 2026 22:35
@fregante

fregante commented Sep 4, 2026

Copy link
Copy Markdown
Member

@fregante fregante closed this Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

Remove broken/useless Readme link from repo sidebar

2 participants