DEV: Include unread topics in New topic lists and link to it in sidebar (#20432)

This commit introduces a few experimental changes to the New topics list and "Everything" link in the sidebar:

1. Make the New topics list include unread topics
2. Make the Everything section in the sidebar link to the New topics list (`/new`)
3. Remove "unread" or "new" text next to the count and keep the count
4. The count is a sum of new and unread topics counts

All of these of changes are behind an off-by-default feature flag. I've not written extensive tests for these changes because they're highly experimental.

Internal topic: t/77234.
This commit is contained in:
Osama Sayegh
2023-02-27 15:11:01 +03:00
committed by GitHub
parent badd40090f
commit a509441148
9 changed files with 70 additions and 12 deletions

View File

@ -267,7 +267,11 @@ class TopicQuery
end
def list_new
create_list(:new, { unordered: true }, new_results)
if @user&.new_new_view_enabled?
create_list(:new, { unordered: true }, new_and_unread_results)
else
create_list(:new, { unordered: true }, new_results)
end
end
def list_unread