A platform for community discussion. Free, open, simple.
UX: Don't hide new navigation item in experimental new new view (#26094)
Alan Guo Xiang Tan26df6dfc5f87
diff --git a/app/assets/javascripts/discourse/app/components/navigation-item.js b/app/assets/javascripts/discourse/app/components/navigation-item.jsindex 15c20e55e95..6ef9379c960 100644--- a/app/assets/javascripts/discourse/app/components/navigation-item.js+++ b/app/assets/javascripts/discourse/app/components/navigation-item.js@@ -32,14 +32,14 @@ export default Component.extend({return contentFilterType === filterType;},- @discourseComputed("content.count")- isHidden(count) {+ @discourseComputed("content.count", "content.name")+ isHidden(count, name) {return (!this.active &&this.currentUser &&+ !this.currentUser.new_new_view_enabled &&this.currentUser.trust_level > 0 &&- (this.content.get("name") === "new" ||- this.content.get("name") === "unread") &&+ (name === "new" || name === "unread") &&count < 1);},diff --git a/spec/system/dismissing_new_spec.rb b/spec/system/dismissing_new_spec.rbindex 4fdc10d101e..898e8ad10a0 100644--- a/spec/system/dismissing_new_spec.rb+++ b/spec/system/dismissing_new_spec.rb@@ -110,6 +110,10 @@ RSpec.describe "Dismissing New", type: :system doexpect(topic_list_controls).to have_new(count: 0)using_session(:tab_1) { expect(topic_list_controls).to have_new(count: 0) }++ topic_list_controls.click_latest++ expect(topic_list_controls).to have_new(count: 0)endit "displays confirmation modal with preselected options" dodiff --git a/spec/system/page_objects/components/topic_list_controls.rb b/spec/system/page_objects/components/topic_list_controls.rbindex b5daea5b614..d5066343eac 100644--- a/spec/system/page_objects/components/topic_list_controls.rb+++ b/spec/system/page_objects/components/topic_list_controls.rb@@ -36,6 +36,11 @@ module PageObjectsclick_button("dismiss-new-top")selfend++ def click_latest+ find(".nav-item_latest").click+ self+ endendendend