Skip to content

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

DEV: Update nested replies default site setting values (#41229)

Mark VanLandingham6c9a8bd4b621
diff --git a/config/site_settings.yml b/config/site_settings.yml
index 4bf84bfd300..04e092fa51b 100644
--- a/config/site_settings.yml
+++ b/config/site_settings.yml
@@ -1939,7 +1939,7 @@ nested_replies:
- "nested_replies_enabled"
depends_behavior: "hidden"
nested_replies_max_depth:
- default: 10
+ default: 3
client: true
type: integer
min: 1
@@ -1949,7 +1949,7 @@ nested_replies:
- "nested_replies_enabled"
depends_behavior: "hidden"
nested_replies_cap_nesting_depth:
- default: false
+ default: true
client: true
area: "posts_and_topics"
depends_on:
diff --git a/spec/lib/nested_replies/nested_replies_n_plus_one_spec.rb b/spec/lib/nested_replies/nested_replies_n_plus_one_spec.rb
index 7fd8602d1e9..7fff8bcb364 100644
--- a/spec/lib/nested_replies/nested_replies_n_plus_one_spec.rb
+++ b/spec/lib/nested_replies/nested_replies_n_plus_one_spec.rb
@@ -243,6 +243,7 @@ RSpec.describe "Nested replies N+1 elimination", type: :request do
end
it "returns the correct ancestor chain" do
+ SiteSetting.nested_replies_max_depth = 5
chain = create_reply_chain(depth: 5)
sign_in(admin)
diff --git a/spec/system/nested_context_view_spec.rb b/spec/system/nested_context_view_spec.rb
index a3a69d35aca..82d59dcbafe 100644
--- a/spec/system/nested_context_view_spec.rb
+++ b/spec/system/nested_context_view_spec.rb
@@ -175,6 +175,8 @@ RSpec.describe "Nested context view" do
end
describe "in-route navigation between context views" do
+ before { SiteSetting.nested_replies_max_depth = 10 }
+
# Navigating context A → context B in-app (without a full page reload)
# keeps the same controller/component mounted. When the two chains
# share a root ancestor, the chain root <NestedPost> would be reused
diff --git a/spec/system/nested_depth_spec.rb b/spec/system/nested_depth_spec.rb
index 72f7cd5e32a..e6f5590d49d 100644
--- a/spec/system/nested_depth_spec.rb
+++ b/spec/system/nested_depth_spec.rb
@@ -18,7 +18,7 @@ RSpec.describe "Nested view depth and nesting" do
end
describe "max depth setting" do
- it "respects a low max depth" do
+ it "uses capped nesting by default at low max depth" do
SiteSetting.nested_replies_max_depth = 2
chain = create_reply_chain(depth: 4)
@@ -27,7 +27,13 @@ RSpec.describe "Nested view depth and nesting" do
expect(nested_view).to have_post_at_depth(chain[0], depth: 0)
expect(nested_view).to have_post_at_depth(chain[1], depth: 1)
expect(nested_view).to have_post_at_depth(chain[2], depth: 2)
- expect(nested_view).to have_continue_thread_for(chain[2])
+ expect(nested_view).to have_no_post(chain[3])
+ expect(nested_view).to have_no_continue_thread_for(chain[2])
+ expect(nested_view).to have_load_more_children_for(chain[1])
+
+ nested_view.click_load_more_children(chain[1])
+
+ expect(nested_view).to have_post_at_depth(chain[3], depth: 2)
end
it "allows deeper nesting with higher max depth" do
diff --git a/spec/system/nested_view_spec.rb b/spec/system/nested_view_spec.rb
index 35634b57417..9fe77e970fb 100644
--- a/spec/system/nested_view_spec.rb
+++ b/spec/system/nested_view_spec.rb
@@ -300,6 +300,8 @@ RSpec.describe "Nested view" do
end
describe "mobile focused branch navigation" do
+ before { SiteSetting.nested_replies_max_depth = 10 }
+
fab!(:root_reply) do
Fabricate(:post, topic: topic, user: Fabricate(:user), raw: "Post with children")
end
diff --git a/spec/system/page_objects/pages/nested_view.rb b/spec/system/page_objects/pages/nested_view.rb
index b03d3b0785a..32f75ce9692 100644
--- a/spec/system/page_objects/pages/nested_view.rb
+++ b/spec/system/page_objects/pages/nested_view.rb
@@ -140,6 +140,15 @@ module PageObjects
has_no_css?("[data-post-number='#{post.post_number}'] .nested-post__expand-replies")
end
+ def has_load_more_children_for?(post)
+ has_css?(
+ wrapper_selector(
+ post,
+ "> .nested-post__main > .nested-post-children .nested-post-children__load-more",
+ ),
+ )
+ end
+
def has_no_show_replies_button_for?(post)
has_no_css?("[data-post-number='#{post.post_number}'] .post-action-menu__show-replies")
end
@@ -370,6 +379,16 @@ module PageObjects
self
end
+ def click_load_more_children(post)
+ find(
+ wrapper_selector(
+ post,
+ "> .nested-post__main > .nested-post-children .nested-post-children__load-more",
+ ),
+ ).click
+ self
+ end
+
def trigger_replies_toggle(post)
page.evaluate_script(<<~JS)
(() => {