`extensible-nav` - Fix duplicate nav when the header re-renders by HasselNot7 · Pull Request #10046 · refined-github/refined-github · GitHub
Skip to content

extensible-nav - Fix duplicate nav when the header re-renders - #10046

Open
HasselNot7 wants to merge 4 commits into
refined-github:mainfrom
HasselNot7:fix/extensible-nav-duplicate-nav
Open

extensible-nav - Fix duplicate nav when the header re-renders#10046
HasselNot7 wants to merge 4 commits into
refined-github:mainfrom
HasselNot7:fix/extensible-nav-duplicate-nav

Conversation

@HasselNot7

Copy link
Copy Markdown

Closes #10038

Toggling a repository feature (Issues, Wikis, ...) makes GitHub rebuild the header. The native nav[aria-label="Repository"] gets re-added, so observe runs replace again. Each replace mounted a fresh ExtensibleNav but never tore down the previous one, so the bars stack up.

replace now returns an unmount function and is wrapped in singleton, the same helper rgh-feature-descriptions uses to keep a single instance alive. On a rebuild the old nav is unmounted before the new one is mounted, so only one is ever present.

Test URLs

The duplicate only shows on a repository's settings page, which needs admin access. On any repo you manage, open its settings and toggle "Issues" (or another feature) off and on: the repository nav stacks up before the fix and stays single after it. See the gif below.

A public page to confirm the nav still renders correctly (no regression):

https://github.com/sindresorhus/awesome

I checked this on Chromium (Edge on Windows). There is no Safari for Windows, so I could not run it here, and the report came from Safari. I'd appreciate someone confirming it on Safari. The change only affects how the nav component is mounted and torn down, which is the same on every browser, so I'd expect it to behave the same on Safari. :D

Screenshot

Before
before

After
after

@github-actions github-actions Bot added the bug label Sep 5, 2026
@HasselNot7
HasselNot7 marked this pull request as ready for review September 5, 2026 01:38

@fregante fregante left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great solution!

Comment thread source/features/extensible-nav.tsx Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

extensible-nav duplicate nav when toggling repository settings

2 participants