Repository navigation
Lint - #5113
Lint#5113
Conversation
This avoids getting a "Page not found" in Firefox and having to reload the tab.
it looks especially out of place in hovercards.
Browser is smart most of the type, especially if you are not reading it but setting it.
| console.group('❌', id, version, pageDetect.isEnterprise() ? 'GHE →' : '→', error); | ||
|
|
||
| const searchIssueUrl = new URL('https://github.com/refined-github/refined-github/issues'); | ||
| searchIssueUrl.searchParams.set('q', `is:issue "${message}"`); |
There was a problem hiding this comment.
Not sure if quoting them is better, at least that's how it looks to me.
There was a problem hiding this comment.
Maybe not, issues may still be useful even if they're not identical
There was a problem hiding this comment.
Maybe not, issues may still be useful even if they're not identical
Somehow I missed this message 😅
| const newIssueUrl = new URL('https://github.com/refined-github/refined-github/issues/new?labels=bug&template=1_bug_report.md'); | ||
| const newIssueUrl = new URL('https://github.com/refined-github/refined-github/issues/new'); | ||
| newIssueUrl.searchParams.set('labels', 'bug'); | ||
| newIssueUrl.searchParams.set('template', '1_bug_report.yml'); |
There was a problem hiding this comment.
Yup, a bug of bug report (.md -> .yml) 😄
You cannot click this line (here, with linkify-code or your editor) to create a bug report anymore but who would do that anyway.
There was a problem hiding this comment.
Does it work with the new issue form though? Does it auto-fill?
There was a problem hiding this comment.
Not yet but I'm fixing it Fixed.
| \`\`\` | ||
| `)); | ||
| newIssueUrl.searchParams.set('example_url', location.href); | ||
| newIssueUrl.searchParams.set('browser_s_used', navigator.userAgent); |
There was a problem hiding this comment.
NIIICE. The user agent is no longer being updated though, I think we should drop it so the user is forced to specify the real one. Also example_url can be moved above description
There was a problem hiding this comment.
The user agent is no longer being updated though, I think we should drop it so the user is forced to specify the real one.
I do not intend to use navigator.userAgent directly as most of it is useless. However I think a sensible default would be very helpful.
Also
example_urlcan be moved abovedescription
It is following the order of the template.
This feature does not make sense there.
| // @ts-expect-error navigator.userAgentData is not typed | ||
| const {platform} = navigator.userAgentData || navigator; | ||
| const browser = /(Chrome|Firefox|Safari)\/\d+/.exec(navigator.userAgent)?.[0]; | ||
| newIssueUrl.searchParams.set('browser_s_used', [platform, browser].join(' ')); |
There was a problem hiding this comment.
Not jumping into the rabbit hole but this should be enough (platform/OS name + browser name + major browser version).
"Chrome" here matches any Chromium-based browser, since we only care about its version.
For example, it produces macOS Chrome/96, MacIntel Firefox/94 and MacIntel Safari/605 on some of my browsers.
This reverts commit 5a65c2a.
commented
Dec 2, 2021
|
I've moved many changes into separate PR (refer to the timeline) to keep things precise. This PR is now reduced to lint, cleanup & refactor and one line fixes... except for that bug report change ( Future changes to this PR should fall into the above categories. |
| const browser = /(Chrome|Firefox|Safari)\/\d+/.exec(navigator.userAgent); | ||
| // Unknown browsers will need to be specified manually | ||
| if (browser) { | ||
| // @ts-expect-error navigator.userAgentData is not typed | ||
| const {platform} = navigator.userAgentData || navigator; | ||
| newIssueUrl.searchParams.set('browser_s_used', `${platform as string} ${browser[0]}`); | ||
| } |
There was a problem hiding this comment.
As mentioned before, but we should not do this. Let the user enter the browser, which may be reported as "chrome" when in reality it's Vivaldi. We don't need to parse this information because it's so fickle
| const browser = /(Chrome|Firefox|Safari)\/\d+/.exec(navigator.userAgent); | |
| // Unknown browsers will need to be specified manually | |
| if (browser) { | |
| // @ts-expect-error navigator.userAgentData is not typed | |
| const {platform} = navigator.userAgentData || navigator; | |
| newIssueUrl.searchParams.set('browser_s_used', `${platform as string} ${browser[0]}`); | |
| } |
| if (!issueLink) { | ||
| return; | ||
| } |
There was a problem hiding this comment.
I mentioned this in the commit message: https://github.com/refined-github/refined-github/search
There was a problem hiding this comment.
We should use a URL-based exclusion instead because this silences any future errors we might have. Example:
eclude: [
() => location.search === ''
]
No need for a full, custom detection in github-url-detection
refined-github#225 is more than 5.5 years old
commented
Dec 6, 2021
|
I would not add actual changes in lint PRs because they get lost and there's no argument/screenshot for the change. Lint PRs are for refactorings and code cleanups, not bugfixes nor new features |
commented
Dec 6, 2021
I learned this the hard way 👍 |
commented
Dec 10, 2021
|
Let's not keep lint PRs around for too long. It's good as is for now. You can review the "restore" commits I made and reviews I left and open separate PRs for those. |
A long-overdue thanksgiving gift 🦃️
Test URLs
Screenshot
file-finder-bufferleft marginBefore:
After: