Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
recent_topics: Make it the default view.
Aman Agrawal39d123e35551
diff --git a/docs/subsystems/pointer.md b/docs/subsystems/pointer.mdindex e775d36655d..f608c2284aa 100644--- a/docs/subsystems/pointer.md+++ b/docs/subsystems/pointer.md@@ -53,7 +53,7 @@ streams.)### Unnarrow: previous sequence-When you unnarrow using e.g. the escape key, you will automatically be+When you unnarrow using e.g. the `a` key, you will automatically betaken to the same message that was selected in the All messages view beforeyou narrowed, unless in the narrow you read new messages, in whichcase you will be jumped forward to the first unread and non-muteddiff --git a/docs/testing/manual-testing.md b/docs/testing/manual-testing.mdindex 9df91a5874c..8ecf9739fbf 100644--- a/docs/testing/manual-testing.md+++ b/docs/testing/manual-testing.md@@ -51,7 +51,7 @@ Try using all the navigation hotkeys:Try narrowing from the message view:- Hotkeys- - use Esc to go to All messages+ - use a to go to All messages- use s to narrow to a stream (select message firstand verify in sidebar)- use S to narrow to the topic (and verify in sidebar)@@ -63,7 +63,7 @@ Try narrowing from the message view:- narrow to a group PM- Click on the Zulip logo- narrow to a topic- - click on the Zulip logo (and verify you're in the All messages view)+ - click on the Zulip logo (and verify you're in the Recent topics view)### Messagebox ###diff --git a/frontend_tests/node_tests/hashchange.js b/frontend_tests/node_tests/hashchange.jsindex 1d7441aafa3..ee62a4ff23a 100644--- a/frontend_tests/node_tests/hashchange.js+++ b/frontend_tests/node_tests/hashchange.js@@ -19,6 +19,7 @@ const hashchange = zrequire("hashchange");const stream_data = zrequire("stream_data");zrequire("navigate");zrequire("recent_topics");+recent_topics.show = () => {};set_global("search", {update_button_visibility: () => {},@@ -38,6 +39,9 @@ const overlays = set_global("overlays", {});const settings = set_global("settings", {});const subs = set_global("subs", {});const ui_util = set_global("ui_util", {});+set_global("top_left_corner", {+ handle_narrow_deactivated: () => {},+});run_test("operators_round_trip", () => {let operators;@@ -161,7 +165,7 @@ function test_helper() {run_test("hash_interactions", () => {const helper = test_helper();- window.location.hash = "#";+ window.location.hash = "#all_messages";helper.clear_events();hashchange.initialize();diff --git a/frontend_tests/node_tests/hotkey.js b/frontend_tests/node_tests/hotkey.jsindex fcc7c6b5916..5f1c3bd731b 100644--- a/frontend_tests/node_tests/hotkey.js+++ b/frontend_tests/node_tests/hotkey.js@@ -19,6 +19,10 @@ const {run_test} = require("../zjsunit/test");// it calls any external module other than `ui.foo`, it'll crash.// Future work includes making sure it actually does call `ui.foo()`.+// Since all the tests here are based on narrow starting with all_messages.+// We set our default narrow to all messages here.+window.location.hash = "#all_messages";+const emoji_codes = zrequire("emoji_codes", "generated/emoji/emoji_codes.json");set_global("navigator", {@@ -206,7 +210,7 @@ run_test("basic_chars", () => {// Unmapped keys should immediately return false, without// calling any functions outside of hotkey.js.- assert_unmapped("abfmoyz");+ assert_unmapped("bfmoyz");assert_unmapped("BEFHILNOQTUWXYZ");// We have to skip some checks due to the way the code isdiff --git a/frontend_tests/puppeteer_lib/common.ts b/frontend_tests/puppeteer_lib/common.tsindex 7e066a4fa16..b1246180f12 100644--- a/frontend_tests/puppeteer_lib/common.ts+++ b/frontend_tests/puppeteer_lib/common.ts@@ -227,7 +227,7 @@ class CommonUtils {await this.fill_form(page, "#login_form", params);await page.$eval("#login_form", (form) => (form as HTMLFormElement).submit());- await page.waitForSelector("#zhome .message_row", {visible: true});+ await page.waitForSelector("#recent_topics_filter_buttons", {visible: true});}async log_out(page: Page): Promise<void> {diff --git a/frontend_tests/puppeteer_tests/02-message-basics.ts b/frontend_tests/puppeteer_tests/02-message-basics.tsindex 9f3fd56ebfe..b5f909f0ef9 100644--- a/frontend_tests/puppeteer_tests/02-message-basics.ts+++ b/frontend_tests/puppeteer_tests/02-message-basics.ts@@ -76,7 +76,7 @@ async function un_narrow(page: Page): Promise<void> {if (await page.evaluate(() => $(".message_comp").is(":visible"))) {await page.keyboard.press("Escape");}- await page.keyboard.press("Escape");+ await page.click(".top_left_all_messages");await page.waitForSelector("#zhome .message_row", {visible: true});assert.strictEqual(await page.title(), "home - Zulip Dev - Zulip");}@@ -414,6 +414,8 @@ async function test_users_search(page: Page): Promise<void> {async function message_basic_tests(page: Page): Promise<void> {await common.log_in(page);+ await page.click(".top_left_all_messages");+ await page.waitForSelector("#zhome .message_row", {visible: true});console.log("Sending messages");await common.send_multiple_messages(page, [diff --git a/frontend_tests/puppeteer_tests/03-compose.ts b/frontend_tests/puppeteer_tests/03-compose.tsindex e2bb417d55d..9f623edfc6d 100644--- a/frontend_tests/puppeteer_tests/03-compose.ts+++ b/frontend_tests/puppeteer_tests/03-compose.ts@@ -142,7 +142,7 @@ async function test_send_multirecipient_pm_from_cordelia_pm_narrow(page: Page):});// Go back to all messages view and make sure all messages are loaded.- await page.keyboard.press("Escape");+ await page.click(".top_left_all_messages");await page.waitForSelector("#zhome .message_row", {visible: true});await page.waitForFunction((selector: string) => $(selector).length !== 0, {}, pm_selector);@@ -216,6 +216,8 @@ async function test_markdown_preview(page: Page): Promise<void> {async function compose_tests(page: Page): Promise<void> {await common.log_in(page);+ await page.click(".top_left_all_messages");+ await page.waitForSelector("#zhome .message_row", {visible: true});await test_send_messages(page);await test_keyboard_shortcuts(page);await test_reply_by_click_prepopulates_stream_topic_names(page);diff --git a/frontend_tests/puppeteer_tests/05-stars.ts b/frontend_tests/puppeteer_tests/05-stars.tsindex 8a53e730e91..360079f13fb 100644--- a/frontend_tests/puppeteer_tests/05-stars.ts+++ b/frontend_tests/puppeteer_tests/05-stars.ts@@ -31,12 +31,14 @@ async function test_narrow_to_starred_messages(page: Page): Promise<void> {await common.check_messages_sent(page, "zfilt", [["Verona > stars", [message]]]);// Go back to all messages narrow.- await page.keyboard.press("Escape");+ await page.click(".top_left_all_messages");await page.waitForSelector("#zhome .message_row", {visible: true});}async function stars_test(page: Page): Promise<void> {await common.log_in(page);+ await page.click(".top_left_all_messages");+ await page.waitForSelector("#zhome .message_row", {visible: true});await common.send_message(page, "stream", {stream: "Verona",topic: "stars",diff --git a/frontend_tests/puppeteer_tests/06-edit.ts b/frontend_tests/puppeteer_tests/06-edit.tsindex 78b057f35e4..6f9fb15a921 100644--- a/frontend_tests/puppeteer_tests/06-edit.ts+++ b/frontend_tests/puppeteer_tests/06-edit.ts@@ -78,6 +78,8 @@ async function test_edit_private_message(page: Page): Promise<void> {async function edit_tests(page: Page): Promise<void> {await common.log_in(page);+ await page.click(".top_left_all_messages");+ await page.waitForSelector("#zhome .message_row", {visible: true});await test_stream_message_edit(page);await test_edit_message_with_slash_me(page);diff --git a/frontend_tests/puppeteer_tests/07-navigation.ts b/frontend_tests/puppeteer_tests/07-navigation.tsindex d056ffb9533..20c5f66b0e4 100644--- a/frontend_tests/puppeteer_tests/07-navigation.ts+++ b/frontend_tests/puppeteer_tests/07-navigation.ts@@ -5,7 +5,7 @@ import type {Page} from "puppeteer";import common from "../puppeteer_lib/common";async function wait_for_tab(page: Page, tab: string): Promise<void> {- const tab_slector = `#${CSS.escape(tab)}.tab-pane.active`;+ const tab_slector = `#${CSS.escape(tab)}.tab-pane`;await page.waitForSelector(tab_slector, {visible: true});}@@ -89,7 +89,7 @@ async function navigation_tests(page: Page): Promise<void> {await wait_for_tab(page, "message_feed_container");await navigate_to_subscriptions(page);- await navigate_to(page, "", "message_feed_container");+ await navigate_to(page, "all_messages", "message_feed_container");await navigate_to_settings(page);await navigate_to(page, "narrow/is/private", "message_feed_container");await navigate_to_subscriptions(page);diff --git a/frontend_tests/puppeteer_tests/09-mention.ts b/frontend_tests/puppeteer_tests/09-mention.tsindex 8ccb43c0e27..dd990ef451a 100644--- a/frontend_tests/puppeteer_tests/09-mention.ts+++ b/frontend_tests/puppeteer_tests/09-mention.ts@@ -6,6 +6,8 @@ import common from "../puppeteer_lib/common";async function test_mention(page: Page): Promise<void> {await common.log_in(page);+ await page.click(".top_left_all_messages");+ await page.waitForSelector("#zhome .message_row", {visible: true});await page.keyboard.press("KeyC");await page.waitForSelector("#compose", {visible: true});diff --git a/frontend_tests/puppeteer_tests/12-drafts.ts b/frontend_tests/puppeteer_tests/12-drafts.tsindex 1e151185a40..cba8f5dfdad 100644--- a/frontend_tests/puppeteer_tests/12-drafts.ts+++ b/frontend_tests/puppeteer_tests/12-drafts.ts@@ -247,6 +247,8 @@ async function test_delete_draft_on_sending(page: Page): Promise<void> {async function drafts_test(page: Page): Promise<void> {await common.log_in(page);+ await page.click(".top_left_all_messages");+ await page.waitForSelector("#zhome .message_row", {visible: true});await test_empty_drafts(page);diff --git a/frontend_tests/puppeteer_tests/13-delete-message.ts b/frontend_tests/puppeteer_tests/13-delete-message.tsindex 899f8754ead..3529c8affe2 100644--- a/frontend_tests/puppeteer_tests/13-delete-message.ts+++ b/frontend_tests/puppeteer_tests/13-delete-message.ts@@ -13,6 +13,8 @@ async function click_delete_and_return_last_msg_id(page: Page): Promise<string |async function delete_message_test(page: Page): Promise<void> {await common.log_in(page);+ await page.click(".top_left_all_messages");+ await page.waitForSelector("#zhome .message_row", {visible: true});const messages_quantitiy = await page.evaluate(() => $("#zhome .message_row").length);const last_message_id = await click_delete_and_return_last_msg_id(page);diff --git a/frontend_tests/puppeteer_tests/14-copy-and-paste.ts b/frontend_tests/puppeteer_tests/14-copy-and-paste.tsindex 92ceb3597db..8629edb86c7 100644--- a/frontend_tests/puppeteer_tests/14-copy-and-paste.ts+++ b/frontend_tests/puppeteer_tests/14-copy-and-paste.ts@@ -123,6 +123,8 @@ async function test_copying_messages_from_several_topics(page: Page): Promise<voasync function copy_paste_test(page: Page): Promise<void> {await common.log_in(page);+ await page.click(".top_left_all_messages");+ await page.waitForSelector("#zhome .message_row", {visible: true});await common.send_multiple_messages(page, [{stream: "Verona", topic: "copy-paste-topic #1", content: "copy paste test A"},diff --git a/static/js/hashchange.js b/static/js/hashchange.jsindex 20c54c8ba13..11c65af49ad 100644--- a/static/js/hashchange.js+++ b/static/js/hashchange.js@@ -65,6 +65,7 @@ function activate_home_tab() {const coming_from_recent_topics = maybe_hide_recent_topics();ui_util.change_tab_to("#message_feed_container");narrow.deactivate(coming_from_recent_topics);+ top_left_corner.handle_narrow_deactivated();floating_recipient_bar.update();search.update_button_visibility();// We need to maybe scroll to the selected message@@ -111,7 +112,7 @@ function do_hashchange_normal(from_reload) {if (operators === undefined) {// If the narrow URL didn't parse, clear// window.location.hash and send them to the home tab- set_hash("");+ set_hash("#all_messages");activate_home_tab();return false;}@@ -133,11 +134,12 @@ function do_hashchange_normal(from_reload) {}case "":case "#":- activate_home_tab();- break;case "#recent_topics":recent_topics.show();break;+ case "#all_messages":+ activate_home_tab();+ break;case "#keyboard-shortcuts":case "#message-formatting":case "#search-operators":diff --git a/static/js/hotkey.js b/static/js/hotkey.jsindex 158fbe1e712..fdc452773fa 100644--- a/static/js/hotkey.js+++ b/static/js/hotkey.js@@ -98,6 +98,7 @@ const keypress_mappings = {82: {name: "respond_to_author", message_view_only: true}, // 'R'83: {name: "narrow_by_topic", message_view_only: true}, //'S'86: {name: "view_selected_stream", message_view_only: false}, //'V'+ 97: {name: "all_messages", message_view_only: true}, // 'a'99: {name: "compose", message_view_only: true}, // 'c'100: {name: "open_drafts", message_view_only: true}, // 'd'101: {name: "edit_message", message_view_only: true}, // 'e'@@ -477,7 +478,7 @@ exports.process_hotkey = function (e, hotkey) {case "tab":case "shift_tab":if (- window.location.hash === "#recent_topics" &&+ ["#recent_topics", "#", ""].includes(window.location.hash) &&!popovers.any_active() &&!overlays.is_active()) {@@ -735,6 +736,9 @@ exports.process_hotkey = function (e, hotkey) {case "open_recent_topics":hashchange.go_to_location("#");return true;+ case "all_messages":+ hashchange.go_to_location("#all_messages");+ return true;}// We don't want hotkeys below this to work when recent topics isdiff --git a/static/js/narrow.js b/static/js/narrow.jsindex a000b37cbbe..3f4dfab4d5d 100644--- a/static/js/narrow.js+++ b/static/js/narrow.js@@ -770,7 +770,7 @@ function handle_post_narrow_deactivate_processes() {exports.deactivate = function (coming_from_recent_topics = false) {// NOTE: Never call this function independently,- // always use hashchange.go_to_location("") to+ // always use hashchange.go_to_location("#all_messages") to// activate All message narrow./*Switches current_msg_list from narrowed_msg_list todiff --git a/static/js/recent_topics.js b/static/js/recent_topics.jsindex a3f663805e8..d12fb1f0b6f 100644--- a/static/js/recent_topics.js+++ b/static/js/recent_topics.js@@ -503,13 +503,6 @@ exports.change_focused_element = function (e, input_key) {// handle the key.const $elem = $(e.target);- if ($("#recent_topics_table").find(":focus").length === 0) {- // This is a failsafe to return focus back to recent topics overlay,- // in case it loses focus due to some unknown reason.- set_default_focus();- return false;- }-if (e.target.id === "recent_topics_search") {// Since the search box a text area, we want the browser to handle// Left/Right and selection within the widget; but if the userdiff --git a/templates/zerver/app/index.html b/templates/zerver/app/index.htmlindex 719c85659f2..a9a3fc8549b 100644--- a/templates/zerver/app/index.html+++ b/templates/zerver/app/index.html@@ -98,7 +98,7 @@<div id="recent_topics_table"></div></div></div>- <div class="tab-pane active" id="message_feed_container">+ <div class="tab-pane" id="message_feed_container"><div class="fixed-app" id="floating_recipient_bar"><div class="app-main recipient_bar_content"><div class="column-middle column-overlay recipient-bar-main">diff --git a/templates/zerver/app/keyboard_shortcuts.html b/templates/zerver/app/keyboard_shortcuts.htmlindex e097909db13..b5fe4884320 100644--- a/templates/zerver/app/keyboard_shortcuts.html+++ b/templates/zerver/app/keyboard_shortcuts.html@@ -177,7 +177,7 @@</tr><tr><td class="definition">{% trans %}Narrow to all unmuted messages{% endtrans %}</td>- <td><span class="hotkey"><kbd>Esc</kbd> or <kbd>Ctrl</kbd> + <kbd>[</kbd></span></td>+ <td><span class="hotkey"><kbd>A</kbd></span></td></tr><tr><td class="definition">{% trans %}Narrow to current compose box recipient{% endtrans %}</td>@@ -241,11 +241,7 @@</thead><tr><td class="definition">{% trans %}View recent topics{% endtrans %}</td>- <td><span class="hotkey"><kbd>T</kbd></span></td>- </tr>- <tr>- <td class="definition">{% trans %}Hide recent topics{% endtrans %}</td>- <td><span class="hotkey"><kbd>Esc</kbd></span></td>+ <td><span class="hotkey"><kbd>T</kbd> or <kbd>Esc</kbd> or <kbd>Ctrl</kbd> + <kbd>[</kbd></span></td></tr></table></div>diff --git a/templates/zerver/app/left_sidebar.html b/templates/zerver/app/left_sidebar.htmlindex 891696116c7..ebf30f089c3 100644--- a/templates/zerver/app/left_sidebar.html+++ b/templates/zerver/app/left_sidebar.html@@ -2,8 +2,8 @@<div class="narrows_panel"><ul id="global_filters" class="filters">{# Special-case this link so we don't actually go to page top. #}- <li class="top_left_all_messages top_left_row active-filter" title="{{ _('All messages') }} (Esc)">- <a href="#" class="home-link">+ <li class="top_left_all_messages top_left_row" title="{{ _('All messages') }} (a)">+ <a href="#all_messages" class="home-link"><span class="filter-icon"><i class="fa fa-home" aria-hidden="true"></i></span>@@ -57,7 +57,7 @@<span class="arrow starred-messages-sidebar-menu-icon"><i class="zulip-icon ellipsis-v-solid" aria-hidden="true"></i></span></li><li class="top_left_recent_topics top_left_row">- <a href="#recent_topics">+ <a href="#"><span class="filter-icon"><i class="fa fa-clock-o" aria-hidden="true"></i></span>diff --git a/templates/zerver/help/keyboard-shortcuts.md b/templates/zerver/help/keyboard-shortcuts.mdindex 6f6bae8564c..7f328d4f2bb 100644--- a/templates/zerver/help/keyboard-shortcuts.md+++ b/templates/zerver/help/keyboard-shortcuts.md@@ -76,7 +76,7 @@ below, and add more to your repertoire as needed.* **Cycle between stream narrows**: `A` (previous) and `D` (next)-* **Narrow to all messages**: `Esc` or `Ctrl` + `[` — Shows all unmuted messages.+* **Narrow to all messages**: `a` — Shows all unmuted messages.* **Narrow to current compose box recipient**: `Ctrl` + `.`@@ -139,8 +139,7 @@ title="thumbs up"/>**: `+`## Recent topics-* **View recent topics**: `t`-* **Hide recent topics**: `Esc`+* **View recent topics**: `t` or `Esc` or `Ctrl` + `[`Keyboard navigation (e.g. arrow keys) works as expected.Use `Enter` to engage with elements.diff --git a/templates/zerver/help/reading-strategies.md b/templates/zerver/help/reading-strategies.mdindex fe3a3c8e4eb..b4d41e932de 100644--- a/templates/zerver/help/reading-strategies.md+++ b/templates/zerver/help/reading-strategies.md@@ -45,10 +45,10 @@ magnifying glass next to `STREAMS`, or by using the autocomplete inIf you're all caught up, it can be useful to have a single place to keeptrack of all messages coming in.-* Click on **All messages** in the upper left, or hit `Esc`.+* Click on **All messages** in the upper left, or hit `a`.* You can use `s` (narrow to stream) or `S` (narrow to topic) to zoom in,- and `Esc` to get back to All messages.+ and `a` to get back to All messages.## Starring messages for later