From a56db5e350c204874508e9e5aee37ecdbb3550e5 Mon Sep 17 00:00:00 2001 From: diondiondion Date: Tue, 9 Jun 2026 19:48:20 +0200 Subject: [PATCH] Wrap page headings with NavigationFocusTarget --- .../mastodon/components/column_header.tsx | 8 ++++++-- app/javascript/mastodon/features/about/index.jsx | 7 ++++++- .../account_timeline/modals/field_modal.tsx | 15 +++++++++------ .../features/closed_registrations_modal/index.jsx | 9 ++++++--- .../collections/components/share_modal.tsx | 5 +++-- .../mastodon/features/collections/index.tsx | 5 ++++- .../mastodon/features/interaction_modal/index.tsx | 5 +++-- .../confirmation_modals/confirmation_modal.tsx | 5 ++++- app/javascript/styles/mastodon/components.scss | 6 ++++++ 9 files changed, 47 insertions(+), 18 deletions(-) diff --git a/app/javascript/mastodon/components/column_header.tsx b/app/javascript/mastodon/components/column_header.tsx index 36ed239a477..410e5ce016c 100644 --- a/app/javascript/mastodon/components/column_header.tsx +++ b/app/javascript/mastodon/components/column_header.tsx @@ -19,6 +19,7 @@ import { useIdentity } from 'mastodon/identity_context'; import { useColumnIndexContext } from '../features/ui/components/columns_area'; import { getColumnSkipLinkId } from '../features/ui/components/skip_links'; +import { NavigationFocusTarget } from './navigation_focus_target'; import { useAppHistory } from './router'; export const messages = defineMessages({ @@ -285,7 +286,10 @@ export const ColumnHeader: React.FC = ({
{backButton} {hasTitle && ( -

+ {onClick ? (

+ )}
diff --git a/app/javascript/mastodon/features/about/index.jsx b/app/javascript/mastodon/features/about/index.jsx index 83f5bf60258..d60ef9e6107 100644 --- a/app/javascript/mastodon/features/about/index.jsx +++ b/app/javascript/mastodon/features/about/index.jsx @@ -8,10 +8,13 @@ import { Helmet } from '@unhead/react/helmet'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { connect } from 'react-redux'; +import { domain } from 'mastodon/initial_state'; + import { injectIntl } from '@/mastodon/components/intl'; import { fetchServer, fetchExtendedDescription, fetchDomainBlocks } from 'mastodon/actions/server'; import { Account } from 'mastodon/components/account'; import Column from 'mastodon/components/column'; +import { NavigationFocusTarget } from 'mastodon/components/navigation_focus_target'; import { ServerHeroImage } from 'mastodon/components/server_hero_image'; import { Skeleton } from 'mastodon/components/skeleton'; import { LinkFooter} from 'mastodon/features/ui/components/link_footer'; @@ -91,7 +94,9 @@ class About extends PureComponent { srcSet={Object.keys(server.item?.thumbnail.versions ?? {}).map((key) => `${server.item?.thumbnail.versions && server.item.thumbnail.versions[key]} ${key.replace('@', '')}`).join(', ')} className='about__header__hero' /> -

{isLoading ? : server.domain}

+ + {isLoading ? : domain} +

Mastodon }} />

diff --git a/app/javascript/mastodon/features/account_timeline/modals/field_modal.tsx b/app/javascript/mastodon/features/account_timeline/modals/field_modal.tsx index baf0c70f762..abb0a28ee33 100644 --- a/app/javascript/mastodon/features/account_timeline/modals/field_modal.tsx +++ b/app/javascript/mastodon/features/account_timeline/modals/field_modal.tsx @@ -10,6 +10,7 @@ import { ModalShellActions, ModalShellBody, } from '@/mastodon/components/modal_shell'; +import { NavigationFocusTarget } from '@/mastodon/components/navigation_focus_target'; import { useFieldHtml } from '../hooks/useFieldHtml'; @@ -24,12 +25,14 @@ export const AccountFieldModal: FC<{ return ( - + + + ({ message: state.getIn(['server', 'server', 'item', 'registrations', 'message']), @@ -42,7 +43,9 @@ class ClosedRegistrationsModal extends ImmutablePureComponent { return (
-

+ + +

-

+

{closedRegistrationsMessage}
-

+

-

+ {isNew ? ( )} -

+
-

{pageTitleHtml}

+ + {pageTitleHtml} + {intl.formatMessage(createdByTabMessage, { diff --git a/app/javascript/mastodon/features/interaction_modal/index.tsx b/app/javascript/mastodon/features/interaction_modal/index.tsx index ef1d3e1111b..128fb3ff5e1 100644 --- a/app/javascript/mastodon/features/interaction_modal/index.tsx +++ b/app/javascript/mastodon/features/interaction_modal/index.tsx @@ -8,6 +8,7 @@ import { escapeRegExp } from 'lodash'; import { useDebouncedCallback } from 'use-debounce'; import { DisplayName } from '@/mastodon/components/display_name'; +import { NavigationFocusTarget } from '@/mastodon/components/navigation_focus_target'; import { openModal, closeModal } from 'mastodon/actions/modal'; import { apiRequest } from 'mastodon/api'; import { Button } from 'mastodon/components/button'; @@ -474,12 +475,12 @@ const InteractionModal: React.FC<{ return (
-

+ -

+

{intent === 'follow' ? ( -

{title}

+ + {title} + {message &&

{message}

} {extraContent ?? children} diff --git a/app/javascript/styles/mastodon/components.scss b/app/javascript/styles/mastodon/components.scss index cb2e6e9eb21..c8e7cb1fd92 100644 --- a/app/javascript/styles/mastodon/components.scss +++ b/app/javascript/styles/mastodon/components.scss @@ -9141,6 +9141,8 @@ noscript { padding-bottom: 32px; } + h1, + h2, h3 { font-size: 22px; line-height: 33px; @@ -9171,6 +9173,8 @@ noscript { &__lead { margin-bottom: 20px; + h1, + h2, h3 { margin-bottom: 15px; } @@ -9246,6 +9250,8 @@ noscript { flex: 1; box-sizing: border-box; + h1, + h2, h3 { margin-bottom: 20px; }