Skip to content

A platform for community discussion. Free, open, simple.

UX: Enable new notifications menu by default (#21060)

David Taylor121d5c6c6a38
diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml
index 1f9d41e0bb3..6459ed17605 100644
--- a/config/locales/server.en.yml
+++ b/config/locales/server.en.yml
@@ -2406,7 +2406,7 @@ en:
navigation_menu: "Determine which navigation menu to use. Sidebar and header navigation are customizable by users. Legacy option is available for backward compatibility."
default_sidebar_categories: "Selected categories will be displayed under Sidebar's Categories section by default."
default_sidebar_tags: "Selected tags will be displayed under Sidebar's Tags section by default."
- enable_new_notifications_menu: "Enables the new notifications menu for the legacy navigation menu."
+ enable_new_notifications_menu: "Enables the new notifications menu. Disabling this setting is deprecated. The new notifications menu is always used for non-legacy 'navigation menu' choices. <a href='https://meta.discourse.org/t/260358'>Learn more</a>"
enable_experimental_hashtag_autocomplete: "EXPERIMENTAL: Use the new #hashtag autocompletion system for categories and tags that renders the selected item differently and has improved search"
experimental_new_new_view_groups: "EXPERIMENTAL: Enable a new topics list that combines unread and new topics and make the \"Everything\" link in the sidebar link to it."
enable_custom_sidebar_sections: "EXPERIMENTAL: Enable custom sidebar sections"
@@ -2467,7 +2467,6 @@ en:
discourse_connect_cannot_be_enabled_if_second_factor_enforced: "You cannot enable DiscourseConnect if 2FA is enforced."
delete_rejected_email_after_days: "This setting cannot be set lower than the delete_email_logs_after_days setting or greater than %{max}"
invalid_uncategorized_category_setting: 'The "Uncategorized" category cannot be selected if ''allow uncategorized topics'' is not enabled.'
- enable_new_notifications_menu_not_legacy_navigation_menu: "You must set `navigation_menu` to `legacy` before enabling this setting."
invalid_search_ranking_weights: "Value is invalid for search_ranking_weights site setting. Example: '{0.1,0.2,0.3,1.0}'. Note that maximum value for each weight is 1.0."
placeholder:
diff --git a/config/site_settings.yml b/config/site_settings.yml
index 43466a30c7c..fa1869239d0 100644
--- a/config/site_settings.yml
+++ b/config/site_settings.yml
@@ -2116,8 +2116,7 @@ navigation:
- "default"
- "unread_new"
enable_new_notifications_menu:
- default: false
- validator: "EnableNewNotificationsMenuValidator"
+ default: true
enable_custom_sidebar_sections:
client: true
type: group_list
diff --git a/lib/validators/enable_new_notifications_menu_validator.rb b/lib/validators/enable_new_notifications_menu_validator.rb
deleted file mode 100644
index 30de97d1ba7..00000000000
--- a/lib/validators/enable_new_notifications_menu_validator.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-# frozen_string_literal: true
-
-class EnableNewNotificationsMenuValidator
- def initialize(opts = {})
- end
-
- def valid_value?(value)
- return true if value == "f"
- SiteSetting.navigation_menu == "legacy"
- end
-
- def error_message
- I18n.t("site_settings.errors.enable_new_notifications_menu_not_legacy_navigation_menu")
- end
-end
diff --git a/spec/lib/validators/enable_new_notifications_menu_validator_spec.rb b/spec/lib/validators/enable_new_notifications_menu_validator_spec.rb
deleted file mode 100644
index 309db022d8d..00000000000
--- a/spec/lib/validators/enable_new_notifications_menu_validator_spec.rb
+++ /dev/null
@@ -1,18 +0,0 @@
-# frozen_string_literal: true
-
-RSpec.describe EnableNewNotificationsMenuValidator do
- it "does not allow `enable_new_notifications_menu` site settings to be enabled when `navigation_menu` site settings is not set to `legacy`" do
- SiteSetting.navigation_menu = "sidebar"
-
- expect { SiteSetting.enable_new_notifications_menu = true }.to raise_error(
- Discourse::InvalidParameters,
- /#{I18n.t("site_settings.errors.enable_new_notifications_menu_not_legacy_navigation_menu")}/,
- )
- end
-
- it "allows `enable_new_notifications_menu` site settings to be enabled when `navigation_menu` site settings is set to `legacy`" do
- SiteSetting.navigation_menu = "legacy"
-
- expect { SiteSetting.enable_new_notifications_menu = true }.to_not raise_error
- end
-end
diff --git a/spec/serializers/current_user_serializer_spec.rb b/spec/serializers/current_user_serializer_spec.rb
index b9be21cc7b5..c51737fe41a 100644
--- a/spec/serializers/current_user_serializer_spec.rb
+++ b/spec/serializers/current_user_serializer_spec.rb
@@ -283,8 +283,9 @@ RSpec.describe CurrentUserSerializer do
)
end
- it "isn't included when navigation menu is legacy" do
+ it "isn't included when navigation menu is legacy with old user menu" do
SiteSetting.navigation_menu = "legacy"
+ SiteSetting.enable_new_notifications_menu = false
expect(serializer.as_json[:new_personal_messages_notifications_count]).to be_nil
end