gitoria

notes

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Branchhl-standard452458ee|||PR Type the function parameters of notes' own .hl files (HL-STANDARD L10)Atlashl-standard/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

  • 452458ee|||PR Type the function parameters of notes' own .hl files (HL-STANDARD L10)Atlas
  • 23758cd6Re-vendor complete Hybriel plugins and runtime to day44mre
  • 5d7cc700Backup tar: --hard-dereference, so mpackdb sidecars are never stored as hard links (Tracker's finding)mre
  • 3e07b1cfVendor complete Hybriel day39 plugin sources and librariesmre
  • d7366702Check session cookie flags after login and assert anonymous GET stays cookielessmre
  • 16bc8fd8Re-vendor Hybriel day38b with the mpackdb store-open race fixmre
  • d860dc2dnotes#12: the markup names its own rules instead of hand-written class strings: the selected row is `aria-current="page"` (the list-first theme rule styles it, no class), the delete question is `Style.pAsk` and follows its own `open` attribute (bound to `asking`), the error line is `Style.pMessage` (body once in lib/looks.hl, rule in notes.hl, main.hl and loginfailed.hl). The CSS declarations are the same, only selectors changed (.ask -> p.ask, .ask.open -> p.ask[open], .message -> p.message); the pages look the same (AE 0 at 4 sizes). main.hl's selectorClass in/out stays (login.js reads it).mre
  • 2e7f8664notes#13: the list and back links pass the note key from the loop (emit pick(e, r.key)) instead of writing data-note into the View and reading it back with getAttribute; the two window.history.replaceState calls and the identcode e.target.value read stay (hl:web has no replace-navigation, a bound hidden input is not adopted on a script's change event), see NO13 reportmre
  • 4dc98282notes#15: a deleted note made in this tab leaves the list at once (the delete now removes this tab's edit under every key the row has: local id, server id); gate: browser.mjs notes#15 section, red on the old codemre
  • e4e7402fnotes#11: plain declarations instead of let for variables never reassigned (components/notes.hl 3, lib/jsoncheck.hl 5, lib/util.hl 2, tools/migrate-short-ids.hl 8)mre
  • 27b6a09enotes#8: Style blocks in the nested form (note-list, note-editor, .ask with their children nested, :empty as a nested pseudo-class); the same CSS rules, the pages look the samemre
  • 71a9538bnotes: B27W report, log linemre
  • 78ba0073notes: an ident access key (Authorization: Bearer idt_…) reads and writes its identity's notes through /api/me and /api/notes; gate tests/ident-access-notes.mjs (ident#27)mre
  • 3de46dacnotes: the sign-in callback keeps the session it finds and signs it in (same cookie, nothing signed out; ident#28); security gate 73+5 failing → 78 passedmre
  • 5909d458notes: MdEditor from components 59704ce (text on the clipboard always pastes, a file manager copy still attaches; pipe rows without a delimiter row; tickets#49, notes#5)mre
  • 98bd6a98N5b: pipe rows without a delimiter row are a table (MdEditor ad4e929, plain copy); gate tests/dashboard-table.mjs; reportmre
  • 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