Conversation
| "homepage_url": "https://github.com/refined-github/refined-github", | ||
| "manifest_version": 3, | ||
| "minimum_chrome_version": "123", | ||
| "minimum_chrome_version": "125", |
There was a problem hiding this comment.
Due to repeated regex group names
|
|
||
| export default function getUserAvatar(username: string, size: number): string | void { | ||
| const cleanName = username.replace('[bot]', ''); | ||
| const cleanName = username.replace('[bot]', '').replace('app/', ''); |
There was a problem hiding this comment.
This an inconsistency issue on GitHub's side:
| // Prefer reading username from URL if present. | ||
| // - [data-hovercard-url]: everywhere but the React PR lists (global and repo) | ||
| // - [aria-label="Filter by author github-user-here"]: in React PR lists (global and repo) | ||
| const attribute = element.getAttribute('data-hovercard-url') ?? element.getAttribute('aria-label'); |
There was a problem hiding this comment.
I'd rather read the value from attributes because they're generally parseable with fewer surprises.
One exception here is the issue list https://github.com/eslint/eslint/issues?q=author%3Aapp%2Fdependabot, which doesn't include any attributes except href. So maybe I should parse author:app/dependabot from there
There was a problem hiding this comment.
On more scenario that this might be fixing is where GitHub has started showing full names in the links, like on eslint's repo. I might just want to extract the username from textContent since that might have fewer variations and since it always exists.
| // GitHub appends `[bot]` to bots in PR lists. | ||
| assertUsername(username?.replace(/\[bot\]$/, '')); | ||
|
|
||
| return username; |
There was a problem hiding this comment.
Perhaps this should standardize one of app/ vs [bot]
| import regexJoin from 'regex-join'; | ||
|
|
||
| import features from '../feature-manager.js'; | ||
| import getUserAvatarURL from '../github-helpers/get-user-avatar.js'; |
There was a problem hiding this comment.
getUserAvatarURL should probably be modified to return | undefined for unknown bots. It seems that it fails otherwise.
small-user-avatars- Restore on new PR lists #10080