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
This commit is contained in:
Quaylyn Rimer 2025-08-03 00:43:49 -06:00
parent 15f6f8a8bc
commit 7268e97900

View File

@ -1,4 +1,5 @@
import { Map as ImmutableMap } from 'immutable'; import { Map as ImmutableMap } from 'immutable';
import type { Meta, StoryObj } from '@storybook/react-vite'; import type { Meta, StoryObj } from '@storybook/react-vite';
import { accountFactory, accountFactoryState } from '@/testing/factories'; import { accountFactory, accountFactoryState } from '@/testing/factories';
@ -19,9 +20,16 @@ const meta = {
}, },
decorators: [ decorators: [
(Story) => ( (Story) => (
<div style={{ padding: '20px', backgroundColor: '#f5f5f5', minHeight: '300px' }}> <div
style={{
padding: '20px',
backgroundColor: '#f5f5f5',
minHeight: '300px',
}}
>
<p style={{ marginBottom: '20px', color: '#666' }}> <p style={{ marginBottom: '20px', color: '#666' }}>
Hover card examples - demonstrating Issue #35623 fix for moved accounts Hover card examples - demonstrating Issue #35623 fix for moved
accounts
</p> </p>
<Story /> <Story />
</div> </div>
@ -54,7 +62,7 @@ const regularAccount = accountFactoryState({
const movedAccount = accountFactoryState({ const movedAccount = accountFactoryState({
id: '2', id: '2',
username: 'bob_old', username: 'bob_old',
acct: 'bob_old@mastodon.social', acct: 'bob_old@mastodon.social',
display_name: 'Bob Smith (Moved)', display_name: 'Bob Smith (Moved)',
note: 'I have moved to a new account. Please follow me there!', note: 'I have moved to a new account. Please follow me there!',
followers_count: 890, followers_count: 890,