tickets
All repositories: gitoria
5.1 KB
# PV-paste — tickets#49 "i cant do ctrl + v in the md wysiwyg on tickets" (step 1 report; no fix built yet)## What I didTickets 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.Headless Chrome on loreana (own profile, port 8745), at 1280 and 390 px. The clipboard was filled with the browser's Clipboard API(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.## Result1. **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,the ticket's Edit form (summary), and in Markdown source mode, at 1280 and 390. Hidden field value was right every time(comment-new / summary). One line, several lines, CR LF, URL, `<b>` text, tabs, a "# head / - list" text: all inserted, no console error.Pasting straight after load (0 ms wait) worked too. So **I could NOT reproduce "nothing happens" with a text-only clipboard.**2. HTML + plain on the clipboard: pastes as plain text, as designed.3. **Reproduced: text/plain AND an image (image/png) on the clipboard at once: NOTHING is inserted.**- New ticket modal and ticket Edit (files = "off"): the editor stays empty, no error. Field value stays "".- Comment form (files = "on"): the text is not inserted either; the image is taken as an attachment instead.Clipboards like this come from many apps (Office, some chat clients and PDF viewers put a bitmap next to the text).## Cause (file:line, components/md-editor/md-editor.hl, identical in tickets, notes and components main)`on mdPaste(e)`, lines 1813-1817:```if (e.clipboardData.files.length > 0) {if (root.getAttribute('data-files') != 'off') { attach(root, e.clipboardData.files, null) }return null}```If the clipboard holds any file (an image next to the text), the handler returns before it ever reads text/plain (line 1833).With files="off" it then does nothing at all; with files="on" it attaches the picture and drops the text.`e.preventDefault()` was already called at line 1810, so the browser does not paste either.## Served codeLive https://tickets.worldapi.org serves /components/md-editor/md-editor.hl with the same size (226490 bytes) and checksum (bb4f5382) as tickets main,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.notes' copy equals components main (258729ea); layouts and tickets share 84dd9f30. All four carry the same lines.## Open point (why I stopped before building)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 notreproduce 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:(a) the text always wins, files only when there is no text; (b) text wins only where files = "off", files = "on" keeps attaching.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.## Not doneNotes was not run (same code, same lines). Step 2 (fix, copies, gates) not started.## ProcessesTickets server PID 595294 (stopped), headless Chromes (stopped each run, profile dirs removed). Nothing left; ports 8740-8759 free.Scratch: /media/STORAGE/claude-scratch/atlas/PV (js/paste.mjs is the repro; worktrees twt, cwt on branch pv-paste, no commits).About 45 requests.# Step 2 — fix (reading (a): text on the clipboard is always pasted)- 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.- Gate tests/md-paste-files.mjs (components and tickets): real click, Clipboard API fills text+image, real Ctrl+V, at 1280 and 390.RED on main: components demo editor (3 FAIL x2 widths: the picture became  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.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.- Full gates: components 613 passed, 0 failed; tickets 453 passed, 0 failed.- 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).- 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.- Stopped: components servers PID of c-old/c-new, gate servers and Chromes; no push, no deploy.
Branches
Latest commits
- 090ee809tickets: every component's styles in its own nested Style {} block; styles.hl keeps only the theme inherit, the accent and the site-wide rules (tickets#36)mre
- d395763ftickets: ident-access gate ports 8769/8768 (8797 is taken on loreana)mre
- afb9a403tickets: an ident access key (Authorization: Bearer idt_…) works in the API (ident#27 app side): lib/ident-access.hl copied from components, read keys GET only, ident down 503; gate tests/ident-access-tickets.mjsmre
- 48c1ba79tickets: md-paste-files gate with the file manager casesmre
- f04afc43tickets: MdEditor from components 59704ce (a file manager copy still attaches, pipe rows, tickets#49)mre
- 06599fa0tickets: MdEditor from components b0f1ec2 (a clipboard with text always pastes the text, tickets#49); real Ctrl+V gatemre
- 2e1b116ftickets: re-vendor Hybriel master acaceaf3 (framework ec8d6c1d): plugins/web patch queue while a page is built, anonymous session cookies refresh; gate waits for the comment editors to draw (W174) and clicks the form editor when it stands still; security gate: main's code runs on its own binary, lazy-session cookie checksmre
- 361bc0fetickets: re-vendor Hybriel 7a684920 (WIP, not deployed); on Error exits 1 at startup; migrate passes its log by reference; gate checks follow lazy sessions and the 413 refusalmre
- 8a69999cident#28: /login/callback never signs out the session it finds; a valid code puts the user on the same sessionmre
- 337e9b21tickets#37: a comment's files are open to everyone who can read the commentmre
- 1800600ftickets: write the standby service out in full so the boot gate can read the main servicemre
- 8179d287tickets: standby service on its port plus 10 and a deploy that hands over through it without a gapmre
- 0398145ctickets: the table grid rule is marked functional for check-thememre
- 40fddc20tickets takes components e54f83a: tables get thin grey lines from the theme, desktop toolbar stays one row with the Table button, F4 check counts 11 buttonsmre
- c1b77d61tickets#35: text typed before the editor is built is taken in once by the build (the input handler no longer writes it to the field first, which doubled the first letters); the gate failure shows the surfacemre
- 32bf1873tickets#35: the gate types right after the load with the CPU slowed, no waitingmre
- 64ea9ca2tickets#35: text typed into the reply editor before the page has finished starting is kept; the gate types right after loadmre
- ccd3a327tickets: the security gate expects frame-src to be exactly the ident address (the sign-in frame), still no wildcard or selfmre
- 4348dbabident#31: the selector's sign-in returns to the page the user started on (return attribute = the login callback with next), gate checkmre
- 66ef3005Merge branch 'iw-ident-widget'mre