Repository: refined-github/refined-github
Pull request #8220 (2025-01-10 19:58:53)

Update token creation link /2
@fregante you forgot in f30ca4a22528e9720e23b85d4cd38f074d64b179. Maybe add comments to reference each other? Since one of them is a static HTML and a hassle to extract as a variable.


## Test URLs

N/A

## Screenshot

N/A


Patch:
diff --git a/build/__snapshots__/features-meta.json b/build/__snapshots__/features-meta.json
index 57e41ff8..625d0abe 100644
--- a/build/__snapshots__/features-meta.json
+++ b/build/__snapshots__/features-meta.json
@@ -807,7 +807,6 @@
 	{
 		"id": "show-names",
 		"description": "Adds the real name of users by their usernames.",
-		"css": true,
 		"screenshot": "https://github-production-user-asset-6210df.s3.amazonaws.com/83146190/252756294-94785dc2-423e-498c-939a-359a012036e0.png"
 	},
 	{
diff --git a/source/features/github-bugs.css b/source/features/github-bugs.css
index 544c84b7..ceb6ad50 100644
--- a/source/features/github-bugs.css
+++ b/source/features/github-bugs.css
@@ -102,6 +102,21 @@ svg.octicon-package + a.Truncate[href*='/releases/download/'] > .Truncate-text {
 	white-space: wrap;
 }
 
+/* Notifications "Group by" button unnecessary space */
+/* Info: https://github.com/refined-github/refined-github/pull/8208 */
+/* Test: https://github.com/notifications */
+/* Matches .d-md-block */
+@media (width >= 768px) {
+	/* Pulls the alert container to the right when empty */
+	.gap-4.pl-3:not(:has(a.h6)):has(
+			> .d-md-block
+				> .js-socket-channel[data-url^='/notifications/beta/recent_notifications_alert']
+		) {
+		/* Substract 16px spacing from both .gap-3 and .ml-3 */
+		margin-right: -32px;
+	}
+}
+
 /*
 
 Test URLs:
diff --git a/source/features/show-names.css b/source/features/show-names.css
deleted file mode 100644
index 5765041e..00000000
--- a/source/features/show-names.css
+++ /dev/null
@@ -1,4 +0,0 @@
-/* Prevent text reversal Unicode hacks in full names */
-.rgh-show-names .timeline-comment-header-text bdo {
-	display: inline-block;
-}
diff --git a/source/features/show-names.tsx b/source/features/show-names.tsx
index dc26d3f1..51376d4d 100644
--- a/source/features/show-names.tsx
+++ b/source/features/show-names.tsx
@@ -1,5 +1,3 @@
-import './show-names.css';
-
 import React from 'dom-chef';
 import * as pageDetect from 'github-url-detection';
 import batchedFunction from 'batched-function';
@@ -27,7 +25,8 @@ function appendName(element: HTMLAnchorElement, fullName: string): void {
 	const insertionPoint = parentElement!.tagName === 'STRONG' ? parentElement! : element;
 	const nameElement = (
 		<span className="color-fg-muted css-truncate d-inline-block ml-1">
-			(<bdo className="css-truncate-target" style={{maxWidth: '200px'}}>{fullName}</bdo>)
+			{/* .css-truncate-target sets display: inline-block and confines bidi overrides #8191 */}
+			(<span className="css-truncate-target" style={{maxWidth: '200px'}}>{fullName}</span>)
 		</span>
 	);
 
@@ -106,4 +105,10 @@ Test URLs:
 - mannequins: https://togithub.com/python/cpython/issues/67591
 - newsfeed: https://github.com
 
+Special cases:
+
+- RTL: https://github.com/refined-github/refined-github/issues/8191
+- Bidi override case 1: https://togithub.com/FortAwesome/Font-Awesome/issues/2465
+- Bidi override case 2: https://togithub.com/w3c/webdriver/issues/385#issuecomment-598407238
+
 */
diff --git a/source/github-helpers/index.ts b/source/github-helpers/index.ts
index dc38bf79..8b8e5ae3 100644
--- a/source/github-helpers/index.ts
+++ b/source/github-helpers/index.ts
@@ -49,7 +49,10 @@ export function isUsernameAlreadyFullName(username: string, realname: string): b
 		.toLowerCase();
 	realname = realname
 		.normalize('NFD')
-		.replaceAll(/\W/g, '')
+		// Remove diacritics, punctuation and spaces
+		// https://stackoverflow.com/a/37511463/288906
+		// https://www.freecodecamp.org/news/what-is-punct-in-regex-how-to-match-all-punctuation-marks-in-regular-expressions/
+		.replaceAll(/[\p{Diacritic}\p{P}\s]/gu, '')
 		.toLowerCase();
 
 	return username === realname;
diff --git a/source/options.html b/source/options.html
index 87aa5fb6..df5170e8 100644
--- a/source/options.html
+++ b/source/options.html
@@ -24,7 +24,8 @@
 	<details id="token">
 		<summary><strong>🔑 Personal token</strong></summary>
 		<div>
-			<p>You should <a id="personal-token-link" href="https://github.com/settings/tokens/new?description=Refined%20GitHub&scopes=repo,read:project">generate a token</a> to ensure that every feature works correctly. You can read more about the token on <a href="https://github.com/refined-github/refined-github/wiki/Security">the wiki.</a></p>
+			<!-- Keep this URL in sync with welcome.html -->
+			<p>You should <a id="personal-token-link" href="https://github.com/settings/tokens/new?description=Refined%20GitHub&scopes=repo,read:project&default_expires_at=none">generate a token</a> to ensure that every feature works correctly. You can read more about the token on <a href="https://github.com/refined-github/refined-github/wiki/Security">the wiki.</a></p>
 			<p><strong>Token-less usage is not officially supported.</strong></p>
 			<p>
 				<input
diff --git a/source/welcome.svelte b/source/welcome.svelte
index b459a0ba..a1fc0065 100644
--- a/source/welcome.svelte
+++ b/source/welcome.svelte
@@ -98,6 +98,7 @@
 				class="will-show"
 				onclick={showThirdStep}
 			>
+				<!-- Keep this URL in sync with options.html -->
 				<a
 					href="https://github.com/settings/tokens/new?description=Refined%20GitHub&scopes=repo,read:project&default_expires_at=none"
 					onclick={markSecondStep}


Test patch:
diff --git a/source/github-helpers/index.test.ts b/source/github-helpers/index.test.ts
index e3a7e40c..091a8ce4 100644
--- a/source/github-helpers/index.test.ts
+++ b/source/github-helpers/index.test.ts
@@ -91,8 +91,11 @@ test('isUsernameAlreadyFullName', () => {
 	assert.isTrue(isUsernameAlreadyFullName('john-wdoe', 'John W. Doe'));
 	assert.isTrue(isUsernameAlreadyFullName('john-doe-jr', 'John Doe Jr.'));
 	assert.isTrue(isUsernameAlreadyFullName('nicolo', 'Nicolò'));
+
+	assert.isFalse(isUsernameAlreadyFullName('wonderful', 'wonder'));
 	assert.isFalse(isUsernameAlreadyFullName('dotconnor', 'Connor Love'));
-	assert.isFalse(isUsernameAlreadyFullName('fregante ', 'Federico Brigante'));
+	assert.isFalse(isUsernameAlreadyFullName('fregante', 'Federico Brigante'));
+	assert.isFalse(isUsernameAlreadyFullName('chipwolf', 'Chip Wolf ‮ '));
 });
 
 test('getLatestVersionTag', () => {