diff options
| author | Adam Soltys <[email protected]> | 2026-09-29 11:18:21 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-09-29 11:18:21 -0700 |
| commit | 689e21d5e77765661c44d60c10b18134b995162a (patch) | |
| tree | 2a6e878c9b8e400d3fcd60022d72f7d4bf3030ca /tools/compose-preview-test.js | |
| parent | c7186db46f6e45969f01709bc4a0a9472a40dff1 (diff) | |
| download | coinosv3-689e21d5e77765661c44d60c10b18134b995162a.tar.gz coinosv3-689e21d5e77765661c44d60c10b18134b995162a.zip | |
Composers take pictures from the keyboard: the reply, post and chat fields are contenteditable.
Android keyboards (Gboard GIFs, stickers) only offer images to fields that
accept them, and Chrome says so for contenteditable, never <textarea> —
hence the greyed-out GIF key and "This app does not support images here".
<coinos-text> (src/rich-text.js) is a contenteditable that acts like a
textarea to the code around it (value, selectionStart/End, setSelection-
Range, placeholder), keeps text plain, and hands any pasted/dropped/
keyboard picture to onMedia — the paperclip's upload. The morph syncs its
value like a field's and leaves its own editing attributes alone.
composer-media-test: types like a textarea, strips pasted formatting,
a pasted GIF uploads and lands in the reply, still editable after repaint.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Du1qT1wbkYwYK6zkGH79Rp
Diffstat (limited to 'tools/compose-preview-test.js')
| -rw-r--r-- | tools/compose-preview-test.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/compose-preview-test.js b/tools/compose-preview-test.js index c2f35e6..2138ea6 100644 --- a/tools/compose-preview-test.js +++ b/tools/compose-preview-test.js @@ -66,9 +66,9 @@ try { await page.evaluate(() => { const e = [...document.querySelectorAll('.item')].find((n) => /feed/i.test(n.textContent)); if (e) e.click(); }); await sleep(2500); const opened = await page.evaluate(() => { const b = [...document.querySelectorAll('button')].find((n) => (n.getAttribute('aria-label') || n.textContent).trim().toLowerCase() === 'new post'); if (b) { b.click(); return true; } return false; }); - check('the composer opens', opened && !!(await page.$('textarea'))); + check('the composer opens', opened && !!(await page.$('coinos-text'))); - await type('textarea', DRAFT); + await type('coinos-text', DRAFT); await sleep(400); check('no preview until it is asked for', !(await page.$('.draft-preview'))); @@ -92,7 +92,7 @@ try { shown ? JSON.stringify(shown.text.slice(0, 60)) : ''); // live: keep typing and the preview follows - await type('textarea', DRAFT + ' plus a word'); + await type('coinos-text', DRAFT + ' plus a word'); await sleep(900); check('it follows the draft as you type', /plus a word/.test(await page.evaluate(() => (document.querySelector('.draft-preview') || {}).innerText || ''))); |
