From 840da146b968b4db7616f5528f1a2b0d24e9517a Mon Sep 17 00:00:00 2001 From: Vendicated Date: Sat, 8 Apr 2023 23:28:12 +0200 Subject: [PATCH] UX: Make possibly copy-relevant text in settings copyable --- src/components/PatchHelper.tsx | 5 +++-- src/components/PluginSettings/PluginModal.tsx | 7 ++++--- .../VencordSettings/BackupRestoreTab.tsx | 1 + src/components/VencordSettings/ThemesTab.tsx | 2 +- src/components/VencordSettings/Updater.tsx | 18 +++++++++++++----- .../VencordSettings/settingsStyles.css | 9 +++++++++ 6 files changed, 31 insertions(+), 11 deletions(-) diff --git a/src/components/PatchHelper.tsx b/src/components/PatchHelper.tsx index f1fe22c0..37782ef3 100644 --- a/src/components/PatchHelper.tsx +++ b/src/components/PatchHelper.tsx @@ -186,9 +186,10 @@ function ReplacementInput({ replacement, setReplacement, replacementError }) { error={error ?? replacementError} /> {!isFunc && ( - <> +
Cheat Sheet {Object.entries({ + "\\i": "Special regex escape sequence that matches identifiers (varnames, classnames, etc.)", "$$": "Insert a $", "$&": "Insert the entire match", "$`\u200b": "Insert the substring before the match", @@ -200,7 +201,7 @@ function ReplacementInput({ replacement, setReplacement, replacementError }) { {Parser.parse("`" + placeholder + "`")}: {desc} ))} - +
)} + {plugin.name} @@ -198,7 +199,7 @@ export default function PluginModal({ plugin, onRestartNeeded, onClose, transiti {!!plugin.settingsAboutComponent && ( -
+
diff --git a/src/components/VencordSettings/BackupRestoreTab.tsx b/src/components/VencordSettings/BackupRestoreTab.tsx index 7a3729da..17374702 100644 --- a/src/components/VencordSettings/BackupRestoreTab.tsx +++ b/src/components/VencordSettings/BackupRestoreTab.tsx @@ -41,6 +41,7 @@ function BackupRestoreTab() { Settings Export contains:
  • — Custom QuickCSS
  • +
  • — Theme Links
  • — Plugin Settings
diff --git a/src/components/VencordSettings/ThemesTab.tsx b/src/components/VencordSettings/ThemesTab.tsx index 4bd0eb8e..83a08700 100644 --- a/src/components/VencordSettings/ThemesTab.tsx +++ b/src/components/VencordSettings/ThemesTab.tsx @@ -90,7 +90,7 @@ export default ErrorBoundary.wrap(function () { return ( <> - + Paste links to .css / .theme.css files here One link per line Make sure to use the raw links or github.io links! diff --git a/src/components/VencordSettings/Updater.tsx b/src/components/VencordSettings/Updater.tsx index 15a8c87a..809a3e70 100644 --- a/src/components/VencordSettings/Updater.tsx +++ b/src/components/VencordSettings/Updater.tsx @@ -229,11 +229,19 @@ function Updater() { Repo - {repoPending ? repo : err ? "Failed to retrieve - check console" : ( - - {repo.split("/").slice(-2).join("/")} - - )} () + + {repoPending + ? repo + : err + ? "Failed to retrieve - check console" + : ( + + {repo.split("/").slice(-2).join("/")} + + ) + } + {" "}() + diff --git a/src/components/VencordSettings/settingsStyles.css b/src/components/VencordSettings/settingsStyles.css index ebc112c0..971e9a87 100644 --- a/src/components/VencordSettings/settingsStyles.css +++ b/src/components/VencordSettings/settingsStyles.css @@ -57,3 +57,12 @@ color: var(--white-500); background-color: var(--button-danger-background); } + +.vc-text-selectable, +.vc-text-selectable :not(a, button) { + /* make text selectable, silly discord makes the entirety of settings not selectable */ + user-select: text; + + /* discord also sets cursor: default which prevents the cursor from showing as text */ + cursor: initial; +}