useful-not-found-page - Improve style and reliability#9812
Conversation
| () => parseCurrentUrl().length > 1, | ||
| ], | ||
| awaitDomReady: true, // Small page | ||
| init: onetime(showMissingPartOnce), |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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}); |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
Wasn't me. Fails without RG too
https://github.com/refined-github/refined-github/tree/nope/source/lol/highest-rated-comment
useful-not-found-page - Componentizeuseful-not-found-page - Refactor
| /* Missing branch */ | ||
| .flex-items-center a[aria-label='go to default branch'] { | ||
| display: none; | ||
| } |
There was a problem hiding this comment.
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}... |
There was a problem hiding this comment.
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.
| 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; | ||
| } |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
useful-not-found-page - Refactoruseful-not-found-page - Improve style and reliability

404 file
https://github.com/refined-github/refined-github/blob/main/source/features/a-horse-with-no-name.tsx
No text
410 file
https://github.com/refined-github/refined-github/blob/main/source/features/highest-rated-comment.tsx

301 file
https://github.com/refined-github/refined-github/blob/main/extension/content.js

404 folder (native breadcrumbs)
https://github.com/fregante/GhostText/tree/3cacd7df71b097dc525d99c7aa2f54d31b02fcc8/chrome/scripts/InputArea

404 ref
https://github.com/refined-github/refined-github/blob/eggs-for-branch/package.json

410 PR commit
f3b5e71(#9773)