diff --git a/app/javascript/mastodon/actions/compose.js b/app/javascript/mastodon/actions/compose.js index b4be55cbfe..abc86a3394 100644 --- a/app/javascript/mastodon/actions/compose.js +++ b/app/javascript/mastodon/actions/compose.js @@ -93,7 +93,7 @@ const messages = defineMessages({ export const ensureComposeIsVisible = (getState) => { if (!getState().getIn(['compose', 'mounted'])) { - browserHistory.push('/publish'); + browserHistory.push('/publish', { focusTarget: false }); } }; @@ -292,7 +292,10 @@ export function submitCompose(successCallback) { message: statusId === null ? messages.published : messages.saved, action: messages.open, dismissAfter: 10000, - onClick: () => browserHistory.push(`/@${response.data.account.username}/${response.data.id}`), + onClick: () => browserHistory.push( + `/@${response.data.account.username}/${response.data.id}`, + { focusTarget: 'detailed-status' } + ), })); }).catch(function (error) { dispatch(submitComposeFail(error)); diff --git a/app/javascript/mastodon/components/account_header/name.tsx b/app/javascript/mastodon/components/account_header/name.tsx index b46e849765..5bd2ed80db 100644 --- a/app/javascript/mastodon/components/account_header/name.tsx +++ b/app/javascript/mastodon/components/account_header/name.tsx @@ -19,6 +19,7 @@ import { FollowsYouBadge } from '../badge'; import { CopyButton } from '../copy_button'; import { DisplayName } from '../display_name'; import { Icon } from '../icon'; +import { NavigationFocusTarget } from '../navigation_focus_target'; import { AccountBadges } from './badges'; import classes from './styles.module.scss'; @@ -56,9 +57,9 @@ export const AccountName: FC<{ accountId: string }> = ({ accountId }) => { return (
-

+ -

+ {relationship?.followed_by && }
diff --git a/app/javascript/mastodon/features/alt_text_modal/__tests__/index-test.tsx b/app/javascript/mastodon/features/alt_text_modal/__tests__/index-test.tsx index 709e0ff6c2..bf1189d44a 100644 --- a/app/javascript/mastodon/features/alt_text_modal/__tests__/index-test.tsx +++ b/app/javascript/mastodon/features/alt_text_modal/__tests__/index-test.tsx @@ -7,6 +7,8 @@ import { List, Map } from 'immutable'; import { render } from '@testing-library/react'; import { vi } from 'vitest'; +import { FocusTargetProvider } from '@/mastodon/components/navigation_focus_target'; +import { Router } from '@/mastodon/components/router'; import type { RootState } from 'mastodon/store'; import { useAppSelector } from 'mastodon/store'; @@ -27,9 +29,13 @@ describe('', () => { const renderComponent = () => { return render( - - - , + + + + + + + , ); }; diff --git a/app/javascript/mastodon/features/alt_text_modal/index.tsx b/app/javascript/mastodon/features/alt_text_modal/index.tsx index fafd460947..3be514e1a4 100644 --- a/app/javascript/mastodon/features/alt_text_modal/index.tsx +++ b/app/javascript/mastodon/features/alt_text_modal/index.tsx @@ -22,6 +22,7 @@ import { changeUploadCompose } from 'mastodon/actions/compose_typed'; import { Button } from 'mastodon/components/button'; import { GIFV } from 'mastodon/components/gifv'; import { LoadingIndicator } from 'mastodon/components/loading_indicator'; +import { NavigationFocusTarget } from 'mastodon/components/navigation_focus_target'; import { Skeleton } from 'mastodon/components/skeleton'; import { Audio } from 'mastodon/features/audio'; import { CharacterCounter } from 'mastodon/features/compose/components/character_counter'; @@ -412,12 +413,15 @@ export const AltTextModal = forwardRef>( )} - + - +