gitoria

tickets

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Main branchmain5d144817Merge branch 'records-t40' into mainTicketsmain/reports/PV-paste.md

5.1 KB

  1. # PV-paste — tickets#49 "i cant do ctrl + v in the md wysiwyg on tickets" (step 1 report; no fix built yet)
  2. ## What I did
  3. Tickets main (2e1b116) ran locally on port 8740 on a copy of the 2026-10-26 09:14 deploy backup, with an az5b2 session in the copy.
  4. Headless Chrome on loreana (own profile, port 8745), at 1280 and 390 px. The clipboard was filled with the browser's Clipboard API
  5. (real clipboard, only the types I chose), then a real Ctrl+V was sent through the Input domain (rawKeyDown with the paste command), after a real click into the editor.
  6. ## Result
  7. 1. **Plain text only on the clipboard (text/plain, no HTML): it pastes and is saved.** In the comment editor of a ticket, the New ticket modal,
  8. the ticket's Edit form (summary), and in Markdown source mode, at 1280 and 390. Hidden field value was right every time
  9. (comment-new / summary). One line, several lines, CR LF, URL, `<b>` text, tabs, a "# head / - list" text: all inserted, no console error.
  10. Pasting straight after load (0 ms wait) worked too. So **I could NOT reproduce "nothing happens" with a text-only clipboard.**
  11. 2. HTML + plain on the clipboard: pastes as plain text, as designed.
  12. 3. **Reproduced: text/plain AND an image (image/png) on the clipboard at once: NOTHING is inserted.**
  13. - New ticket modal and ticket Edit (files = "off"): the editor stays empty, no error. Field value stays "".
  14. - Comment form (files = "on"): the text is not inserted either; the image is taken as an attachment instead.
  15. Clipboards like this come from many apps (Office, some chat clients and PDF viewers put a bitmap next to the text).
  16. ## Cause (file:line, components/md-editor/md-editor.hl, identical in tickets, notes and components main)
  17. `on mdPaste(e)`, lines 1813-1817:
  18. ```
  19. if (e.clipboardData.files.length > 0) {
  20. if (root.getAttribute('data-files') != 'off') { attach(root, e.clipboardData.files, null) }
  21. return null
  22. }
  23. ```
  24. If the clipboard holds any file (an image next to the text), the handler returns before it ever reads text/plain (line 1833).
  25. With files="off" it then does nothing at all; with files="on" it attaches the picture and drops the text.
  26. `e.preventDefault()` was already called at line 1810, so the browser does not paste either.
  27. ## Served code
  28. Live https://tickets.worldapi.org serves /components/md-editor/md-editor.hl with the same size (226490 bytes) and checksum (bb4f5382) as tickets main,
  29. so live has exactly this code. Tickets' copy is older than components main (4bd1112/7437e32 not in it); the paste handler is the same in both.
  30. notes' copy equals components main (258729ea); layouts and tickets share 84dd9f30. All four carry the same lines.
  31. ## Open point (why I stopped before building)
  32. I cannot tell whether his clipboard held an image. His sentence says only plain text copied elsewhere. If it did not, the cause is something I could not
  33. reproduce in headless Chrome (possible: his browser or OS, or a clipboard with a different file type). Two readings of the fix when text and files are both there:
  34. (a) the text always wins, files only when there is no text; (b) text wins only where files = "off", files = "on" keeps attaching.
  35. Atlas / caramboleyo to choose, ideally after he says what he copied from (and in which browser). A red-first gate for either: text/plain + image/png on the clipboard, real Ctrl+V, text must appear.
  36. ## Not done
  37. Notes was not run (same code, same lines). Step 2 (fix, copies, gates) not started.
  38. ## Processes
  39. Tickets server PID 595294 (stopped), headless Chromes (stopped each run, profile dirs removed). Nothing left; ports 8740-8759 free.
  40. Scratch: /media/STORAGE/claude-scratch/atlas/PV (js/paste.mjs is the repro; worktrees twt, cwt on branch pv-paste, no commits).
  41. About 45 requests.
  42. # Step 2 — fix (reading (a): text on the clipboard is always pasted)
  43. - components branch pv-paste, commit b0f1ec2 (on main with 4bd1112): `mdPaste` now reads text/plain first; files are taken only when there is NO text. Nothing else in the file touched.
  44. - Gate tests/md-paste-files.mjs (components and tickets): real click, Clipboard API fills text+image, real Ctrl+V, at 1280 and 390.
  45. RED on main: components demo editor (3 FAIL x2 widths: the picture became ![image.png](...) and the text was lost), tickets comment form and New ticket modal (2 FAIL x2). GREEN with the fix: 0 failed in all three places.
  46. Also checked: text+html still pastes; picture alone still attaches where files are "on" (comment form: picked file; demo: ![...]); picture alone with files "off" inserts nothing.
  47. - Full gates: components 613 passed, 0 failed; tickets 453 passed, 0 failed.
  48. - tickets copied with tools/sync-components.sh from b0f1ec2 (SOURCE updated). Beyond the fix this carried: 626de19 (copy/cut put Markdown on the clipboard, HTML-only paste), 7437e32 (surface drawn at once), 4bd1112 (Table button), md-editor README (2 lines), icons.hl (16 lines).
  49. - notes (SOURCE 4bd1112): a copy carries ONLY the fix (8 changed lines). layouts: the fix plus 7437e32, 4bd1112 and the README (21 lines in md-editor.hl, 2 in README); its comments, files-upload and icons are already identical. Not copied.
  50. - Stopped: components servers PID of c-old/c-new, gate servers and Chromes; no push, no deploy.

Branches

Latest commits

  • 5d144817Merge branch 'records-t40' into mainTickets
  • 44ee6f06|||PR records: #43 #45 livemre
  • b8fdeee9Merge branch 'p39-routes' into mainTickets
  • a0187a0a|||PR Remove redundant route-order loopmre
  • 369e4b9cMerge branch 'k40-lists' into mainTickets
  • 9af8e780|||PR Use keyed list mutations for live ticket updatesmre
  • 610d8e8aMerge branch 'records-t39' into mainTickets
  • 32bcdf24|||PR records: GO P39 K40mre
  • 4123c6d1Merge branch 'records-t38' into mainTickets
  • cd3641a1|||PR records: day72 deploy live, tickets closedmre
  • 7d44d852Merge branch 'records-t37' into mainTickets
  • 926f7061|||PR records: merges, D36 deploymre
  • bf58534eMerge branch 'l33-final' into mainTickets
  • 759a9ac3|||PR thin login (tickets#46, #45): merge main, route entry cleanupmre
  • 239436d8Merge remote-tracking branch 'origin/main' into l33-finalmre
  • 5822cb3aMerge branch 'o34-clean' into mainTickets
  • 0870653c|||PR offline note from __hlOnline, no polling (tickets#41)mre
  • 14cf96b4Merge branch 'records-t36' into mainTickets
  • 07749fa1|||PR records: day72 + #40 mergedmre
  • ecd7e226|||PR Consolidate login and move handler logic into topic libraries (partial)mre