From 5fe2341616b2d1abdd7a3560371aff2d648e2311 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 26 Oct 2026 09:49:37 -0700 Subject: Cancel on a reply discards what was typed and folds the box: it only cleared the "replying" flag, and the box stays up while a draft has text, so with anything typed it did nothing. Attachments the draft carried are dropped with it Co-Authored-By: Claude Fable 5.1 --- tools/thread-reply-test.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tools/thread-reply-test.js') diff --git a/tools/thread-reply-test.js b/tools/thread-reply-test.js index 738a31c..8ba59d3 100644 --- a/tools/thread-reply-test.js +++ b/tools/thread-reply-test.js @@ -78,6 +78,16 @@ try { await page.click('#app .note-act'); check('Reply immediately shows its composer beneath the tapped post', await inline()); check('the input receives focus before relay queries finish', await page.evaluate(() => document.activeElement.matches('.thread-reply-input'))); + // Cancel with text typed: the box folds and the draft is gone (it used to + // stay open — the box shows while a draft has text, and Cancel only + // cleared the replying flag) + await page.type('.thread-reply-input', 'Half a thought'); + await page.evaluate(() => document.querySelector('.thread-reply-cancel').click()); + check('Cancel with text typed hides the box and discards the draft', await page.evaluate(() => + !document.querySelector('.thread-reply-input') && !(test.ui.noteThread.draft || '').length)); + await page.evaluate(() => document.querySelector('#app .note-act').click()); // one atomic tap, as below + await page.waitForSelector('.thread-reply-input'); + check('Reply again opens an empty field', await page.evaluate(() => document.querySelector('.thread-reply-input')?.value === '')); await page.type('.thread-reply-input', 'A reply before the root loads'); // (one atomic tap: a repaint landing between finding the button and clicking it replaces it) await page.waitForFunction(() => !document.querySelector('.thread-reply-send')?.disabled); -- cgit v1.2.3