UX: Don't hide new navigation item in experimental new new view (#26094)

Why this change?

Before this change, the new navigation item in the topic list will be
hidden when there are no new or unread topics for the user. We have
started to find this behaviour confusing UX wise so we decided to stop
hiding it.
This commit is contained in:
Alan Guo Xiang Tan 2024-03-08 09:26:09 +08:00 committed by GitHub
parent 05653e11cb
commit 26df6dfc5f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 4 deletions

View File

@ -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
);
},

View File

@ -110,6 +110,10 @@ RSpec.describe "Dismissing New", type: :system do
expect(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)
end
it "displays confirmation modal with preselected options" do

View File

@ -36,6 +36,11 @@ module PageObjects
click_button("dismiss-new-top")
self
end
def click_latest
find(".nav-item_latest").click
self
end
end
end
end