Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
settings: Rename web_home_view value from "recent_topics" to "recent".
Abhinav Mishrac51d54ee3a1e
diff --git a/api_docs/changelog.md b/api_docs/changelog.mdindex 73b6747822b..06309388adb 100644--- a/api_docs/changelog.md+++ b/api_docs/changelog.md@@ -20,6 +20,13 @@ format used by the Zulip server that they are interacting with.## Changes in Zulip 12.0+**Feature level 454**++- [`PATCH /realm/user_settings_defaults`](/api/update-realm-user-settings-defaults)+ [`POST /register`](/api/register-queue), [`GET /events`](/api/get-events),+ [`PATCH /settings`](/api/update-settings): Changed the `web_home_view`+ value for the recent view to "recent".+**Feature level 453*** [`POST /register`](/api/register-queue): `gif_rating_options`diff --git a/version.py b/version.pyindex fed5865d40a..8b580b51fb6 100644--- a/version.py+++ b/version.py@@ -35,7 +35,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 = 453+API_FEATURE_LEVEL = 454# 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/browser_history.ts b/web/src/browser_history.tsindex a8aee3fc2a2..34ec72993c9 100644--- a/web/src/browser_history.ts+++ b/web/src/browser_history.ts@@ -196,9 +196,6 @@ export function get_current_state_show_more_topics(): boolean | undefined {export function get_home_view_hash(): string {let home_view_hash = `#${user_settings.web_home_view}`;- if (home_view_hash === "#recent_topics") {- home_view_hash = "#recent";- }if (home_view_hash === "#all_messages") {home_view_hash = "#feed";diff --git a/web/src/hashchange.ts b/web/src/hashchange.tsindex aca31a03963..a294c36ce54 100644--- a/web/src/hashchange.ts+++ b/web/src/hashchange.ts@@ -129,7 +129,7 @@ function show_home_view(narrow_opts?: message_view.ShowMessageViewOpts): void {// We only allow the primary recommended options for home views// rendered without a hash.switch (user_settings.web_home_view) {- case "recent_topics": {+ case "recent": {recent_view_ui.show();break;}diff --git a/web/src/left_sidebar_navigation_area.ts b/web/src/left_sidebar_navigation_area.tsindex 7c65b295cf4..ac619a02a8a 100644--- a/web/src/left_sidebar_navigation_area.ts+++ b/web/src/left_sidebar_navigation_area.ts@@ -246,7 +246,7 @@ export function get_view_rows_by_view_name(view: string): JQuery {return $(".top_left_all_messages");}- if (view === settings_config.web_home_view_values.recent_topics.code) {+ if (view === settings_config.web_home_view_values.recent.code) {return $(".top_left_recent_view");}diff --git a/web/src/left_sidebar_navigation_area_popovers.ts b/web/src/left_sidebar_navigation_area_popovers.tsindex cc3d5ddf91f..8261b317844 100644--- a/web/src/left_sidebar_navigation_area_popovers.ts+++ b/web/src/left_sidebar_navigation_area_popovers.ts@@ -261,7 +261,7 @@ export function initialize(): void {assert(instance.reference instanceof HTMLElement);ui_util.show_left_sidebar_menu_icon(instance.reference);popovers.hide_all();- const view_code = settings_config.web_home_view_values.recent_topics.code;+ const view_code = settings_config.web_home_view_values.recent.code;const counts = unread.get_counts();const unread_messages_present =counts.home_unread_messages + counts.muted_topic_unread_messages_count > 0;diff --git a/web/src/navigation_views.ts b/web/src/navigation_views.tsindex 9d6e402ddc2..e2cb81bb924 100644--- a/web/src/navigation_views.ts+++ b/web/src/navigation_views.ts@@ -50,7 +50,7 @@ export const built_in_views_meta_data: Record<string, BuiltInViewBasicMetadata>hidden_for_spectators: false,menu_icon_class: "recent-view-sidebar-menu-icon",menu_aria_label: $t({defaultMessage: "Recent conversations options"}),- home_view_code: "recent_topics",+ home_view_code: "recent",prioritize_in_condensed_view: true,},all_messages: {diff --git a/web/src/recent_view_ui.ts b/web/src/recent_view_ui.tsindex 499b21dcc77..bbb82d1da83 100644--- a/web/src/recent_view_ui.ts+++ b/web/src/recent_view_ui.ts@@ -1443,7 +1443,7 @@ export function show(): void {const html_body = render_introduce_zulip_view_modal({zulip_view: "recent_conversations",current_home_view_and_escape_navigation_enabled:- user_settings.web_home_view === "recent_topics" &&+ user_settings.web_home_view === "recent" &&user_settings.web_escape_navigates_to_home_view,});dialog_widget.launch({diff --git a/web/src/server_events_dispatch.js b/web/src/server_events_dispatch.jsindex 251c3abdd0b..e1588cf3e91 100644--- a/web/src/server_events_dispatch.js+++ b/web/src/server_events_dispatch.js@@ -972,9 +972,7 @@ export function dispatch_normal_event(event) {// under settings, so we set the hash to the previous// value of the home view.if (!browser_history.state.hash_before_overlay && overlays.settings_open()) {- browser_history.state.hash_before_overlay =- "#" +- (original_home_view === "recent_topics" ? "recent" : original_home_view);+ browser_history.state.hash_before_overlay = "#" + original_home_view;}}if (event.property === "twenty_four_hour_time") {diff --git a/web/src/settings_config.ts b/web/src/settings_config.tsindex 8cc5f3ad99f..32e36b9d8e3 100644--- a/web/src/settings_config.ts+++ b/web/src/settings_config.ts@@ -159,8 +159,8 @@ export const web_home_view_values = {code: "inbox",description: $t({defaultMessage: "Inbox"}),},- recent_topics: {- code: "recent_topics",+ recent: {+ code: "recent",description: $t({defaultMessage: "Recent conversations"}),},all_messages: {diff --git a/web/src/user_settings.ts b/web/src/user_settings.tsindex 8783495c2c1..82c438fdf89 100644--- a/web/src/user_settings.ts+++ b/web/src/user_settings.ts@@ -77,7 +77,7 @@ export const user_settings_schema = z.object({web_channel_default_view: z.number(),web_escape_navigates_to_home_view: z.boolean(),web_font_size_px: z.number(),- web_home_view: z.enum(["inbox", "recent_topics", "all_messages"]),+ web_home_view: z.enum(["inbox", "recent", "all_messages"]),web_inbox_show_channel_folders: z.boolean(),web_left_sidebar_show_channel_folders: z.boolean(),web_left_sidebar_unreads_count_summary: z.boolean(),diff --git a/web/tests/dispatch.test.cjs b/web/tests/dispatch.test.cjsindex b9af0bebaaf..655c5daac2f 100644--- a/web/tests/dispatch.test.cjs+++ b/web/tests/dispatch.test.cjs@@ -1312,12 +1312,12 @@ run_test("user_settings", ({override}) => {event = event_fixtures.user_settings__web_home_view_recent_topics;override(user_settings, "web_home_view", "all_messages");dispatch(event);- assert.equal(user_settings.web_home_view, "recent_topics");+ assert.equal(user_settings.web_home_view, "recent");}{event = event_fixtures.user_settings__web_home_view_all_messages;- override(user_settings, "web_home_view", "recent_topics");+ override(user_settings, "web_home_view", "recent");dispatch(event);assert.equal(user_settings.web_home_view, "all_messages");}diff --git a/web/tests/hashchange.test.cjs b/web/tests/hashchange.test.cjsindex 1e51aedb620..bf1ea95fd79 100644--- a/web/tests/hashchange.test.cjs+++ b/web/tests/hashchange.test.cjs@@ -240,7 +240,7 @@ function test_helper({override, override_rewire, change_tab}) {run_test("hash_interactions", ({override, override_rewire}) => {$window_stub = $.create("window-stub");- override(user_settings, "web_home_view", "recent_topics");+ override(user_settings, "web_home_view", "recent");const helper = test_helper({override, override_rewire, change_tab: true});diff --git a/web/tests/lib/events.cjs b/web/tests/lib/events.cjsindex 96b224f9f05..220445dac61 100644--- a/web/tests/lib/events.cjs+++ b/web/tests/lib/events.cjs@@ -1267,7 +1267,7 @@ exports.fixtures = {type: "user_settings",op: "update",property: "web_home_view",- value: "recent_topics",+ value: "recent",},user_settings__web_inbox_show_channel_folders: {diff --git a/zerver/lib/events.py b/zerver/lib/events.pyindex 47e8af9a90a..de3cbd28dad 100644--- a/zerver/lib/events.py+++ b/zerver/lib/events.py@@ -233,7 +233,7 @@ def fetch_initial_state_data(id=0,default_language=spectator_requested_language,# Set home view to recent conversations for spectators regardless of default.- web_home_view="recent_topics",+ web_home_view="recent",)# We fetch early some collections of group that we need todiff --git a/zerver/openapi/zulip.yaml b/zerver/openapi/zulip.yamlindex 1ca795f5207..b966e498541 100644--- a/zerver/openapi/zulip.yaml+++ b/zerver/openapi/zulip.yaml@@ -14156,11 +14156,14 @@ paths:The [home view](/help/configure-home-view) used when opening a newZulip web app window or hitting the `Esc` keyboard shortcut repeatedly.- - "recent_topics" - Recent conversations view+ - "recent" - Recent conversations view- "inbox" - Inbox view- "all_messages" - Combined feed view- **Changes**: New in Zulip 8.0 (feature level 219). Previously, this was+ **Changes**: Before Zulip 12.0 (feature level 454), the Recent+ view had `"recent_topics"` as its string encoding.++ New in Zulip 8.0 (feature level 219). Previously, this wascalled `default_view`, which was new in Zulip 4.0 (feature level 42).type: stringexample: all_messages@@ -17897,11 +17900,14 @@ paths:The [home view](/help/configure-home-view) used when opening a newZulip web app window or hitting the `Esc` keyboard shortcut repeatedly.- - "recent_topics" - Recent conversations view+ - "recent" - Recent conversations view- "inbox" - Inbox view- "all_messages" - Combined feed view- **Changes**: New in Zulip 8.0 (feature level 219). Previously, this was+ **Changes**: Before Zulip 12.0 (feature level 454), the Recent+ view had `"recent_topics"` as its string encoding.++ New in Zulip 8.0 (feature level 219). Previously, this wascalled `default_view`, which was new in Zulip 4.0 (feature level 42).web_escape_navigates_to_home_view:type: boolean@@ -20201,11 +20207,14 @@ paths:The [home view](/help/configure-home-view) used when opening a newZulip web app window or hitting the `Esc` keyboard shortcut repeatedly.- - "recent_topics" - Recent conversations view+ - "recent" - Recent conversations view- "inbox" - Inbox view- "all_messages" - Combined feed view- **Changes**: New in Zulip 8.0 (feature level 219). Previously, this was+ **Changes**: Before Zulip 12.0 (feature level 454), the Recent+ view had `"recent_topics"` as its string encoding.++ New in Zulip 8.0 (feature level 219). Previously, this wascalled `default_view`, which was new in Zulip 4.0 (feature level 42).web_escape_navigates_to_home_view:type: boolean@@ -21516,12 +21525,15 @@ paths:The [home view](/help/configure-home-view) used when opening a newZulip web app window or hitting the `Esc` keyboard shortcut repeatedly.- - "recent_topics" - Recent conversations view+ - "recent" - Recent conversations view- "inbox" - Inbox view- "all_messages" - Combined feed view- **Changes**: New in Zulip 8.0 (feature level 219). Previously, this was- called `default_view`, which was new in Zulip 4.0 (feature level 42).+ **Changes**: Before Zulip 12.0 (feature level 454), the Recent+ view had `"recent_topics"` as its string encoding.++ New in Zulip 8.0 (feature level 219). Previously, this was called+ `default_view`, which was new in Zulip 4.0 (feature level 42).Before Zulip 5.0 (feature level 80), this setting was managed bythe `PATCH /settings/display` endpoint.diff --git a/zerver/tests/test_events.py b/zerver/tests/test_events.pyindex 0cf7b784b90..2b1e005bbc3 100644--- a/zerver/tests/test_events.py+++ b/zerver/tests/test_events.py@@ -4713,7 +4713,7 @@ class RealmPropertyActionTest(BaseAction):web_font_size_px=[UserProfile.WEB_FONT_SIZE_PX_COMPACT],web_line_height_percent=[UserProfile.WEB_LINE_HEIGHT_PERCENT_COMPACT],color_scheme=UserProfile.COLOR_SCHEME_CHOICES,- web_home_view=["recent_topics", "inbox", "all_messages"],+ web_home_view=["recent", "inbox", "all_messages"],emojiset=[emojiset["key"] for emojiset in RealmUserDefault.emojiset_choices()],demote_inactive_streams=UserProfile.DEMOTE_STREAMS_CHOICES,web_mark_read_on_scroll_policy=UserProfile.WEB_MARK_READ_ON_SCROLL_POLICY_CHOICES,@@ -4850,7 +4850,7 @@ class UserDisplayActionTest(BaseAction):test_changes: dict[str, Any] = dict(emojiset=["twitter"],default_language=["es", "de", "en"],- web_home_view=["all_messages", "inbox", "recent_topics"],+ web_home_view=["all_messages", "inbox", "recent"],demote_inactive_streams=[2, 3, 1],web_mark_read_on_scroll_policy=[2, 3, 1],web_channel_default_view=[2, 1, 3, 4],diff --git a/zerver/tests/test_realm.py b/zerver/tests/test_realm.pyindex 4a4114e2241..177c09a9d56 100644--- a/zerver/tests/test_realm.py+++ b/zerver/tests/test_realm.py@@ -2628,7 +2628,7 @@ class RealmAPITest(ZulipTestCase):web_font_size_px=[UserProfile.WEB_FONT_SIZE_PX_COMPACT],web_line_height_percent=[UserProfile.WEB_LINE_HEIGHT_PERCENT_COMPACT],color_scheme=UserProfile.COLOR_SCHEME_CHOICES,- web_home_view=["recent_topics", "inbox", "all_messages"],+ web_home_view=["recent", "inbox", "all_messages"],emojiset=[emojiset["key"] for emojiset in RealmUserDefault.emojiset_choices()],demote_inactive_streams=UserProfile.DEMOTE_STREAMS_CHOICES,web_mark_read_on_scroll_policy=UserProfile.WEB_MARK_READ_ON_SCROLL_POLICY_CHOICES,diff --git a/zerver/tests/test_users.py b/zerver/tests/test_users.pyindex cbaed835ecb..5f6232aa0ab 100644--- a/zerver/tests/test_users.py+++ b/zerver/tests/test_users.py@@ -1740,7 +1740,7 @@ class UserProfileTest(ZulipTestCase):realm = get_realm("zulip")realm_user_default = RealmUserDefault.objects.get(realm=realm)- realm_user_default.web_home_view = "recent_topics"+ realm_user_default.web_home_view = "recent"realm_user_default.emojiset = "twitter"realm_user_default.color_scheme = UserProfile.COLOR_SCHEME_LIGHTrealm_user_default.enable_offline_email_notifications = False@@ -1755,7 +1755,7 @@ class UserProfileTest(ZulipTestCase):with self.capture_send_event_calls(expected_num_events=0):copy_default_settings(realm_user_default, cordelia)- self.assertEqual(cordelia.web_home_view, "recent_topics")+ self.assertEqual(cordelia.web_home_view, "recent")self.assertEqual(cordelia.emojiset, "twitter")self.assertEqual(cordelia.color_scheme, UserProfile.COLOR_SCHEME_LIGHT)self.assertEqual(cordelia.enable_offline_email_notifications, False)diff --git a/zerver/views/realm.py b/zerver/views/realm.pyindex 342b9b51648..e0a5d19c04d 100644--- a/zerver/views/realm.py+++ b/zerver/views/realm.py@@ -763,7 +763,7 @@ def update_realm_user_settings_defaults(| None = None,web_escape_navigates_to_home_view: Json[bool] | None = None,web_font_size_px: Json[int] | None = None,- web_home_view: Literal["recent_topics", "inbox", "all_messages"] | None = None,+ web_home_view: Literal["recent", "inbox", "all_messages"] | None = None,web_inbox_show_channel_folders: Json[bool] | None = None,web_left_sidebar_show_channel_folders: Json[bool] | None = None,web_left_sidebar_unreads_count_summary: Json[bool] | None = None,diff --git a/zerver/views/user_settings.py b/zerver/views/user_settings.pyindex dd1e038b50c..2b9319020be 100644--- a/zerver/views/user_settings.py+++ b/zerver/views/user_settings.py@@ -202,7 +202,7 @@ def confirm_email_change(request: HttpRequest, *, key: str) -> HttpResponse:emojiset_choices = {emojiset["key"] for emojiset in UserProfile.emojiset_choices()}-web_home_view_options = ["recent_topics", "inbox", "all_messages"]+web_home_view_options = ["recent", "inbox", "all_messages"]web_animate_image_previews_options = ["always", "on_hover", "never"]