11import { css } from 'code-tag' ;
22
3+ export type UrlMatch = [ expectations : number , url : string ] ;
4+
35/** The repo navigation bar */
46export const repoUnderlineNavUl = '.js-responsive-underlinenav ul.UnderlineNav-body' ;
57export const repoUnderlineNavUl_ = [
6- 'https://github.com/refined-github/refined-github' ,
7- 'https://github.com/refined-github/refined-github/releases' ,
8- ] ;
8+ [ 1 , 'https://github.com/refined-github/refined-github' ] ,
9+ [ 1 , 'https://github.com/refined-github/refined-github/releases' ] ,
10+ ] satisfies UrlMatch [ ] ;
911
1012export const standaloneGistLinkInMarkdown = css `
1113 .js-comment-body p a : only - child: is (
@@ -14,23 +16,30 @@ export const standaloneGistLinkInMarkdown = css`
1416 )
1517` as 'a' ; // TODO: Drop after https://github.com/fregante/code-tag/issues/12
1618export const standaloneGistLinkInMarkdown_ = [
17- 'https://github.com/refined-github/sandbox/issues/77' ,
18- ] ;
19+ [ 3 , 'https://github.com/refined-github/sandbox/issues/77' ] ,
20+ ] satisfies UrlMatch [ ] ;
1921
2022/** The repo navigation bar’s overflow menu */
2123export const repoUnderlineNavDropdownUl = '.js-responsive-underlinenav .dropdown-menu ul' ;
22- export const repoUnderlineNavDropdownUl_ = repoUnderlineNavUl_ ;
24+ export const repoUnderlineNavDropdownUl_ = [
25+ // Added via JS :(
26+ // TOOD: Use Puppeteer?
27+ [ 0 , 'https://github.com/refined-github/refined-github' ] ,
28+ [ 0 , 'https://github.com/refined-github/refined-github/releases' ] ,
29+ ] satisfies UrlMatch [ ] ;
2330
2431export const branchSelector = '[data-hotkey="w"]' ;
2532export const branchSelector_ = [
26- 'https://github.com/refined-github/refined-github' ,
27- 'https://github.com/refined-github/refined-github/blob/main/readme.md' ,
28- 'https://github.com/refined-github/refined-github/blame/main/readme.md' ,
29- 'https://github.com/refined-github/refined-github/tree/main/source' ,
30- 'https://github.com/refined-github/sandbox/tree/branch/with/slashes' ,
31- 'https://github.com/refined-github/sandbox/commits/branch/with/slashes' ,
32- 'https://github.com/refined-github/sandbox/commits' ,
33- ] ;
33+ [ 1 , 'https://github.com/refined-github/refined-github' ] ,
34+ // Added via JS :(
35+ // TOOD: Use Puppeteer?
36+ [ 0 , 'https://github.com/refined-github/refined-github/blob/main/readme.md' ] ,
37+ [ 0 , 'https://github.com/refined-github/refined-github/blame/main/readme.md' ] ,
38+ [ 0 , 'https://github.com/refined-github/refined-github/tree/main/source' ] ,
39+ [ 1 , 'https://github.com/refined-github/sandbox/tree/branch/with/slashes' ] ,
40+ [ 1 , 'https://github.com/refined-github/sandbox/commits/branch/with/slashes' ] ,
41+ [ 1 , 'https://github.com/refined-github/sandbox/commits' ] ,
42+ ] satisfies UrlMatch [ ] ;
3443
3544export const branchSelectorParent = 'details#branch-select-menu' ;
3645export const branchSelectorParent_ = branchSelector_ ;
@@ -41,20 +50,21 @@ export const directoryListingFileIcon = [
4150 '.js-navigation-container .octicon-file' ,
4251] ;
4352export const directoryListingFileIcon_ = [
44- 'https://github.com/refined-github/refined-github' ,
45- 'https://github.com/refined-github/refined-github/tree/main/.github' ,
46- ] ;
53+ [ 1 , 'https://github.com/refined-github/refined-github' ] ,
54+ [ 1 , 'https://github.com/refined-github/refined-github/tree/main/.github' ] ,
55+ ] satisfies UrlMatch [ ] ;
4756
4857export const prCommit = '.TimelineItem--condensed:has(.octicon-git-commit)' ;
4958export const prCommit_ = [
50- 'https://github.com/refined-github/sandbox/pull/10' ,
51- ] ;
59+ [ 1 , 'https://github.com/refined-github/sandbox/pull/10' ] ,
60+ ] satisfies UrlMatch [ ] ;
5261
5362// `summary` is needed because the details dropdown contains the list of check runs, each with its status icon
5463export const prCommitStatusIcon = `:is(${ prCommit } ) details.commit-build-statuses summary .octicon` ;
5564export const prCommitStatusIcon_ = [
56- 'https://github.com/refined-github/sandbox/pull/10' ,
57- ] ;
65+ // Icon not loaded when logged out :(
66+ [ 0 , 'https://github.com/refined-github/sandbox/pull/10' ] ,
67+ ] satisfies UrlMatch [ ] ;
5868
5969// `.color-fg-open` is needed because of the icon added by `highlight-non-default-base-branch`
6070export const openPrsListLink = css `
@@ -64,13 +74,24 @@ export const openPrsListLink = css`
6474 ) a.js-navigation-open
6575` ;
6676export const openPrsListLink_ = [
67- 'https://github.com/refined-github/sandbox/issues?q=conflict' ,
68- ] ;
77+ [ 4 , 'https://github.com/refined-github/sandbox/issues?q=conflict' ] ,
78+ ] satisfies UrlMatch [ ] ;
79+
80+ export const openIssueToLastComment = `
81+ :is(.js-issue-row, .js-pinned-issue-list-item)
82+ .Link--muted:is(
83+ a[aria-label$="comment"],
84+ a[aria-label$="comments"]
85+ )
86+ ` ;
87+ export const openIssueToLastComment_ = [
88+ [ 2 , 'https://github.com/refined-github/sandbox/labels/bug' ] ,
89+ ] satisfies UrlMatch [ ] ;
6990
7091export const actionsTab = '#actions-tab' ;
7192export const actionsTab_ = [
72- 'https://github.com/refined-github/sandbox' ,
73- ] ;
93+ [ 1 , 'https://github.com/refined-github/sandbox' ] ,
94+ ] satisfies UrlMatch [ ] ;
7495
7596export const codeSearchHeader = css `
7697 div : has (
@@ -79,5 +100,6 @@ export const codeSearchHeader = css`
79100 )
80101` ;
81102export const codeSearchHeader_ = [
82- 'https://github.com/search?q=repo%3Arefined-github%2Frefined-github&type=code' ,
83- ] ;
103+ // Search not available when logged out :(
104+ [ 0 , 'https://github.com/search?q=repo%3Arefined-github%2Frefined-github&type=code' ] ,
105+ ] satisfies UrlMatch [ ] ;
0 commit comments