diff options
| author | Adam Soltys <[email protected]> | 2026-10-26 10:30:17 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-10-26 10:30:17 -0700 |
| commit | 93a6ee52555a7c9557d926c46f06c7949bd971a8 (patch) | |
| tree | 343a9961c04a9850e4df680f7945373fe107921d /tools/thread-reply-test.js | |
| parent | 5360027b5f44b75afd14741f8bb54738a1fc2be5 (diff) | |
| download | coinosv3-93a6ee52555a7c9557d926c46f06c7949bd971a8.tar.gz coinosv3-93a6ee52555a7c9557d926c46f06c7949bd971a8.zip | |
On a phone, Return in the reply box is a new line; Reply is the button. A hardware keyboard's Enter still sends
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01QjVvE4YAcK3AGwV7kZXeN4
Diffstat (limited to 'tools/thread-reply-test.js')
| -rw-r--r-- | tools/thread-reply-test.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/thread-reply-test.js b/tools/thread-reply-test.js index 8ba59d3..f3bda91 100644 --- a/tools/thread-reply-test.js +++ b/tools/thread-reply-test.js @@ -88,6 +88,17 @@ try { 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 === '')); + // a phone: Return is a new line, not a send + await page.evaluate(() => { const mm = window.matchMedia; window._mm = mm; window.matchMedia = (q) => q === '(pointer: coarse)' ? { matches: true } : mm(q); }); + await page.type('.thread-reply-input', 'Line one'); + await page.keyboard.press('Enter'); + await page.type('.thread-reply-input', 'two'); + check("on a phone, Return adds a line instead of sending", await page.evaluate(() => + document.querySelector('.thread-reply-input')?.value === 'Line one\ntwo' && sent.length === 0), await page.evaluate(() => document.querySelector('.thread-reply-input')?.value)); + await page.evaluate(() => { window.matchMedia = window._mm; }); + await page.focus('.thread-reply-input'); + await page.keyboard.down('Control'); await page.keyboard.press('a'); await page.keyboard.up('Control'); + await page.keyboard.press('Backspace'); 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); |
