From dd708298a8c885ba53cc5528ad0e9158b58cd9ab Mon Sep 17 00:00:00 2001 From: Claire Date: Tue, 4 Nov 2025 11:37:43 +0100 Subject: [PATCH] Remove option to disable access to local topic feeds for logged-in users (#36703) --- app/javascript/mastodon/initial_state.ts | 2 +- app/models/form/admin_settings.rb | 3 ++- app/views/admin/settings/discovery/show.html.haml | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/javascript/mastodon/initial_state.ts b/app/javascript/mastodon/initial_state.ts index 83c6c35e1..86d36468f 100644 --- a/app/javascript/mastodon/initial_state.ts +++ b/app/javascript/mastodon/initial_state.ts @@ -35,7 +35,7 @@ interface InitialStateMeta { streaming_api_base_url: string; local_live_feed_access: 'public' | 'authenticated' | 'disabled'; remote_live_feed_access: 'public' | 'authenticated' | 'disabled'; - local_topic_feed_access: 'public' | 'authenticated' | 'disabled'; + local_topic_feed_access: 'public' | 'authenticated'; remote_topic_feed_access: 'public' | 'authenticated' | 'disabled'; title: string; show_trends: boolean; diff --git a/app/models/form/admin_settings.rb b/app/models/form/admin_settings.rb index 926995f02..af4ad38ae 100644 --- a/app/models/form/admin_settings.rb +++ b/app/models/form/admin_settings.rb @@ -87,6 +87,7 @@ class Form::AdminSettings DOMAIN_BLOCK_AUDIENCES = %w(disabled users all).freeze REGISTRATION_MODES = %w(open approved none).freeze FEED_ACCESS_MODES = %w(public authenticated disabled).freeze + ALTERNATE_FEED_ACCESS_MODES = %w(public authenticated).freeze LANDING_PAGE = %w(trends about local_feed).freeze attr_accessor(*KEYS) @@ -99,7 +100,7 @@ class Form::AdminSettings validates :show_domain_blocks_rationale, inclusion: { in: DOMAIN_BLOCK_AUDIENCES }, if: -> { defined?(@show_domain_blocks_rationale) } validates :local_live_feed_access, inclusion: { in: FEED_ACCESS_MODES }, if: -> { defined?(@local_live_feed_access) } validates :remote_live_feed_access, inclusion: { in: FEED_ACCESS_MODES }, if: -> { defined?(@remote_live_feed_access) } - validates :local_topic_feed_access, inclusion: { in: FEED_ACCESS_MODES }, if: -> { defined?(@local_topic_feed_access) } + validates :local_topic_feed_access, inclusion: { in: ALTERNATE_FEED_ACCESS_MODES }, if: -> { defined?(@local_topic_feed_access) } validates :remote_topic_feed_access, inclusion: { in: FEED_ACCESS_MODES }, if: -> { defined?(@remote_topic_feed_access) } validates :media_cache_retention_period, :content_cache_retention_period, :backups_retention_period, numericality: { only_integer: true }, allow_blank: true, if: -> { defined?(@media_cache_retention_period) || defined?(@content_cache_retention_period) || defined?(@backups_retention_period) } validates :min_age, numericality: { only_integer: true }, allow_blank: true, if: -> { defined?(@min_age) } diff --git a/app/views/admin/settings/discovery/show.html.haml b/app/views/admin/settings/discovery/show.html.haml index 1272419c3..04c242597 100644 --- a/app/views/admin/settings/discovery/show.html.haml +++ b/app/views/admin/settings/discovery/show.html.haml @@ -43,7 +43,7 @@ .fields-row .fields-row__column.fields-row__column-6.fields-group = f.input :local_topic_feed_access, - collection: f.object.class::FEED_ACCESS_MODES, + collection: f.object.class::ALTERNATE_FEED_ACCESS_MODES, include_blank: false, label_method: ->(mode) { I18n.t("admin.settings.feed_access.modes.#{mode}") }, wrapper: :with_label