Skip to content

useful-not-found-page - Hide redundant buttons again - #10136

Merged
fregante merged 3 commits into
refined-github:mainfrom
nanami-0713:fix/useful-not-found-page-blankslate
Oct 6, 2026
Merged

fregante merged 3 commits into
refined-github:mainfrom
nanami-0713:fix/useful-not-found-page-blankslate

Conversation

@nanami-0713

Copy link
Copy Markdown
Contributor

Description

GitHub's redesigned 404 blank slate dropped the go to Overview / go to default branch aria-labels, so both legacy selectors in useful-not-found-page.css stopped matching and the buttons are visible again (#10133).

The new selector anchors on the stable error-404-description test id (the 410 variant's eror- typo is kept, as observed in the feature's own selector list) and hides the blank slate's primary action, reusing the .Blankslate-Action > a:only-child pattern already present for the 301-file rule.

Verified against the live DOM of both variants (logged-out fetch + rendered page): the old selectors match 0 elements, the new one matches exactly the one button on each page, and display: none applies after injection.

Test URLs

Screenshot

Missing branch, before / after:

Before After

Missing file, before / after:

Before After

(Screenshots taken by injecting the exact CSS rule of this PR into the live pages listed above.)

Closes #10133

@github-actions github-actions Bot added the bug label Sep 27, 2026
@fregante

Copy link
Copy Markdown
Member

Thanks for the PR. Actually this is best done in the init function after mounting the widget:

function addWidget(container: HTMLElement): void {

The reason is that :has() selectors are very heavy so we avoid where possible. The CSS should stay unchanged, it's already slate for removal in 2027

@fregante
fregante marked this pull request as draft September 29, 2026 11:07
@nanami-0713
nanami-0713 force-pushed the fix/useful-not-found-page-blankslate branch from c670ae8 to 5fed705 Compare October 5, 2026 04:58
@nanami-0713

Copy link
Copy Markdown
Contributor Author

Reworked as suggested: the CSS is back to its original state and the superseded default actions are now hidden imperatively in addWidget, right after the widget mounts, matching them structurally (:scope > .Blankslate-Action > a:only-child) since the buttons lost their aria-label in the redesign.

Verification: tsc --noEmit, eslint, dprint check and the full vitest suite (629 passed) are green; the selector semantics were additionally checked against minimal DOM fixtures, including the multi-link and non-action-scope negatives.

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown

Please don't force-push to this PR, it makes it harder to see what changed since the last review.

We merge commits rather than squash, so we care more about reviewability than a clean history. Feel free to push dirty commits.

…ter mounting the widget

Move the fix from CSS to the widget mount site as suggested in the review:
`:has()` selectors are heavy, so the default "go to" actions are now
hidden imperatively. The CSS stays unchanged.

Fixes the selector regression after the 2026 blank slate redesign, where
the buttons lost their aria-label.
@nanami-0713
nanami-0713 force-pushed the fix/useful-not-found-page-blankslate branch from 5fed705 to ba8fc0a Compare October 5, 2026 04:59
@fregante
fregante marked this pull request as ready for review October 6, 2026 08:12

@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.

Image Image

@fregante fregante changed the title useful-not-found-page - Fix the selector after the 2026 blank slate redesign useful-not-found-page - Hide redundant buttons again Oct 6, 2026
@fregante
fregante merged commit 601f6fa into refined-github:main Oct 6, 2026
14 checks passed
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.

useful-not-found-page not hiding "go to default branch" button

2 participants