From 99b72f60ad4ef7f845646767105aa501cd563291 Mon Sep 17 00:00:00 2001 From: Claire Date: Mon, 18 May 2026 14:11:14 +0200 Subject: [PATCH] Nudge users to turn on `discoverable` when viewing the empty list of collections they are in (#39029) Co-authored-by: diondiondion --- .../empty_state/empty_state.module.scss | 4 ++ .../collections/overview/featuring_you.tsx | 49 +++++++++++++++---- app/javascript/mastodon/locales/en.json | 1 + 3 files changed, 44 insertions(+), 10 deletions(-) diff --git a/app/javascript/mastodon/components/empty_state/empty_state.module.scss b/app/javascript/mastodon/components/empty_state/empty_state.module.scss index 96aea81d1c..64d9a4e584 100644 --- a/app/javascript/mastodon/components/empty_state/empty_state.module.scss +++ b/app/javascript/mastodon/components/empty_state/empty_state.module.scss @@ -35,6 +35,10 @@ color: var(--color-text-secondary); text-wrap: pretty; } + + a { + color: var(--color-text-status-links); + } } [data-color-scheme='dark'] .defaultImage { diff --git a/app/javascript/mastodon/features/collections/overview/featuring_you.tsx b/app/javascript/mastodon/features/collections/overview/featuring_you.tsx index 3fb93bbfc9..c521fd2bdc 100644 --- a/app/javascript/mastodon/features/collections/overview/featuring_you.tsx +++ b/app/javascript/mastodon/features/collections/overview/featuring_you.tsx @@ -2,6 +2,7 @@ import { useEffect } from 'react'; import { FormattedMessage } from 'react-intl'; +import { useAccount } from '@/mastodon/hooks/useAccount'; import { EmptyState } from 'mastodon/components/empty_state'; import { LoadingIndicator } from 'mastodon/components/loading_indicator'; import { ItemList } from 'mastodon/components/scrollable_list/components'; @@ -34,6 +35,7 @@ function useCollectionsFeaturing(accountId: string | null | undefined) { export const CollectionsFeaturingYou: React.FC = () => { const accountId = useAccountId(); + const account = useAccount(accountId); const { collections, status } = useCollectionsFeaturing(accountId); @@ -46,16 +48,43 @@ export const CollectionsFeaturingYou: React.FC = () => { } if (collections.length === 0) { - return ( - - } - /> - ); + if (account?.discoverable) { + return ( + + } + /> + ); + } else { + return ( + + +
+ ( + + {chunks} + + ), + }} + /> + + } + /> + ); + } } return ( diff --git a/app/javascript/mastodon/locales/en.json b/app/javascript/mastodon/locales/en.json index e17abd2ad2..10bd852dae 100644 --- a/app/javascript/mastodon/locales/en.json +++ b/app/javascript/mastodon/locales/en.json @@ -636,6 +636,7 @@ "empty_column.blocks": "You haven't blocked any users yet.", "empty_column.bookmarked_statuses": "You don't have any bookmarked posts yet. When you bookmark one, it will show up here.", "empty_column.collections.featured_in": "You have not been added to any collections yet.", + "empty_column.collections.featured_in_undiscoverable": "In order for people to add you to collections, you need to allow featuring in discovery experiences from Preferences > Privacy and reach", "empty_column.community": "The local timeline is empty. Write something publicly to get the ball rolling!", "empty_column.direct": "You don't have any private mentions yet. When you send or receive one, it will show up here.", "empty_column.disabled_feed": "This feed has been disabled by your server administrators.",