notes
All repositories: gitoria
5.8 KB
# Report 010 — notes on the Hybriel MdEditor block (worker W2) — branch w10-mdeditor-theme, NOT pushed, NOT deployed## What changed- `components/md-editor/` (md-editor.hl, README.md) + `components/SOURCE` = components.hybriel **1442e58**, byte-verbatim, by the new`tools/sync-components.sh` (modelled on tickets'; `--check` = "verbatim: 2 files").- `components/notes.hl`: `noteText { id = "notetext" on input(e) { emit typed(e) } MdEditor { name = "text" value = shownText rows = 16 files = "off" placeholder = "" } }`.`typed` ignores events whose `e.target.name != 'text'` (the block's link / file inputs also fire `input`). Everything else (autosave tick,offline queue, conflict copies) untouched. `value = shownText` stays bound: no focus loss, the winner of a conflict shows in the editor.- Removed: `<script src="/md-editor.js">` (main.hl), the `/md-editor.js` route and `offlineFiles = ["/md-editor.js"]` (project.hl),`shared/md-editor.js` (2529 lines), `md-editor::part(button)` and the `mdEditor { --md-* }` rule (styles.hl; the block reads the `--color-*`tokens notes already declares). README / CONCEPT updated.- styles.hl: `.empty` → `p.empty` (the class collision of tickets 021; all 3 uses are `<p class="empty">`); `noteEditor` got`gridTemplateColumns: minmax(0, 1fr)` and `noteText { display: block; min-width: 0 }` — found by the gate: without them the 690 px wide tablewidened the grid and the editor was 690 px on a 390 px phone (tickets 021 fix 4 only covers the toolbar).- No theme move; look otherwise the block's own (18 rem min-height → rows = 16 ≈ 24 em; files off, so no File button).## Parity (each checked in tests/browser.mjs, real keys)tables (typed header + delimiter → table, Tab, Enter, bold/code cells, `\|`, alignment, wide table scrolls in its box at 390, a cell edit changes onlythat cell, byte-for-byte Markdown, reopened from server and offline), heading `# `, bold (Ctrl+B in the E2E), lists, autosave (sidebar subject,server save, conflicts, delete, offline queue). Not re-implemented: `MdEditor.markdown` test API of the old script — two table checks now readthe Markdown lines instead. Not tested by hand: links (Ctrl+K), code block keys (the block's own gate covers them; notes only stores the text).## Proof- `tests/browser.mjs`: old (efa9217) **64/0** → new **66/0**. +2 checks: "no md-editor.js on the page / `/md-editor.js` 404 / no `md-editor` customelement" and "phone 390: editor fits, every toolbar button ≥ 44 px, text ≥ 16 px, no File button". The new tests on the OLD code: 16 passed, **3 failed**(both "no md-editor.js" checks + crash at the editor: no block surface), run with NOTES_GATE_SOFT=1. Test-side changes: shadow-DOM helpers → lightDOM (`#notetext input[name=text]`, `md-editor article`); `editorReady` waits for the surface's children (the block builds them from a 100 msanimation after the page is live); table cell html may carry the block's zero-width space. One earlier run failed once (delete, "one note less") andonce with the caret at the start (a click before the surface was built) — the second was the missing wait, fixed; the first did not reproduce (load).- `tests/realdata-offline.mjs` on the newest backup (notes.worldapi.org-20261020-2229.tgz, 28 notes): **12/0**, 390 px: no overflow, taps ≥ 44. Changes tothe test: block selectors; the toolbar's three scrolled-off buttons are not "wide" (the phone toolbar is one row that scrolls inside its own box, by design).- `tests/e2e-roundtrip.mjs` (new), copy of the same backup, real headless Chrome, all 28 notes: **OPEN** reads all 28 back byte-identical; edit nextto the table (click first paragraph, End, `x`, Backspace) on the one table note in the backup: editor and server text **byte-identical**; the other 27also identical after the edit (0 canonicalised) — **5 passed / 0 failed**. (Only 1 note of the 28 has a table; the check would fail on any difference, I did not mutate it.)- E2E in lisbeth's Chrome: tests/e2e-chrome.mjs, own tunnel `-L 8757:127.0.0.1:9223` and `-R 8758/8759`, ONE existing about:blank tab (put back toabout:blank), no clipboard, copy of the backup, real mouse + key events, at 390 and 1280: list, New note, `# heading`, bold, table, list, wait for theserver save, **reload (same text)**, **offline** (Network.emulateNetworkConditions on page and worker): the note and list open offline, typing works,back online the edit reaches the server, no sideways scroll. **new 24/0, old (live code) 24/0.**- **Finding (block):** in a background tab the block never builds its surface (its mount is a CSS animation; Chrome does not run it): the first runhung on an empty editor until `Page.bringToFront`. Not a bug for users with the tab in front; worth a line in components README.- **Observation, not isolated:** typing a table right after a list (list, Enter Enter, `| Item | Qty |`, Enter, `|:---|---:|`, Enter) stayed plainparagraphs once, in the E2E; table first then list works. No minimal repro made (out of this mission's budget); Atlas may pass it to components.## Shots (20 PNG, not viewable by me — I cannot look at PNGs; the numbers above count)/media/STORAGE/claude-scratch/atlas/W2/shots/{old,new}-{390,1280}-{1-list,2-typed,3-reloaded,4-offline,5-end}.png (20 files).## What changes in layouts docs/usage.md (Atlas)notes moves from "own copy md-editor.js (fork, listed in tools/usage.sh FORKS)" to a user of the MdEditor block: add `components/md-editor/` + SOURCEof notes to the usage table (tools/sync-components.sh, 1442e58) and drop notes' md-editor.js from the retire list / FORKS; notes' theme step stays open;notes keeps `p.empty`, files="off".## CleanupServers, tunnel and Chromes killed by PID; `ss`: nothing of mine on 8732–8759 (the two `hybriel` processes in `pgrep` belong to arachne). Data copies deleted.Scratch: old/ (live code archive), wt/ (branch), logs *.log, pids/.
Branches
Latest commits
- dbf93319N5 report: components gate rerun 613 passed, 0 failedmre
- 3a8bc0d2N5: empty Table-button table is written as a real pipe table (MdEditor 4bd1112, plain copy); gate tests/table-button.mjs; reportmre
- c16bd443N5: step 1 report (tables pass locally; his DASHBOARD note has no delimiter row)mre
- 6091320anotes: MdEditor 7437e32 (surface drawn at once when the page is claimed); gate measures claim-to-text on 5 note loads at 1280 and 390mre
- 0aa9277enotes: move each component's styles into its own Style block (shell and header selector in main.hl, list, editor frame and delete question in notes.hl); styles.hl keeps the theme inherit, the accent and the message colour; .gitignore ignores a bin symlink too; tests/shots.mjs for the pixel comparemre
- 9ba01de3notes: write the standby service out in full so the boot gate can read the main servicemre
- 98cab40anotes: standby service on its port plus 10 and a deploy that hands over through it without a gapmre
- 1fadb473notes gate: the editor table now has 1 px cell lines from the notes thememre
- 8762115cnotes: take the components e54f83a (paste as Markdown, text typed before the editor is built is kept, Table button); table lines come from the notes thememre
- ac23e194ident#31: the selector's sign-in returns to the page the user started on (return attribute = the login callback with next), gate checkmre
- 2804f0d3Merge branch 'iw-ident-widget'mre
- 52d8d242notes: e2e script checks Log out and the selector in the header instead of the user menumre
- e5abf7b7notes header: the selector alone top right plus Log out as before the theme missions; the user icon is gonemre
- a2e343aeident selector back in the header (creator 2026-10-24): selector top right signed in and out on phone and desktop, no second Log in button, new gate checks (WIP: gates not re-run after the last edits)mre
- 7a889b82notes: MdEditor with the Table button, typed pipe rows and the theme's table look (components mt-tables); a table note is named by its header words; gate checks that fail on mainmre
- b96c7f70theme: sync from layouts 4994037 (list rows stack, td word-keep, heading code, edited tap target)mre
- 6140e6a0sessions last 99 years (creator 2026-10-23: logins never expire; only sign out ends them)mre
- cb7e6469deploy: security gate (tests/security.mjs)mre
- 774bf34bnotes security: CSRF guard on /api/notes, new session at login, Secure cookie, uploadMax 0, login rate limit, nosniff, face payload check; tests/security.mjs; SN reportmre
- ef18a68fsync components.hybriel 214c318: MdEditor on a phone, two even toolbar rows of 44 px targets, label 15 px, table head 16 px (E2)mre