From fe2ea1342c0cfa6542985944fa868da506aa48dc Mon Sep 17 00:00:00 2001 From: diondiondion Date: Fri, 25 Sep 2026 14:59:28 +0000 Subject: [PATCH] Redesign: Fix column headers on profile subpages (#40704) --- .../features/account_featured/index.tsx | 22 +++++++++++++++++-- .../features/account_gallery/index.tsx | 14 +++++++++++- .../features/followers/components/header.tsx | 13 ++++++----- .../features/followers/components/list.tsx | 10 ++++++++- .../mastodon/features/followers/index.tsx | 7 ++++++ .../mastodon/features/following/index.tsx | 7 ++++++ 6 files changed, 64 insertions(+), 9 deletions(-) diff --git a/app/javascript/mastodon/features/account_featured/index.tsx b/app/javascript/mastodon/features/account_featured/index.tsx index b63df19fa19..f2859eb5291 100644 --- a/app/javascript/mastodon/features/account_featured/index.tsx +++ b/app/javascript/mastodon/features/account_featured/index.tsx @@ -11,6 +11,8 @@ import { AccountHeader } from '@/mastodon/components/account_header'; import { AccountListItem } from '@/mastodon/components/account_list_item'; import { Column } from '@/mastodon/components/column'; import { ColumnBackButton } from '@/mastodon/components/column/back_button'; +import { ColumnHeader } from '@/mastodon/components/column_header'; +import { DisplayNameSimple } from '@/mastodon/components/display_name/simple'; import { LoadingIndicator } from '@/mastodon/components/loading_indicator'; import { RemoteHint } from '@/mastodon/components/remote_hint'; import { @@ -26,6 +28,7 @@ import { useAccountId } from '@/mastodon/hooks/useAccountId'; import { useAccountVisibility } from '@/mastodon/hooks/useAccountVisibility'; import { me } from '@/mastodon/initial_state'; import { useAppDispatch, useAppSelector } from '@/mastodon/store'; +import { isRedesignEnabled } from '@/mastodon/utils/environment'; import AddIcon from '@/material-icons/400-24px/add.svg?react'; import { CollectionListItem } from '../collections/components/collection_list_item'; @@ -129,7 +132,14 @@ const AccountFeatured: React.FC<{ multiColumn: boolean }> = ({ return ( - + {isRedesignEnabled() ? ( + } + /> + ) : ( + + )} {accountId && ( @@ -218,9 +228,17 @@ const AccountFeaturedWrapper = ({ children, accountId, }: React.PropsWithChildren<{ accountId?: string }>) => { + const account = useAccount(accountId); return ( - + {isRedesignEnabled() ? ( + } + /> + ) : ( + + )}
{accountId && } {children} diff --git a/app/javascript/mastodon/features/account_gallery/index.tsx b/app/javascript/mastodon/features/account_gallery/index.tsx index 572ea7be822..fb853b37009 100644 --- a/app/javascript/mastodon/features/account_gallery/index.tsx +++ b/app/javascript/mastodon/features/account_gallery/index.tsx @@ -9,10 +9,13 @@ import { expandAccountMediaTimeline } from '@/mastodon/actions/timelines'; import { AccountHeader } from '@/mastodon/components/account_header'; import { Column } from '@/mastodon/components/column'; import { ColumnBackButton } from '@/mastodon/components/column/back_button'; +import { ColumnHeader } from '@/mastodon/components/column_header'; +import { DisplayNameSimple } from '@/mastodon/components/display_name/simple'; import { LimitedAccountHint } from '@/mastodon/components/limited_account_hint'; import { RemoteHint } from '@/mastodon/components/remote_hint'; import ScrollableList from '@/mastodon/components/scrollable_list'; import { BundleColumnError } from '@/mastodon/features/ui/components/bundle_column_error'; +import { useAccount } from '@/mastodon/hooks/useAccount'; import { useAccountId } from '@/mastodon/hooks/useAccountId'; import { useAccountVisibility } from '@/mastodon/hooks/useAccountVisibility'; import type { MediaAttachment } from '@/mastodon/models/media_attachment'; @@ -21,6 +24,7 @@ import { useAppDispatch, createAppSelector, } from '@/mastodon/store'; +import { isRedesignEnabled } from '@/mastodon/utils/environment'; import { MediaItem } from './components/media_item'; @@ -96,6 +100,7 @@ export const AccountGallery: React.FC<{ }> = ({ multiColumn }) => { const dispatch = useAppDispatch(); const accountId = useAccountId(); + const account = useAccount(accountId); const { isLoading, items: attachments, @@ -211,7 +216,14 @@ export const AccountGallery: React.FC<{ return ( - + {isRedesignEnabled() ? ( + } + /> + ) : ( + + )} -

- {intl.formatMessage(titleText, { - name: , - })} -

+ {!isRedesignEnabled() && ( +

+ {intl.formatMessage(titleText, { + name: , + })} +

+ )} {!!total && (

= ({ accountId, append, emptyMessage, + title, header, footer, list, @@ -97,7 +101,11 @@ export const AccountList: FC = ({ return ( - + {isRedesignEnabled() ? ( + + ) : ( + + )} { return ( }} + /> + } accountId={accountId} header={ accountId && ( diff --git a/app/javascript/mastodon/features/following/index.tsx b/app/javascript/mastodon/features/following/index.tsx index 6f213fbe6b1..27e1d8e01fb 100644 --- a/app/javascript/mastodon/features/following/index.tsx +++ b/app/javascript/mastodon/features/following/index.tsx @@ -6,6 +6,7 @@ import { defineMessage, FormattedMessage } from 'react-intl'; import { useDebouncedCallback } from 'use-debounce'; import { expandFollowing, fetchFollowing } from '@/mastodon/actions/accounts'; +import { DisplayNameSimple } from '@/mastodon/components/display_name/simple'; import { useAccount } from '@/mastodon/hooks/useAccount'; import { useAccountId } from '@/mastodon/hooks/useAccountId'; import { useRelationship } from '@/mastodon/hooks/useRelationship'; @@ -73,6 +74,12 @@ const Followers: FC = () => { const domain = account?.acct.split('@')[1]; return ( }} + /> + } accountId={accountId} append={domain && } emptyMessage={}