From c270634565a3dcf311857bfac6d59c27ac67e9be Mon Sep 17 00:00:00 2001 From: Echo Date: Thu, 30 Apr 2026 16:16:30 +0200 Subject: [PATCH] Profile editing: Control follower/following list visibility (#38845) --- .../mastodon/features/account_edit/index.tsx | 4 +-- .../modals/profile_display_modal.tsx | 22 +++++++++++- .../features/followers/components/header.tsx | 34 +++++++++++++++++++ .../features/followers/styles.module.scss | 6 +++- app/javascript/mastodon/locales/en.json | 7 ++-- app/views/settings/privacy/show.html.haml | 3 -- 6 files changed, 67 insertions(+), 9 deletions(-) diff --git a/app/javascript/mastodon/features/account_edit/index.tsx b/app/javascript/mastodon/features/account_edit/index.tsx index d3a3c96707..0199c3efa4 100644 --- a/app/javascript/mastodon/features/account_edit/index.tsx +++ b/app/javascript/mastodon/features/account_edit/index.tsx @@ -107,11 +107,11 @@ export const messages = defineMessages({ }, profileTabTitle: { id: 'account_edit.profile_tab.title', - defaultMessage: 'Profile tab settings', + defaultMessage: 'Profile display settings', }, profileTabSubtitle: { id: 'account_edit.profile_tab.subtitle', - defaultMessage: 'Customize the tabs on your profile and what they display.', + defaultMessage: 'Customize how your profile is displayed.', }, advancedSettingsTitle: { id: 'account_edit.advanced_settings.title', diff --git a/app/javascript/mastodon/features/account_edit/modals/profile_display_modal.tsx b/app/javascript/mastodon/features/account_edit/modals/profile_display_modal.tsx index dc2d961c69..d832fe00e3 100644 --- a/app/javascript/mastodon/features/account_edit/modals/profile_display_modal.tsx +++ b/app/javascript/mastodon/features/account_edit/modals/profile_display_modal.tsx @@ -27,7 +27,8 @@ export const ProfileDisplayModal: FC = ({ onClose }) => { const handleToggleChange: ChangeEventHandler = useCallback( (event) => { const { name, checked } = event.target; - void dispatch(patchProfile({ [name]: checked })); + const targetChecked = name === 'hide_collections' ? !checked : checked; + void dispatch(patchProfile({ [name]: targetChecked })); }, [dispatch], ); @@ -101,6 +102,25 @@ export const ProfileDisplayModal: FC = ({ onClose }) => { /> } /> + + + } + hint={ + + } + /> = ({ accountId, total, titleText }) => { const intl = useIntl(); const account = useAccount(accountId); + const currentId = useCurrentAccountId(); return ( <>

@@ -31,6 +36,35 @@ export const AccountListHeader: FC<{ />

)} + {accountId === currentId && account?.hide_collections && ( + + {chunks}, + page: ( + + ), + modal: ( + + ), + field: ( + + ), + }} + /> + + )} ); }; diff --git a/app/javascript/mastodon/features/followers/styles.module.scss b/app/javascript/mastodon/features/followers/styles.module.scss index f58b345bec..6294044c3b 100644 --- a/app/javascript/mastodon/features/followers/styles.module.scss +++ b/app/javascript/mastodon/features/followers/styles.module.scss @@ -4,8 +4,12 @@ margin: 20px 16px 10px; } +.subtitle, +.callout { + margin: 10px 16px; +} + .subtitle { font-size: 14px; color: var(--color-text-secondary); - margin: 10px 16px; } diff --git a/app/javascript/mastodon/locales/en.json b/app/javascript/mastodon/locales/en.json index b2a77f0d82..3fd338e639 100644 --- a/app/javascript/mastodon/locales/en.json +++ b/app/javascript/mastodon/locales/en.json @@ -224,8 +224,10 @@ "account_edit.profile_tab.show_media.title": "Show ‘Media’ tab", "account_edit.profile_tab.show_media_replies.description": "When enabled, Media tab shows both your posts and replies to other people’s posts.", "account_edit.profile_tab.show_media_replies.title": "Include replies on ‘Media’ tab", - "account_edit.profile_tab.subtitle": "Customize the tabs on your profile and what they display.", - "account_edit.profile_tab.title": "Profile tab settings", + "account_edit.profile_tab.show_relations.description": "Shows accounts you follow and followers to other users in your profile. People will still be able to see if you are following them.", + "account_edit.profile_tab.show_relations.title": "Show ‘Followers’ and ‘Following’", + "account_edit.profile_tab.subtitle": "Customize how your profile is displayed.", + "account_edit.profile_tab.title": "Profile display settings", "account_edit.save": "Save", "account_edit.upload_modal.back": "Back", "account_edit.upload_modal.done": "Done", @@ -253,6 +255,7 @@ "account_edit_tags.search_placeholder": "Enter a hashtag…", "account_edit_tags.suggestions": "Suggestions:", "account_edit_tags.tag_status_count": "{count, plural, one {# post} other {# posts}}", + "account_list.hidden_notice": "This is only visible to you. To show this list to others, go to {page} > {modal} > {field}.", "account_list.total": "{total, plural, one {# account} other {# accounts}}", "account_note.placeholder": "Click to add note", "admin.dashboard.daily_retention": "User retention rate by day after sign-up", diff --git a/app/views/settings/privacy/show.html.haml b/app/views/settings/privacy/show.html.haml index 282f63f19e..47880f1f6c 100644 --- a/app/views/settings/privacy/show.html.haml +++ b/app/views/settings/privacy/show.html.haml @@ -34,9 +34,6 @@ %p.lead= t('privacy.privacy_hint_html') - .fields-group - = f.input :show_collections, as: :boolean, wrapper: :with_label - = f.simple_fields_for :settings, current_user.settings do |ff| .fields-group = ff.input :show_application, wrapper: :with_label