Skip to content

clean-repo-sidebar - Restore feature - #9994

Merged
fregante merged 9 commits into
refined-github:mainfrom
wakamex:fix-clean-repo-sidebar-react
Aug 25, 2026
Merged

fregante merged 9 commits into
refined-github:mainfrom
wakamex:fix-clean-repo-sidebar-react

Conversation

@wakamex

@wakamex wakamex commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

Closes #9909

Tested in Firefox on:

GitHub's current repository sidebar uses React module classes and renders its sections asynchronously. Refined GitHub 26.8.8 still looks for .BorderGrid-row and .Progress-item, so the feature leaves the "About" and "Languages" headings visible and throws:

ElementNotFoundError: Expected element not found: [class*='PageLayout-Pane'] .BorderGrid-row:has(.Progress-item) h2

This PR updates clean-repo-sidebar for GitHub's current sidebar. It observes each sidebar section so it handles the initial markup and React replacements without polling for optional elements.

Runtime checks after React finished rendering:

Sidebar skeletons: 0
About heading display: none
Languages heading class: sr-only
Report repository section: Languages (last section)
Console warnings and errors: 0

Tests

Test Files  32 passed | 1 skipped (33)
Tests       564 passed | 28 skipped (592)
ESLint      passed
Biome       passed
TypeScript  passed
Svelte      0 errors and 0 warnings
Bundle      passed

Before with Refined GitHub 26.8.8

The About and Languages headings remain visible

After with the current build

refined-after-b005a8e4-cropped

Console logs

The clean post-install console capture in refined-after-console.json has no sidebar selector error. Its only entries are the existing read:project token scope messages, which are unrelated to this change.

refined-before-console.json
refined-after-console.json

@github-actions github-actions Bot added the bug label Aug 21, 2026
@wakamex
wakamex marked this pull request as ready for review August 21, 2026 18:00
Comment thread source/features/clean-repo-sidebar.css Outdated
:is(
.BorderGrid-row:first-child h2,
[class*='SidebarSection-module__sidebarSection']:first-child > h2
) {

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.

Most of these :is are not needed, you can just write the two selectors.

However I'd drop the old selectors now and just support the latest version instead. This means a lot of code can be deleted.

Comment thread source/features/clean-repo-sidebar.tsx Resolved
@fregante fregante changed the title clean-repo-sidebar supports GitHub's React repository sidebar clean-repo-sidebar - Restore feature Aug 24, 2026
@fregante

Copy link
Copy Markdown
Member

Cleaned up with Claude, untested. How does it look?

Also I noticed that the "report repository" link was not moved to the bottom in your screenshots.

@wakamex

wakamex commented Aug 24, 2026

Copy link
Copy Markdown
Contributor Author

Looks good. I tested b005a8e in Firefox on YTubic, bin-dir, and yolo. Languages is hidden, the report link moves to the final section, and I saw no console warnings or errors.

I replaced the stale after screenshot with one from the current build showing the report link at the bottom.

}

// Hide empty meta if it’s not editable by the current user
async function hideEmptyMeta(): Promise<void> {

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.

I noticed this is gone, but we should still hide it. Is it hidden via CSS now?

You can add this to the test URLs at the bottom of the page: https://github.com/shadcn/Ant

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

GitHub’s React sidebar changed this from .text-italic to a SidebarAbout-module__noDescription element. It wasn’t covered by the new CSS, so I restored the old permission-aware behavior in f07beb3. The observer removes it when the user can’t edit the repository metadata and leaves it visible for users who can. I also added shadcn/Ant to the test URLs and verified it there.

@wakamex

wakamex commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

The new return skips the report-link handling on repositories with empty metadata.

f07beb3 moves Report repository below Languages:

ant-f07beb35-report-moved-cropped.png

2ab0f28 leaves it in About above Contributors:

ant-2ab0f285-report-not-moved-cropped.png

@fregante
fregante merged commit 73afd11 into refined-github:main Aug 25, 2026
14 checks passed
@fregante

Copy link
Copy Markdown
Member

Thank you!

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.

clean-repo-sidebar broken

2 participants