Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
left_sidebar: Add navigation option to go to top unread topic.
Rohan Gudimetlaa3e7ef8e7192
diff --git a/api_docs/changelog.md b/api_docs/changelog.mdindex f9bca3ce654..b08520cd6f1 100644--- a/api_docs/changelog.md+++ b/api_docs/changelog.md@@ -20,6 +20,14 @@ format used by the Zulip server that they are interacting with.## Changes in Zulip 11.0+**Feature level 401**++* [`POST /register`](/api/register-queue), [`PATCH+ /settings`](/api/update-settings), [`PATCH+ /realm/user_settings_defaults`](/api/update-realm-user-settings-defaults):+ Added new option in user setting `web_channel_default_view`, to navigate+ to top unread topic in channel.+**Feature level 400*** [Markdown message formatting](/api/message-formatting#links-to-channels-topics-and-messages):diff --git a/api_docs/unmerged.d/ZF-da8af9.md b/api_docs/unmerged.d/ZF-da8af9.mdnew file mode 100644index 00000000000..e69de29bb2ddiff --git a/help/include/configure-channel-links.md b/help/include/configure-channel-links.mdindex 06348e66cf3..ca89a12c60e 100644--- a/help/include/configure-channel-links.md+++ b/help/include/configure-channel-links.md@@ -1,6 +1,6 @@You can configure whether channel links in the [leftsidebar](/help/left-sidebar) go to the channel feed, a list of topics in the-channel, or to the top topic.+channel, the top topic, or the top unread topic.{start_tabs}diff --git a/version.py b/version.pyindex cc4b4977703..1bd04e158d9 100644--- a/version.py+++ b/version.py@@ -34,7 +34,7 @@ DESKTOP_WARNING_VERSION = "5.9.3"# new level means in api_docs/changelog.md, as well as "**Changes**"# entries in the endpoint's documentation in `zulip.yaml`.-API_FEATURE_LEVEL = 400+API_FEATURE_LEVEL = 401# Bump the minor PROVISION_VERSION to indicate that folks should provision# only when going from an old version of the code to a newer version. Bumpdiff --git a/web/src/settings_config.ts b/web/src/settings_config.tsindex b36404c1c87..75f4f2669e2 100644--- a/web/src/settings_config.ts+++ b/web/src/settings_config.ts@@ -67,6 +67,10 @@ export const web_channel_default_view_values = {code: 1,description: $t({defaultMessage: "Top topic in the channel"}),},+ top_unread_topic_in_channel: {+ code: 4,+ description: $t({defaultMessage: "Top unread topic in the channel"}),+ },list_of_topics: {code: 3,description: $t({defaultMessage: "List of topics"}),diff --git a/web/src/stream_list.ts b/web/src/stream_list.tsindex 32d418f3739..25a0d86c2e1 100644--- a/web/src/stream_list.ts+++ b/web/src/stream_list.ts@@ -38,6 +38,7 @@ import * as ui_util from "./ui_util.ts";import * as unread from "./unread.ts";import type {FullUnreadCountsData, StreamCountInfo} from "./unread.ts";import {user_settings} from "./user_settings.ts";+import * as user_topics from "./user_topics.ts";let pending_stream_list_rerender = false;let zoomed_in = false;@@ -944,7 +945,27 @@ export function set_event_handlers({false,(topic_names: string[]) => topic_names,);- const topic_item = topic_list_info.items[0];+ // This initial value handles both the+ // top_topic_in_channel mode as well as the+ // top_unread_topic_in_channel fallback when there are no+ // (unmuted) unreads in the channel.+ let topic_item = topic_list_info.items[0];++ if (+ user_settings.web_channel_default_view ===+ web_channel_default_view_values.top_unread_topic_in_channel.code+ ) {+ for (const topic_list_item of topic_list_info.items) {+ if (+ unread.topic_has_any_unread(stream_id, topic_list_item.topic_name) &&+ !user_topics.is_topic_muted(stream_id, topic_list_item.topic_name)+ ) {+ topic_item = topic_list_item;+ break;+ }+ }+ }+if (topic_item !== undefined) {const destination_url = hash_util.by_channel_topic_permalink(stream_id,diff --git a/zerver/models/users.py b/zerver/models/users.pyindex 74e5389fd05..585d6e6a0a5 100644--- a/zerver/models/users.py+++ b/zerver/models/users.py@@ -134,11 +134,13 @@ class UserBaseSettings(models.Model):WEB_CHANNEL_DEFAULT_VIEW_FIRST_TOPIC = 1WEB_CHANNEL_DEFAULT_VIEW_CHANNEL_FEED = 2WEB_CHANNEL_DEFAULT_VIEW_TOPIC_LIST = 3+ WEB_CHANNEL_DEFAULT_VIEW_TOP_UNREAD = 4WEB_CHANNEL_DEFAULT_VIEW_CHOICES = [WEB_CHANNEL_DEFAULT_VIEW_FIRST_TOPIC,WEB_CHANNEL_DEFAULT_VIEW_TOPIC_LIST,WEB_CHANNEL_DEFAULT_VIEW_CHANNEL_FEED,+ WEB_CHANNEL_DEFAULT_VIEW_TOP_UNREAD,]web_channel_default_view = models.SmallIntegerField(diff --git a/zerver/openapi/zulip.yaml b/zerver/openapi/zulip.yamlindex 95800406fee..b929a62d6d0 100644--- a/zerver/openapi/zulip.yaml+++ b/zerver/openapi/zulip.yaml@@ -13326,9 +13326,12 @@ paths:- 1 - Top topic in the channel- 2 - Channel feed- 3 - List of topics+ - 4 - Top unread topic in channel- **Changes**: The "List of topics" option is new in- Zulip 11.0 (feature level 383).+ **Changes**: The "Top unread topic in channel" is new in Zulip 11.0+ (feature level 401).++ The "List of topics" option is new in Zulip 11.0 (feature level 383).New in Zulip 9.0 (feature level 269). Previously, thiswas not configurable, and every user had the "Channel feed" behavior.@@ -13338,6 +13341,7 @@ paths:- 1- 2- 3+ - 4example: 1web_font_size_px:description: |@@ -16795,9 +16799,12 @@ paths:- 1 - Top topic in the channel- 2 - Channel feed- 3 - List of topics+ - 4 - Top unread topic in channel++ **Changes**: The "Top unread topic in channel" is new in Zulip 11.0+ (feature level 401).- **Changes**: The "List of topics" option is new in- Zulip 11.0 (feature level 383).+ The "List of topics" option is new in Zulip 11.0 (feature level 383).New in Zulip 9.0 (feature level 269). Previously, thiswas not configurable, and every user had the "Channel feed" behavior.@@ -19598,9 +19605,13 @@ paths:- 1 - Top topic in the channel- 2 - Channel feed- 3 - List of topics+ - 4 - Top unread topic in channel- **Changes**: In Zulip 11.0 (feature level 383), we added a new option- "List of topics" to this setting.+ **Changes**: The "Top unread topic in channel" is new in Zulip 11.0+ (feature level 401).++ In Zulip 11.0 (feature level 383), we added a new option "List of topics"+ to this setting.New in Zulip 9.0 (feature level 269). Previously, thiswas not configurable, and every user had the "Channel feed" behavior.@@ -20775,9 +20786,12 @@ paths:- 1 - Top topic in the channel- 2 - Channel feed- 3 - List of topics+ - 4 - Top unread topic in channel++ **Changes**: The "Top unread topic in channel" is new in Zulip 11.0+ (feature level 401).- **Changes**: The "List of topics" option is new in- Zulip 11.0 (feature level 383).+ The "List of topics" option is new in Zulip 11.0 (feature level 383).New in Zulip 9.0 (feature level 269). Previously, thiswas not configurable, and every user had the "Channel feed" behavior.@@ -20785,6 +20799,7 @@ paths:enum:- 1- 2+ - 4example: 1starred_message_counts:description: |diff --git a/zerver/tests/test_events.py b/zerver/tests/test_events.pyindex 8b3665b1de5..7c8fb1007e9 100644--- a/zerver/tests/test_events.py+++ b/zerver/tests/test_events.py@@ -4764,7 +4764,7 @@ class UserDisplayActionTest(BaseAction):web_home_view=["all_messages", "inbox", "recent_topics"],demote_inactive_streams=[2, 3, 1],web_mark_read_on_scroll_policy=[2, 3, 1],- web_channel_default_view=[2, 1, 3],+ web_channel_default_view=[2, 1, 3, 4],user_list_style=[1, 2, 3],web_animate_image_previews=["always", "on_hover", "never"],web_stream_unreads_count_display_policy=[1, 2, 3],