`useful-not-found-page` - Improve style and reliability by fregante · Pull Request #9812 · refined-github/refined-github · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions build/__snapshots__/features-meta.json
9 changes: 7 additions & 2 deletions build/features.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ class FeatureFile {
get css(): FeatureFile {
return new FeatureFile(this.id + '.css');
}

get svelte(): FeatureFile {
return new FeatureFile(this.id + '.svelte');
}
}

function validateReadme(featureId: FeatureId): void {
Expand Down Expand Up @@ -158,8 +162,9 @@ function validateGql(file: FeatureFile): void {
);

assert(
file.tsx.contents().includes(`from './${file.name}';`),
`Should be imported by \`${file.tsx.name}\``,
file.tsx.contents().includes(`from './${file.name}';`)
|| file.svelte.exists() && file.svelte.contents().includes(`from './${file.name}';`),
`Should be imported by \`${file.tsx.name}\` or \`${file.svelte.name}\``,
);
}

Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"filter-altered-clicks": "^2.1.1",
"flat-zip": "^1.0.1",
"github-reserved-names": "^2.2.0",
"github-url-detection": "^11.2.2",
"github-url-detection": "^11.2.3",
"indent-textarea": "^4.0.0",
"js-abbreviation-number": "^1.4.0",
"linkify-issues": "^4.2.0",
Expand Down
2 changes: 1 addition & 1 deletion source/features/easy-toggle-commit-messages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void features.add(import.meta.url, {
pageDetect.isSingleFile,
],
exclude: [
pageDetect.isRepoFile404,
pageDetect.is404,
],
init,
});
Expand Down
2 changes: 1 addition & 1 deletion source/features/file-age-color.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void features.add(import.meta.url, {
pageDetect.isRepoTree,
],
exclude: [
pageDetect.isRepoFile404,
pageDetect.is404,
],
init,
});
Expand Down
2 changes: 1 addition & 1 deletion source/features/quick-file-edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void features.add(import.meta.url, {
pageDetect.isRepoTree,
],
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.

isArchivedRepoAsync,
isPermalink,
],
Expand Down
6 changes: 6 additions & 0 deletions source/features/useful-not-found-page.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/* Missing file */
.flex-items-center a[aria-label='go to Overview'],
/* 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.

154 changes: 154 additions & 0 deletions source/features/useful-not-found-page.svelte
Loading
Loading