Skip to content

useful-not-found-page - Improve style and reliability#9812

Merged
fregante merged 9 commits into
mainfrom
svelte-404
Jul 12, 2026
Merged

useful-not-found-page - Improve style and reliability#9812
fregante merged 9 commits into
mainfrom
svelte-404

Conversation

@fregante fregante left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Current status:

Image

Arguably we don't need this breadcrumb, we could alter the existing path in place, linkifying the sub-parts.

() => parseCurrentUrl().length > 1,
],
awaitDomReady: true, // Small page
init: onetime(showMissingPartOnce),

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Long overdue updates: the breadcrumbs now only appear on repo files. There are very few instances in which a breadcrumb makes sense outside of this. The only one being :real-user/:404-repo, which needs a single link and could be done separately.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Update two: breadcrumbs dropped altogether for now. Only the native one remains (on /tree/ URLs)

}

async function initRepoFile(signal: AbortSignal): Promise<void> {
observe('#repos-header-breadcrumb-wide-heading + ol a', crossIfNonExistent, {signal});

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Lost in the mess of this huge feature was this helper that crossed-through GitHub's own breadcrumbs. Sadly these only appear on /tree/ pages, so we still need our own breadcrumbs on /blob/ pages.

Selector updated, our breadcrumb hidden on /tree/ pages.


/*

Test URLs:

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@fregante fregante changed the title useful-not-found-page - Componentize useful-not-found-page - Refactor Jul 12, 2026
@fregante fregante marked this pull request as ready for review July 12, 2026 16:13
/* Missing branch */
.flex-items-center a[aria-label='go to default branch'] {
display: none;
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This drops their useless green buttons that just point to repo root.


<div class="color-fg-muted rgh-hide-if-empty">
{#await getGitHistory()}
Loading history of this {type}...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Adds some feedback to tell the user something is loading. This is the kind of things we just don't do without components.

Not the best of styles but better than nothing.

Comment on lines +94 to +103
const commitSha = await getLatestCommitToFile(url.branch, url.filePath);
if (!commitSha) {
// Never existed
return undefined;
}

const fileChanges = await getChangesToFileInCommit(commitSha, url.filePath);
if (!fileChanges) {
return undefined;
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Would be good to handle these two states separately but I've worked on this component enough already. I left a TODO in the template.

],
exclude: [
pageDetect.isRepoFile404,
pageDetect.is404,

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@fregante fregante changed the title useful-not-found-page - Refactor useful-not-found-page - Improve style and reliability Jul 12, 2026
@fregante fregante enabled auto-merge (squash) July 12, 2026 16:35
@fregante fregante merged commit 701f221 into main Jul 12, 2026
19 checks passed
@fregante fregante deleted the svelte-404 branch July 12, 2026 16:50
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.

1 participant