From 8dc2329b473a4e8fdb9751ad39bb60af92e7253e Mon Sep 17 00:00:00 2001 From: Quaylyn Rimer Date: Sun, 3 Aug 2025 00:12:48 -0600 Subject: [PATCH] fix: show moved account notice in hover card popup - Add conditional logic to display moved account notice when account.moved is present - Include link to new account with proper formatting - Hide follow/unfollow buttons for moved accounts to prevent confusion - Add localization key 'account.moved_to_short' for hover card context - Style moved notice to match existing hover card design patterns Fixes #35623 --- .../mastodon/components/hover_card_account.tsx | 14 ++++++++++++++ app/javascript/mastodon/locales/en.json | 1 + app/javascript/styles/mastodon/components.scss | 17 +++++++++++++++++ 3 files changed, 32 insertions(+) diff --git a/app/javascript/mastodon/components/hover_card_account.tsx b/app/javascript/mastodon/components/hover_card_account.tsx index a5a5e4c9575..67004b59c0d 100644 --- a/app/javascript/mastodon/components/hover_card_account.tsx +++ b/app/javascript/mastodon/components/hover_card_account.tsx @@ -98,6 +98,20 @@ export const HoverCardAccount = forwardRef< /> )} + ) : account.moved ? ( +
+ + @{account.moved.acct} + + ), + }} + /> +
) : ( <>
diff --git a/app/javascript/mastodon/locales/en.json b/app/javascript/mastodon/locales/en.json index 329ac90589e..b29f4ccbe0f 100644 --- a/app/javascript/mastodon/locales/en.json +++ b/app/javascript/mastodon/locales/en.json @@ -58,6 +58,7 @@ "account.media": "Media", "account.mention": "Mention @{name}", "account.moved_to": "{name} has indicated that their new account is now:", + "account.moved_to_short": "This account has moved to {acct}", "account.mute": "Mute @{name}", "account.mute_notifications_short": "Mute notifications", "account.mute_short": "Mute", diff --git a/app/javascript/styles/mastodon/components.scss b/app/javascript/styles/mastodon/components.scss index d6f0087cc67..2b66da007e1 100644 --- a/app/javascript/styles/mastodon/components.scss +++ b/app/javascript/styles/mastodon/components.scss @@ -11027,6 +11027,23 @@ noscript { font-weight: 500; } + &__moved-notice { + text-align: center; + font-weight: 500; + color: $secondary-text-color; + + a { + color: inherit; + text-decoration: underline; + + &:hover, + &:focus, + &:active { + text-decoration: none; + } + } + } + .display-name { font-size: 15px; line-height: 22px;