From 4996a9a30eafa010634ff96e4fdf0076ecdcd5ae Mon Sep 17 00:00:00 2001 From: Claas Augner Date: Wed, 25 Sep 2024 13:44:57 +0200 Subject: [PATCH 1/9] chore(icon): add question-mark --- client/src/ui/atoms/icon/index.scss | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/client/src/ui/atoms/icon/index.scss b/client/src/ui/atoms/icon/index.scss index c4f0b5095374..1f464768e397 100644 --- a/client/src/ui/atoms/icon/index.scss +++ b/client/src/ui/atoms/icon/index.scss @@ -7,11 +7,11 @@ $icons: "add-filled", "add", "altname", "bell", "bell-filled", "bell-ring", "mastodon", "menu-filled", "menu", "mobile", "more", "theme-dark", "new-topic", "next", "no", "nodejs", "nonstandard", "note-info", "note-warning", "note-deprecated", "opera", "padlock", "partial", "play", "prefix", "preview", - "previous", "queue", "queued", "quote", "return", "safari", "samsunginternet", - "search", "send", "server", "sidebar", "simple-firefox", "small-arrow", - "theme-light", "star-filled", "star", "theme-os-default", "thumbs-down", - "thumbs-up", "trash", "trash-filled", "twitter-x", "unknown", "warning", - "webview", "yes", "yes-circle"; + "previous", "question-mark", "queue", "queued", "quote", "return", "safari", + "samsunginternet", "search", "send", "server", "sidebar", "simple-firefox", + "small-arrow", "theme-light", "star-filled", "star", "theme-os-default", + "thumbs-down", "thumbs-up", "trash", "trash-filled", "twitter-x", "unknown", + "warning", "webview", "yes", "yes-circle"; .icon { --size: var(--icon-size, 1rem); From a870a8451f1baa32c92d886493476fec85eaad99 Mon Sep 17 00:00:00 2001 From: Claas Augner Date: Wed, 25 Sep 2024 13:45:40 +0200 Subject: [PATCH 2/9] fix(submenu): select item links more specifically --- client/src/ui/molecules/submenu/index.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/ui/molecules/submenu/index.scss b/client/src/ui/molecules/submenu/index.scss index 5bd1d7707f64..5d1faa0f6bf6 100644 --- a/client/src/ui/molecules/submenu/index.scss +++ b/client/src/ui/molecules/submenu/index.scss @@ -47,7 +47,7 @@ width: 100%; } - a, + li > a, .submenu-item { align-items: center; border: 1px solid transparent; From e3286e70b8d833abe792be4b24d1784823eefa3e Mon Sep 17 00:00:00 2001 From: Claas Augner Date: Wed, 25 Sep 2024 13:51:58 +0200 Subject: [PATCH 3/9] enhance(language-menu): explain "Remember language" setting with link --- .../article-actions/language-menu/index.scss | 18 +++++++++++-- .../article-actions/language-menu/index.tsx | 27 ++++++++++++++----- 2 files changed, 36 insertions(+), 9 deletions(-) diff --git a/client/src/ui/organisms/article-actions/language-menu/index.scss b/client/src/ui/organisms/article-actions/language-menu/index.scss index e36fad565684..d5fcb7ef35a8 100644 --- a/client/src/ui/organisms/article-actions/language-menu/index.scss +++ b/client/src/ui/organisms/article-actions/language-menu/index.scss @@ -31,6 +31,12 @@ background-color: unset; } + .group { + align-items: center; + display: flex; + gap: 0.5em; + } + .switch { display: flex; } @@ -39,9 +45,17 @@ font-style: italic; font-variation-settings: "slnt" -10; margin-top: 0.5em; + } + + .icon { + margin-right: unset; + } + + a[href] .icon-question-mark { + background-color: var(--icon-secondary); - .icon { - margin-right: unset; + &:hover { + background-color: var(--text-link); } } } diff --git a/client/src/ui/organisms/article-actions/language-menu/index.tsx b/client/src/ui/organisms/article-actions/language-menu/index.tsx index 9cbf25a009b6..8e9c9f7ff207 100644 --- a/client/src/ui/organisms/article-actions/language-menu/index.tsx +++ b/client/src/ui/organisms/article-actions/language-menu/index.tsx @@ -1,3 +1,4 @@ +/* eslint-disable react/jsx-no-target-blank */ import { useEffect, useState } from "react"; import { useLocation } from "react-router-dom"; @@ -17,6 +18,7 @@ import { } from "../../../../utils"; import { GleanThumbs } from "../../../atoms/thumbs"; import { Switch } from "../../../atoms/switch"; +import { Icon } from "../../../atoms/icon"; // This needs to match what's set in 'libs/constants.js' on the server/builder! const PREFERRED_LOCALE_COOKIE_NAME = "preferredlocale"; @@ -154,15 +156,26 @@ function LocaleRedirectSetting() { } } + // eslint-disable react/jsx-no-target-blank return (
- - Remember language - +
+ + Remember language + + + + +
); From 2c6e9594fbf126dc2418110ee0fab08a04ce42ff Mon Sep 17 00:00:00 2001 From: Claas Augner Date: Wed, 25 Sep 2024 14:20:53 +0200 Subject: [PATCH 4/9] fix(language-menu): use consistent none value --- client/src/ui/organisms/article-actions/language-menu/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/ui/organisms/article-actions/language-menu/index.tsx b/client/src/ui/organisms/article-actions/language-menu/index.tsx index 8e9c9f7ff207..50f44f52f87f 100644 --- a/client/src/ui/organisms/article-actions/language-menu/index.tsx +++ b/client/src/ui/organisms/article-actions/language-menu/index.tsx @@ -148,7 +148,7 @@ function LocaleRedirectSetting() { maxAge: 60 * 60 * 24 * 365 * 3, }); setPreferredLocale(locale); - gleanClick(`${LANGUAGE_REMEMBER}: ${oldValue} -> ${locale}`); + gleanClick(`${LANGUAGE_REMEMBER}: ${oldValue ?? 0} -> ${locale}`); } else { deleteCookie(PREFERRED_LOCALE_COOKIE_NAME); setPreferredLocale(undefined); From da58cbe15ea8bdbead58e1574fa2ab8917e82ed3 Mon Sep 17 00:00:00 2001 From: Claas Augner Date: Wed, 25 Sep 2024 16:15:10 +0200 Subject: [PATCH 5/9] fixup! enhance(language-menu): explain "Remember language" setting with link --- client/src/ui/organisms/article-actions/language-menu/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/ui/organisms/article-actions/language-menu/index.tsx b/client/src/ui/organisms/article-actions/language-menu/index.tsx index 50f44f52f87f..dde560ab833b 100644 --- a/client/src/ui/organisms/article-actions/language-menu/index.tsx +++ b/client/src/ui/organisms/article-actions/language-menu/index.tsx @@ -168,7 +168,7 @@ function LocaleRedirectSetting() { Remember language Date: Wed, 25 Sep 2024 16:30:36 +0200 Subject: [PATCH 6/9] chore(style): remove eslint-disable --- client/src/ui/organisms/article-actions/language-menu/index.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/client/src/ui/organisms/article-actions/language-menu/index.tsx b/client/src/ui/organisms/article-actions/language-menu/index.tsx index dde560ab833b..d14ec70e8e74 100644 --- a/client/src/ui/organisms/article-actions/language-menu/index.tsx +++ b/client/src/ui/organisms/article-actions/language-menu/index.tsx @@ -156,7 +156,6 @@ function LocaleRedirectSetting() { } } - // eslint-disable react/jsx-no-target-blank return (
From 1fd919f307546ceb63d8a47de76d6ea8fb7b0732 Mon Sep 17 00:00:00 2001 From: Claas Augner Date: Wed, 25 Sep 2024 17:42:51 +0200 Subject: [PATCH 7/9] style(eslint): allow referrers in target="_blank" links --- client/package.json | 10 +++++++++- .../organisms/article-actions/language-menu/index.tsx | 1 - 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/client/package.json b/client/package.json index f1ad9b7ab58a..71751e51a292 100644 --- a/client/package.json +++ b/client/package.json @@ -21,7 +21,15 @@ ] }, "eslintConfig": { - "extends": "react-app" + "extends": "react-app", + "rules": { + "react/jsx-no-target-blank": [ + "error", + { + "allowReferrer": true + } + ] + } }, "jest": { "collectCoverageFrom": [ diff --git a/client/src/ui/organisms/article-actions/language-menu/index.tsx b/client/src/ui/organisms/article-actions/language-menu/index.tsx index d14ec70e8e74..3617e81097bc 100644 --- a/client/src/ui/organisms/article-actions/language-menu/index.tsx +++ b/client/src/ui/organisms/article-actions/language-menu/index.tsx @@ -1,4 +1,3 @@ -/* eslint-disable react/jsx-no-target-blank */ import { useEffect, useState } from "react"; import { useLocation } from "react-router-dom"; From 0a1eff72f11b8fb6b657b423e5052438ca3df5bb Mon Sep 17 00:00:00 2001 From: Claas Augner Date: Wed, 25 Sep 2024 17:55:54 +0200 Subject: [PATCH 8/9] Revert "style(eslint): allow referrers in target="_blank" links" This reverts commit 1fd919f307546ceb63d8a47de76d6ea8fb7b0732. --- client/package.json | 10 +--------- .../organisms/article-actions/language-menu/index.tsx | 1 + 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/client/package.json b/client/package.json index 71751e51a292..f1ad9b7ab58a 100644 --- a/client/package.json +++ b/client/package.json @@ -21,15 +21,7 @@ ] }, "eslintConfig": { - "extends": "react-app", - "rules": { - "react/jsx-no-target-blank": [ - "error", - { - "allowReferrer": true - } - ] - } + "extends": "react-app" }, "jest": { "collectCoverageFrom": [ diff --git a/client/src/ui/organisms/article-actions/language-menu/index.tsx b/client/src/ui/organisms/article-actions/language-menu/index.tsx index 3617e81097bc..d14ec70e8e74 100644 --- a/client/src/ui/organisms/article-actions/language-menu/index.tsx +++ b/client/src/ui/organisms/article-actions/language-menu/index.tsx @@ -1,3 +1,4 @@ +/* eslint-disable react/jsx-no-target-blank */ import { useEffect, useState } from "react"; import { useLocation } from "react-router-dom"; From 535b01ec113cf061aa8000fe199520cd59c189f6 Mon Sep 17 00:00:00 2001 From: Claas Augner Date: Wed, 25 Sep 2024 17:56:39 +0200 Subject: [PATCH 9/9] chore(language-menu): add rel="noreferrer" --- .../src/ui/organisms/article-actions/language-menu/index.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/client/src/ui/organisms/article-actions/language-menu/index.tsx b/client/src/ui/organisms/article-actions/language-menu/index.tsx index d14ec70e8e74..0b189c54d7cd 100644 --- a/client/src/ui/organisms/article-actions/language-menu/index.tsx +++ b/client/src/ui/organisms/article-actions/language-menu/index.tsx @@ -1,4 +1,3 @@ -/* eslint-disable react/jsx-no-target-blank */ import { useEffect, useState } from "react"; import { useLocation } from "react-router-dom"; @@ -168,7 +167,7 @@ function LocaleRedirectSetting() {