gitoria

notes

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit0bbb3dd90bbb3dd9notes mission 012: delete section of the browser gate de-flaked (openAsk: calm wait, press again when the question closes by itself); report 012mre0bbb3dd9/reports/010-mdeditor.md

5.8 KB

  1. # Report 010 — notes on the Hybriel MdEditor block (worker W2) — branch w10-mdeditor-theme, NOT pushed, NOT deployed
  2. ## What changed
  3. - `components/md-editor/` (md-editor.hl, README.md) + `components/SOURCE` = components.hybriel **1442e58**, byte-verbatim, by the new
  4. `tools/sync-components.sh` (modelled on tickets'; `--check` = "verbatim: 2 files").
  5. - `components/notes.hl`: `noteText { id = "notetext" on input(e) { emit typed(e) } MdEditor { name = "text" value = shownText rows = 16 files = "off" placeholder = "" } }`.
  6. `typed` ignores events whose `e.target.name != 'text'` (the block's link / file inputs also fire `input`). Everything else (autosave tick,
  7. offline queue, conflict copies) untouched. `value = shownText` stays bound: no focus loss, the winner of a conflict shows in the editor.
  8. - Removed: `<script src="/md-editor.js">` (main.hl), the `/md-editor.js` route and `offlineFiles = ["/md-editor.js"]` (project.hl),
  9. `shared/md-editor.js` (2529 lines), `md-editor::part(button)` and the `mdEditor { --md-* }` rule (styles.hl; the block reads the `--color-*`
  10. tokens notes already declares). README / CONCEPT updated.
  11. - styles.hl: `.empty` → `p.empty` (the class collision of tickets 021; all 3 uses are `<p class="empty">`); `noteEditor` got
  12. `gridTemplateColumns: minmax(0, 1fr)` and `noteText { display: block; min-width: 0 }` — found by the gate: without them the 690 px wide table
  13. widened the grid and the editor was 690 px on a 390 px phone (tickets 021 fix 4 only covers the toolbar).
  14. - No theme move; look otherwise the block's own (18 rem min-height → rows = 16 ≈ 24 em; files off, so no File button).
  15. ## Parity (each checked in tests/browser.mjs, real keys)
  16. tables (typed header + delimiter → table, Tab, Enter, bold/code cells, `\|`, alignment, wide table scrolls in its box at 390, a cell edit changes only
  17. that cell, byte-for-byte Markdown, reopened from server and offline), heading `# `, bold (Ctrl+B in the E2E), lists, autosave (sidebar subject,
  18. server save, conflicts, delete, offline queue). Not re-implemented: `MdEditor.markdown` test API of the old script — two table checks now read
  19. the 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).
  20. ## Proof
  21. - `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` custom
  22. element" 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**
  23. (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 → light
  24. DOM (`#notetext input[name=text]`, `md-editor article`); `editorReady` waits for the surface's children (the block builds them from a 100 ms
  25. animation 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") and
  26. once 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).
  27. - `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 to
  28. the 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).
  29. - `tests/e2e-roundtrip.mjs` (new), copy of the same backup, real headless Chrome, all 28 notes: **OPEN** reads all 28 back byte-identical; edit next
  30. to the table (click first paragraph, End, `x`, Backspace) on the one table note in the backup: editor and server text **byte-identical**; the other 27
  31. also 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.)
  32. - 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 to
  33. about:blank), no clipboard, copy of the backup, real mouse + key events, at 390 and 1280: list, New note, `# heading`, bold, table, list, wait for the
  34. server save, **reload (same text)**, **offline** (Network.emulateNetworkConditions on page and worker): the note and list open offline, typing works,
  35. back online the edit reaches the server, no sideways scroll. **new 24/0, old (live code) 24/0.**
  36. - **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 run
  37. hung on an empty editor until `Page.bringToFront`. Not a bug for users with the tab in front; worth a line in components README.
  38. - **Observation, not isolated:** typing a table right after a list (list, Enter Enter, `| Item | Qty |`, Enter, `|:---|---:|`, Enter) stayed plain
  39. paragraphs 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.
  40. ## Shots (20 PNG, not viewable by me — I cannot look at PNGs; the numbers above count)
  41. /media/STORAGE/claude-scratch/atlas/W2/shots/{old,new}-{390,1280}-{1-list,2-typed,3-reloaded,4-offline,5-end}.png (20 files).
  42. ## What changes in layouts docs/usage.md (Atlas)
  43. 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/` + SOURCE
  44. of 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;
  45. notes keeps `p.empty`, files="off".
  46. ## Cleanup
  47. Servers, 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.
  48. Scratch: old/ (live code archive), wt/ (branch), logs *.log, pids/.

Branches

Latest commits

  • 0bbb3dd9notes mission 012: delete section of the browser gate de-flaked (openAsk: calm wait, press again when the question closes by itself); report 012mre
  • f431bdf8notes mission 011: notes on the layouts theme (ListFirst shell), styles cut, check-theme gate, E2E extended; reportmre
  • 1a8603d1notes mission 011 WIP: deploy.sh gate summary also matches check-theme, browser.mjs logout via the user menumre
  • dae2e508notes mission 011 WIP: theme dbe3de7, shell on AppHeader/MainMenu/UserMenu/Sidebar + ListFirst, styles cut to the app's own, check-theme gate, e2e auditmre
  • fd36da27notes mission 010: the note editor is the Hybriel MdEditor block (components.hybriel 1442e58, verbatim); md-editor.js, its route, script tag and offlineFiles retired; gate 66/0, realdata-offline 12/0, round-trip and Chrome E2E tests; report 010mre
  • efa92170notes tests/identkit.mjs: refuse a taken ident port, cold-wait deadline, emit, identities; mission 009 reportmre
  • f3dec0f1Merge branch 'w7'mre
  • d1cf966dre-vendor hybriel 97bcf128: offlineFiles for the editor script, 44 px taps, 390 px offline checks, mission 008mre
  • 4a610a21paths: projects moved into /media/STORAGE/projects/WorldAPI/mre
  • eeaea980report 007: say which runs included the removed checkmre
  • 8a8ad9banotes mission 007: report, LOG, STATUSmre
  • 2cce9c96code order: plain declarations where never reassigned (letcount 0 never); gate: scan every IndexedDB at log-out, soft mode for old-code runs, drop a check that could not failmre
  • 7f6a4090README: offline in Hybriel (hl:web offline, continuation, known md-editor gap); gate waits report instead of crash; realdata-offline checkmre
  • 632223f2notes#4: delete notes-offline.js and sw.js (hl:web's generated worker and kept state replace them)mre
  • 52a2acadgate: offline checks on hl:web's worker/queue, Chrome offline via CDP (reload offline first), one-offline conflict, log-out forgets the kept copymre
  • e5785b03notes#4: the notes page in Hybriel — hl:web offline = [Notes], queued faces notesPut/notesDrop, push notesChanged, value-form notesPull on a tick; notes-offline.js/sw.js no longer loaded or routedmre
  • 510aff75notes#4: server continues a run of saves of one login (by + since), loser keeps writing into its copy; notesFor listmre
  • 0176c4b5mission brief 007mre
  • 06cfa870notes mission 006: re-vendor hybriel 0f396652 (static), reportmre
  • 6c07bd91mission brief w6mre