Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
message_quoting: Rename 'quote_and_reply' to 'quote_message'.
Emil Grehn8e9d58174656
diff --git a/web/src/compose_reply.ts b/web/src/compose_reply.tsindex 6a2810a7e88..ee925614e7c 100644--- a/web/src/compose_reply.ts+++ b/web/src/compose_reply.ts@@ -227,7 +227,7 @@ function get_quote_target(opts: {message_id?: number; quote_content?: string | ureturn {message_id, message, quote_content};}-export function quote_and_reply(opts: {+export function quote_message(opts: {message_id: number;quote_content?: string | undefined;keep_composebox_empty?: boolean;diff --git a/web/src/hotkey.js b/web/src/hotkey.jsindex 060f84859a6..c2bc87ea91b 100644--- a/web/src/hotkey.js+++ b/web/src/hotkey.js@@ -155,7 +155,7 @@ const keypress_mappings = {45: {name: "toggle_message_collapse", message_view_only: true}, // '-'47: {name: "search", message_view_only: false}, // '/'58: {name: "toggle_reactions_popover", message_view_only: true}, // ':'- 62: {name: "compose_quote_reply", message_view_only: true}, // '>'+ 62: {name: "compose_quote_message", message_view_only: true}, // '>'63: {name: "show_shortcuts", message_view_only: false}, // '?'64: {name: "compose_reply_with_mention", message_view_only: true}, // '@'65: {name: "stream_cycle_backward", message_view_only: true}, // 'A'@@ -1195,8 +1195,8 @@ export function process_hotkey(e, hotkey) {case "mark_unread":unread_ops.mark_as_unread_from_here(msg.id);return true;- case "compose_quote_reply": // > : respond to selected message with quote- compose_reply.quote_and_reply({trigger: "hotkey"});+ case "compose_quote_message": // > : respond to selected message with quote+ compose_reply.quote_message({trigger: "hotkey"});return true;case "edit_message": {const $row = message_lists.current.get_row(msg.id);diff --git a/web/src/message_actions_popover.ts b/web/src/message_actions_popover.tsindex 71a44da9717..ebc7ec31f04 100644--- a/web/src/message_actions_popover.ts+++ b/web/src/message_actions_popover.ts@@ -109,7 +109,7 @@ export function initialize(): void {// instance.hide gets called.const $popper = $(instance.popper);$popper.one("click", ".respond_button", (e) => {- compose_reply.quote_and_reply({+ compose_reply.quote_message({trigger: "popover respond",message_id,quote_content,diff --git a/web/src/popover_menus_data.ts b/web/src/popover_menus_data.tsindex bef05ece076..c57dff23271 100644--- a/web/src/popover_menus_data.ts+++ b/web/src/popover_menus_data.ts@@ -38,7 +38,7 @@ type ActionPopoverContext = {should_display_mark_as_unread: boolean;should_display_collapse: boolean;should_display_uncollapse: boolean;- should_display_quote_and_reply: boolean;+ should_display_quote_message: boolean;conversation_time_url: string;should_display_delete_option: boolean;should_display_read_receipts_option: boolean;@@ -189,7 +189,7 @@ export function get_actions_popover_content_context(message_id: number): ActionPconst should_display_uncollapse =!message.locally_echoed && !message.is_me_message && message.collapsed;- const should_display_quote_and_reply = message.content !== "<p>(deleted)</p>" && not_spectator;+ const should_display_quote_message = message.content !== "<p>(deleted)</p>" && not_spectator;const conversation_time_url = hash_util.by_conversation_and_time_url(message);@@ -225,7 +225,7 @@ export function get_actions_popover_content_context(message_id: number): ActionPconversation_time_url,should_display_delete_option,should_display_read_receipts_option,- should_display_quote_and_reply,+ should_display_quote_message,};}diff --git a/web/templates/popovers/message_actions_popover.hbs b/web/templates/popovers/message_actions_popover.hbsindex 68751d70cc0..e3a78cb50d6 100644--- a/web/templates/popovers/message_actions_popover.hbs+++ b/web/templates/popovers/message_actions_popover.hbs@@ -1,7 +1,7 @@<div class="popover-menu" id="message-actions-menu-dropdown" data-simplebar data-simplebar-tab-index="-1"><ul role="menu" class="popover-menu-list">{{!-- Group 1 --}}- {{#if should_display_quote_and_reply}}+ {{#if should_display_quote_message}}<li role="none" class="link-item popover-menu-list-item"><a role="menuitem" data-message-id="{{message_id}}" class="respond_button popover-menu-link" tabindex="0"><i class="popover-menu-icon zulip-icon zulip-icon-quote-message" aria-hidden="true"></i>diff --git a/web/tests/compose_actions.test.cjs b/web/tests/compose_actions.test.cjsindex ce62da882d8..06ec6f845ca 100644--- a/web/tests/compose_actions.test.cjs+++ b/web/tests/compose_actions.test.cjs@@ -96,7 +96,7 @@ const start = compose_actions.start;const cancel = compose_actions.cancel;const respond_to_message = compose_reply.respond_to_message;const reply_with_mention = compose_reply.reply_with_mention;-const quote_and_reply = compose_reply.quote_and_reply;+const quote_message = compose_reply.quote_message;function assert_visible(sel) {assert.ok($(sel).visible());@@ -417,7 +417,7 @@ test("reply_with_mention", ({override, override_rewire, mock_template}) => {assert.equal(syntax_to_insert, "@**Bob Roberts|40**");});-test("quote_and_reply", ({disallow, override, override_rewire}) => {+test("quote_message", ({disallow, override, override_rewire}) => {override_rewire(compose_recipient, "on_compose_select_recipient_update", noop);override_rewire(compose_reply, "selection_within_message_id", () => undefined);const $elem = $("#send_message_form");@@ -492,7 +492,7 @@ test("quote_and_reply", ({disallow, override, override_rewire}) => {expected_replacement ="translated: @_**Steve Stephenson|90** [said](https://chat.zulip.org/#narrow/channel/92-learning/topic/Tornado):\n```quote\nTesting.\n```";- quote_and_reply(opts);+ quote_message(opts);success_function({raw_content: "Testing.",@@ -510,7 +510,7 @@ test("quote_and_reply", ({disallow, override, override_rewire}) => {replaced = false;disallow(channel, "get");- quote_and_reply(opts);+ quote_message(opts);assert.ok(replaced);delete opts.message_id;@@ -529,7 +529,7 @@ test("quote_and_reply", ({disallow, override, override_rewire}) => {replaced = false;expected_replacement ="translated: @_**Steve Stephenson|90** [said](https://chat.zulip.org/#narrow/channel/92-learning/topic/Tornado):\n````quote\n```\nmultiline code block\nshoudln't mess with quotes\n```\n````";- quote_and_reply(opts);+ quote_message(opts);assert.ok(replaced);});diff --git a/web/tests/compose_ui.test.cjs b/web/tests/compose_ui.test.cjsindex b60f7c5d571..ee7a93cddd1 100644--- a/web/tests/compose_ui.test.cjs+++ b/web/tests/compose_ui.test.cjs@@ -268,7 +268,7 @@ run_test("compute_placeholder_text", ({override}) => {);});-run_test("quote_and_reply", ({override, override_rewire}) => {+run_test("quote_message", ({override, override_rewire}) => {const devel_stream = {subscribed: false,name: "devel",@@ -372,7 +372,7 @@ run_test("quote_and_reply", ({override, override_rewire}) => {let quote_text = "Testing caret position";override_with_quote_text(quote_text);set_compose_content_with_caret("hello %there"); // "%" is used to encode/display position of focus before change- compose_reply.quote_and_reply({message_id: 100});+ compose_reply.quote_message({message_id: 100});success_function({raw_content: quote_text,@@ -387,7 +387,7 @@ run_test("quote_and_reply", ({override, override_rewire}) => {assert.equal(syntax, "translated: [Quoting…]\n\n");});set_compose_content_with_caret("%hello there");- compose_reply.quote_and_reply({message_id: 100});+ compose_reply.quote_message({message_id: 100});quote_text = "Testing with caret initially positioned at 0.";override_with_quote_text(quote_text);@@ -409,7 +409,7 @@ run_test("quote_and_reply", ({override, override_rewire}) => {// at the beginning of compose-box.override(message_lists.current, "selected_id", () => 100);override_rewire(compose_reply, "selection_within_message_id", () => undefined);- compose_reply.quote_and_reply({});+ compose_reply.quote_message({});quote_text = "Testing with compose-box closed initially.";override_with_quote_text(quote_text);@@ -424,7 +424,7 @@ run_test("quote_and_reply", ({override, override_rewire}) => {// newlines), the compose-box should re-open and thus the quoted// message should start from the beginning of compose-box.set_compose_content_with_caret(" \n\n \n %");- compose_reply.quote_and_reply({});+ compose_reply.quote_message({});quote_text = "Testing with compose-box containing whitespaces and newlines only.";override_with_quote_text(quote_text);@@ -441,7 +441,7 @@ run_test("quote_and_reply", ({override, override_rewire}) => {assert.equal(syntax, "\ntranslated: [Quoting…]\n");});set_compose_content_with_caret("1st line\n%\n2nd line");- compose_reply.quote_and_reply({});+ compose_reply.quote_message({});quote_text = "Testing with caret on a new line between 2 lines of text.";override_with_quote_text(quote_text);@@ -458,7 +458,7 @@ run_test("quote_and_reply", ({override, override_rewire}) => {assert.equal(syntax, "translated: [Quoting…]");});set_compose_content_with_caret("lots of\n\n\n\n%\n\n\nnewlines");- compose_reply.quote_and_reply({});+ compose_reply.quote_message({});quote_text = "Testing with caret on a new line between many empty newlines.";override_with_quote_text(quote_text);diff --git a/web/tests/hotkey.test.cjs b/web/tests/hotkey.test.cjsindex 523faadcbfd..83a4a755ee6 100644--- a/web/tests/hotkey.test.cjs+++ b/web/tests/hotkey.test.cjs@@ -375,7 +375,7 @@ run_test("misc", ({override}) => {assert_mapping("u", popovers, "toggle_sender_info");assert_mapping("i", message_actions_popover, "toggle_message_actions_menu");assert_mapping(":", emoji_picker, "toggle_emoji_popover", true);- assert_mapping(">", compose_reply, "quote_and_reply");+ assert_mapping(">", compose_reply, "quote_message");assert_mapping("e", message_edit, "start");override(narrow_state, "narrowed_by_topic_reply", () => true);diff --git a/web/tests/i18n.test.cjs b/web/tests/i18n.test.cjsindex 3cf1c71eea9..619d4d9d74a 100644--- a/web/tests/i18n.test.cjs+++ b/web/tests/i18n.test.cjs@@ -67,7 +67,7 @@ run_test("$tr", () => {run_test("t_tag", ({mock_template}) => {const args = {message_id: "99",- should_display_quote_and_reply: true,+ should_display_quote_message: true,editability_menu_item: true,should_display_hide_option: true,conversation_time_url:diff --git a/web/tests/popover_menus_data.test.cjs b/web/tests/popover_menus_data.test.cjsindex 6e37fc7018c..4a6cc9582ff 100644--- a/web/tests/popover_menus_data.test.cjs+++ b/web/tests/popover_menus_data.test.cjs@@ -214,7 +214,7 @@ test("my_message_all_actions", ({override}) => {assert.equal(response.conversation_time_url, "conversation_and_time_url");assert.equal(response.should_display_delete_option, true);assert.equal(response.should_display_read_receipts_option, true);- assert.equal(response.should_display_quote_and_reply, true);+ assert.equal(response.should_display_quote_message, true);});test("not_my_message_view_actions", ({override}) => {diff --git a/zerver/lib/zulip_update_announcements.py b/zerver/lib/zulip_update_announcements.pyindex 9accc3d67a7..8f3822b9e23 100644--- a/zerver/lib/zulip_update_announcements.py+++ b/zerver/lib/zulip_update_announcements.py@@ -52,14 +52,14 @@ announcements, they can be disabled. [Learn more]({zulip_update_announcements_hethe formatting, including links, bulleted lists, bold, italics, and more.Pasting as plain text remains an alternative option. [Learnmore]({keyboard_shortcuts_basics_help_url}).-- To [quote and reply]({quote_and_reply_help_url}) to part of a message, you can+- To [quote and reply]({quote_message_help_url}) to part of a message, you cannow select the part that you want to quote.- You can now hide the user list in the right sidebar to reduce distraction.[Learn more]({user_list_help_url}).""".format(keyboard_shortcuts_basics_help_url="/help/keyboard-shortcuts#the-basics",user_list_help_url="/help/user-list",- quote_and_reply_help_url="/help/quote-and-reply",+ quote_message_help_url="/help/quote-and-reply",),),ZulipUpdateAnnouncement(diff --git a/zerver/tests/fixtures/markdown_test_cases.json b/zerver/tests/fixtures/markdown_test_cases.jsonindex 593e7fc5056..e3707b8b86a 100644--- a/zerver/tests/fixtures/markdown_test_cases.json+++ b/zerver/tests/fixtures/markdown_test_cases.json@@ -127,7 +127,7 @@"expected_output": "<blockquote>\n<p>Text in<br>\nmultiple lines.</p>\n</blockquote>\n<blockquote>\n<p>Text in a single line.</p>\n</blockquote>"},{- "name": "multiple_blockquote_with_quote_and_reply",+ "name": "multiple_blockquote_with_quote_message","input": "Hamlet said:\n~~~quote\nCan we talk ?\n~~~\n> Yes !!\n\nWelcome to Open Source.","expected_output": "<p>Hamlet said:</p>\n<blockquote>\n<p>Can we talk ?</p>\n</blockquote>\n<blockquote>\n<p>Yes !!</p>\n</blockquote>\n<p>Welcome to Open Source.</p>","text_content": "Hamlet said:\n[…]\nWelcome to Open Source."@@ -1049,7 +1049,7 @@"marked_expected_output": "<div class=\"codehilite\" data-code-language=\"PHP\"><pre><span></span><code> $var = function($var, 'string');\n</code></pre></div>\n<p>PHP</p>\n<div class=\"codehilite\" data-code-language=\"CSS+PHP\"><pre><span></span><code> $var = function($var, 'string');\n</code></pre></div>\n<p>CSS + PHP</p>\n<div class=\"codehilite\" data-code-language=\"HTML+PHP\"><pre><span></span><code> $var = function($var, 'string');\n</code></pre></div>\n<p>HTML + PHP</p>\n<div class=\"codehilite\" data-code-language=\"JavaScript+PHP\"><pre><span></span><code> $var = function($var, 'string');\n</code></pre></div>\n<p>JAVASCRIPT + PHP</p>\n<div class=\"codehilite\" data-code-language=\"XML+PHP\"><pre><span></span><code> $var = function($var, 'string');\n</code></pre></div>\n<p>XML + PHP</p>\n<div class=\"codehilite\" data-code-language=\"PHP\"><pre><span></span><code> <?php\n $var = function($var, 'string');\n</code></pre></div>\n<p>WITH MARKER</p>"},{- "name": "normal_quote_and_reply",+ "name": "normal_quote_message","input": "@_**Zoe|7** [said](http://zulip.testserver/#narrow/channel/13-social/topic/party/near/103):\n```quote\nHow are you?\n```\n\nGreat","expected_output": "<p><span class=\"user-mention silent\" data-user-id=\"7\">Zoe</span> <a href=\"#narrow/channel/13-social/topic/party/near/103\">said</a>:</p>\n<blockquote>\n<p>How are you?</p>\n</blockquote>\n<p>Great</p>","marked_expected_output": "<p><span class=\"user-mention silent\" data-user-id=\"7\">Zoe</span> <a href=\"http://zulip.testserver/#narrow/channel/13-social/topic/party/near/103\">said</a>:</p>\n<blockquote>\n<p>How are you?</p>\n</blockquote>\n<p>Great</p>",