Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
tools: Fix screenshot capturing script to capture the correct area.
PIG208f42729ab0c3f
diff --git a/tools/message-screenshot.js b/tools/message-screenshot.jsindex fab6da185c4..7baca29a5e2 100644--- a/tools/message-screenshot.js+++ b/tools/message-screenshot.js@@ -54,14 +54,14 @@ async function run() {]);// Navigate to message and capture screenshot- await page.goto(`http://${host}/#narrow/near/${options.messageId}`);+ await page.goto(`http://${host}/#narrow/id/${options.messageId}`);const messageSelector = `#zfilt${CSS.escape(options.messageId)}`;await page.waitForSelector(messageSelector);// remove unread marker and don't select messageconst marker = `#zfilt${CSS.escape(options.messageId)} .unread_marker`;await page.evaluate((sel) => $(sel).remove(), marker);const messageBox = await page.$(messageSelector);- await page.keyboard.press("KeyK");+ await page.evaluate((msg) => $(msg).removeClass("selected_message"), messageSelector);const messageGroup = (await messageBox.$x(".."))[0];// Compute screenshot area, with some padding around the message groupconst clip = {...(await messageGroup.boundingBox())};