gitoria

components

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit51c3818751c38187Gate media autoplay on first load and after client mountmre51c38187/README.md

18.7 KB

  1. # components.hybriel.worldapi.org
  2. Hybriel components, developed standalone (CONCEPT.md). The home lists them; each component has a demo page, a README
  3. and a browser gate. Apps vendor a component by copying its folder. https://components.hybriel.worldapi.org
  4. ## Components
  5. | Component | Demo | README |
  6. |-----------|------|--------|
  7. | Icons | `/icons` | `components/icons/README.md` (also `/icons/README.md`) |
  8. | Month view | `/month-view` | `components/month-view/README.md` (also `/month-view/README.md`) |
  9. | Date picker | `/date-picker` | `components/date-picker/README.md` (also `/date-picker/README.md`) |
  10. | Date range picker | `/range-picker` | `components/range-picker/README.md` (also `/range-picker/README.md`) |
  11. | Pagination | `/pagination` | `components/pagination/README.md` (also `/pagination/README.md`) |
  12. | Markdown editor | `/md-editor` | `components/md-editor/README.md` (also `/md-editor/README.md`) |
  13. | Code editor | `/code-editor` | `components/code-editor/README.md` (also `/code-editor/README.md`) |
  14. | File upload | `/file-upload` | `components/file-upload/README.md` (also `/file-upload/README.md`) |
  15. | File upload, several files | `/files-upload` | `components/files-upload/README.md` (also `/files-upload/README.md`) |
  16. | … pick first, send later (chat attachments) | `/files-upload/pick` | the same README, "Pick first, send later" |
  17. | Modal | `/modal` | `components/modal/README.md` (also `/modal/README.md`) |
  18. | Comments | `/comments` | `components/comments/README.md` (also `/comments/README.md`) |
  19. The Markdown editor takes files and images (drop, paste, File button) through `emit server mdUpload` (hybriel#94) and makes GitHub pipe tables (mission 004, creator notes#5: typed, pasted, Tab between cells — `components/md-editor/README.md` "Tables"). The one-file upload (`components/file-upload/`, ticket #4) sends its file through `emit server saveFile` (hybriel#94); the upload for several files (`components/files-upload/`, ticket #5, mission 005) sends each file through `emit server uploadFile`, one after the other, every file in its own row with its progress; with `mode = "pick"` (ticket #18, mission 008, for HyperConductor's
  20. chat attachments hycon#46) it only COLLECTS dropped, chosen, pasted (Ctrl+V) or photographed files — thumbnails, name + size rows, ✕,
  21. a per-file `maxSize` — and the host owns the list (`files = attached`, `onChange`), sends it with its own face at Send and empties it;
  22. the host's text field and Send sit inside the component, so a paste there is caught. The Pagination tells its host the target page through a function the host hands it, `onPage` (ticket #16, hybriel#87). The comments block (`components/comments/`, layouts#2, mission 006) shows the list and user its host passes, hears post / edit / delete / like the same way (`onPost`, `onEdit`, `onDelete`, `onLike`), types in the MdEditor and draws every text with it (`readonly = "true"`); it needs `components/md-editor/` beside it.
  23. ## Look (ticket #15, mission 003)
  24. The library is generic: every component renders in a neutral **base look** — black, white and four greys for nuances, no app's
  25. palette, no decorative frames. Light by default (white page, black text): it is the plain look of a document, and a theme can turn
  26. it dark without the base fighting it. The values are named once in `shared/base.hl`:
  27. | name | value | used for |
  28. |------|-------|----------|
  29. | `black` | `#000` | text, the selected day / current page / main modal button (white on black), today's ring, the site header |
  30. | `greyDark` | `#555` | muted text, line numbers, syntax (keywords, strings, comments in italics), focus rings, the dim page behind a modal |
  31. | `grey` | `#999` | functional lines only: the drop zone's dashed border |
  32. | `greyLight` | `#ddd` | a strip or block on a field: editor toolbar, code, gutter; hover on a day tile; the days of a range |
  33. | `greyLighter` | `#f2f2f2` | fields and tiles on the white page: inputs, editors, day cells; hover on white |
  34. | `white` | `#fff` | the page, popups, the modal window, text on black |
  35. - A component's browser module cannot import `base.hl`, so each component writes the value as the FALLBACK of the semantic WorldAPI
  36. token: `var(--color-text, #000)`. A bare copy (no tokens) shows the base look; an app that declares the tokens — layouts.worldapi.org's
  37. `theme/theme.hl` — restyles it. **The token names, elements and classes stay as they are** (the theme targets them).
  38. - No frames: a border or ring only where it means something — focus ring (`#555`), today (`#000`), an invalid field (dashed),
  39. the drop zone (dashed `#999`). A floating popup separates by a soft black shadow, the modal by the dimmed page.
  40. - The site itself (`components/styles.hl`) uses the base names and declares **none** of the WorldAPI tokens, so the showcase shows
  41. each component exactly as a bare copy looks. Header black, page white; icon white blocks on black (`icons/`).
  42. - Gate: the `base look:` checks in `tests/browser.mjs` — every colour in the 11 public files is a base value; on the home + 10 demos +
  43. open date popup + open modal at 1280 and 390 px: no `--color-…` on `:root`, white page / black text, every computed colour
  44. (text, background, visible border, outline, caret, accent, text decoration, shadow, `::backdrop`) is a grey (r = g = b), and no
  45. visible border inside a component except the drop zone. Screenshots `.scratch/gate-bw-<page>-<width>.png` — LOOK at them.
  46. - Chrome quirk found on the way: when a `<strong>`'s colour equals the text around it, Chrome's `insertHTML` writes it inline
  47. (`<strong style="color: …">`); `md-editor.hl` `inlineRule` removes every `style` attribute from the surface after it inserts.
  48. ## Layout
  49. - Code order (antcolony docs/code-order.md, mission 002): `project.hl` is the MAP (its head comment says which file handles what) +
  50. config + routes, no functions; no other `.hl` in the root; `let` only for a variable that is reassigned
  51. (`python3 tests/letcount.py .` → "never reassigned 0"; kept: reassigned, loop body, a member's name, declared twice in one function).
  52. - `project.hl` routes · `components/styles.hl` the site's page layout only (colours from `shared/base.hl`, see "Look") ·
  53. `components/main.hl` shell · `components/index.hl` the home · `components/<name>/` one folder per component (component, demo,
  54. README) · `lib/comments.hl` the comments demo's mock thread (kept in the page) · `lib/uploads.hl` where the demos keep uploaded files (one day; the demos' `on server` handlers only call it).
  55. - **Public**: `components/<name>/<name>.hl` (+ `clock.hl`, READMEs) are what apps copy and what layouts.worldapi.org's `theme/theme.hl`
  56. styles (`html <element>` rules) — never rename them, their elements or classes; layouts keeps verbatim copies in its `components/`.
  57. - To add a component: its folder, a demo route + a README route in `project.hl`, one entry in `components/index.hl`, a line in the
  58. project.hl map, its own `Style` in its file, checks in `tests/browser.mjs`.
  59. - **RV41: re-vendored to Hybriel set day41** (2026-11-04; SOURCE `57054d9e11329a5e2cfc83124030b563d4a5276a`, binary SHA-256 `e9911159fc2858d78016032fd350c4f4a1b51e51c1830c3949181e7ab3337f59`). SHA256SUMS verified. Untracked `bin/` contains set bin/ plus lib/. Every existing plugin directory is from git archive `57054d9e`, with its .so files from the checked set. File-by-file comparison: 113 files, 0 differ. No local patch. day41 brings hybriel#303 (unchanged attribute no longer rewritten, so components#26 is gone), #302 (full HTML Boolean attribute list), #304 (named `on ended = finish`), #299.
  60. - **RV39: re-vendored to Hybriel set day39** (2026-11-03; SOURCE `51e921d7de72ebe3ba4d0febdcc32e9a9084b178`, binary SHA-256 `6b481aa717128a5e2a35f0652606fbeed422227ed7f32c3a6fb26f3d859cd78f`). SHA256SUMS verified. Untracked `bin/` contains set bin/ plus lib/. Every existing plugin directory, including README, is from git archive `51e921d7`, with its .so files from the checked set. File-by-file comparison: 106 files, 0 differ. No local patch.
  61. - **RV38: re-vendored to Hybriel set day38b** (2026-11-03; SOURCE `1e554d758497e16ee535ff71ee1b9c01051cef67`, binary SHA-256 `5ff2a46db81ef88fd7a72a3c32c3d67ca1faff7bfed60587341d2307b10b6e96`). SHA256SUMS verified. Untracked `bin/` contains the set bin/ plus lib/. Core and web sources, including README, come from git archive 1e554d75; other plugin sources are retained with the set .so files. This includes the mpackdb store-open race fix.
  62. - **CS23: re-vendored to Hybriel set day35** (2026-10-31; source commit `cb9e480d`, `bin/hybriel` sha256 `4bb25cfa94dd…`, from `/media/STORAGE/claude-scratch/anton/set-day35`, checked with its SHA256SUMS). `bin/` (not in git) is the set's `bin/` plus its `lib/` (`hlc.o`, `libhlrt.a`, `hlrt/`); `plugins/core` and `plugins/web` are the source of `cb9e480d` (web gains `viewserver.hl`), the other plugin dirs are the same as before with the set's `.so` (identical). The earlier paragraphs below describe older vendorings. Gate `COMPONENTS_GATE_PORT=8800 COMPONENTS_GATE_CHROME=8801-8809 node tests/browser.mjs` 613 passed / 0 failed on day35.
  63. - **Mission 007: re-vendored to the shared static build 0f396652** (built 2026-10-19; `bin/hybriel` sha256 `60fa02f341ffa799b41a3dbd26d76057169f786e20dae0f98bb2ca3c46c39080`,
  64. statically linked; source `/media/STORAGE/claude-scratch/vendor-0f396652`; plugins now also fetch + mpackdb). Gate 324/0 on old and new. The paragraph
  65. below describes the earlier a832f73b vendoring (its build notes still hold).
  66. - `bin/hybriel` + `plugins/` (core crypto data fs http http1 proc time web) were vendored = hybriel **master a832f73b**
  67. (2026-10-18, mission 004: the compiler era — hybriel compiles the app at its start: this site cold 22.2 s, warm 0.9 s on Loreana;
  68. 332 incremental build (BuildCache), one-file hybriel (`--carry-lib`: the binary alone, no libhlrt.a beside it), `HL_CACHE_DIR`,
  69. #151 run cache counts only what a listing was read for; #146/#147 since 9f912f3b). Built read-only:
  70. `git -C /media/STORAGE/projects/hybriel archive a832f73b | tar -x -C .scratch/w004/hyb-a832`, `HL_NO_PLUGINS=1 bash native/build.sh`
  71. (53 s), bin sha256 `e1b53f7ce687f5afbe3db34bcda69958f56e730571e4841923c9c8eb3d272db9`; the nine plugins copied from that archive
  72. (their committed `.so`). Previous copy (06617221) in `.scratch/pre-004/`. **Starts wait ≥ 120 s**: the gate and `tests/same-output.mjs`
  73. wait `COMPONENTS_COLD_MS` (default 120000) for every server start; `deploy.sh` waits `DEPLOY_URL_WAIT` (120 s) for the URL; the
  74. container keeps the build cache on the named volume `hybriel-cache` (`HL_CACHE_DIR=/cache`) with `/tmp` a tmpfs
  75. (docker-compose.yml, as tickets b50a6f9). Gate `COMPONENTS_GATE_PORT=8720 COMPONENTS_GATE_CHROME=8721-8729 node tests/browser.mjs`
  76. → 230/0 on the old app code (also with an empty `HL_CACHE_DIR`, every start cold), 252/0 with the tables.
  77. Before: master 06617221
  78. (2026-10-03, antcolony mission 074: plugin allocators 3a781359 + 413f60e4 (#126), http1 773de63e (request owns its parse —
  79. uploads no longer retained), mpackdb 2cb7ae5e, f0ac2d2d (plugin ABI field — bin and .so must match); no lambda semantics change;
  80. sha256 `21059cc7…d77bdb`, built the same way from `git archive 06617221`; previous copy (190aa11d) in `.scratch/pre-074/`. Gate
  81. `COMPONENTS_GATE_PORT=8760 COMPONENTS_GATE_CHROME=8761-8769 node tests/browser.mjs` → 220/0. Memory: `LOADS=N UPLOADS=N [IDLE=s]
  82. node .scratch/w074/memtest.mjs <vendor dir with bin/+plugins/> <label>` (port 8760, Chrome 8761–8769; needs the live storage copy in
  83. `.scratch/w074/live/storage`, deleted after the run): 2000 loads 184 → 205 MB flat, 400 × 1 MiB uploads level at ~363–403 MB
  84. (old 190aa11d: +1 MB per upload, 829 MB).
  85. Before: master 190aa11d (2026-10-02, antcolony mission 072: fc838894 GC correctness (string index / plugin error read freed memory), 038d84b3 #126
  86. returned closure scopes, #127 d98926c6/04df4428; no lambda semantics change since 8efba065), sha256 `860f5e61…0a23626`,
  87. built read-only from `git archive 190aa11d`; previous copy (8efba065) in `.scratch/pre-072/`. Gate
  88. `COMPONENTS_GATE_PORT=8720 COMPONENTS_GATE_CHROME=8721-8729 node tests/browser.mjs` 220/0. Memory:
  89. `node .scratch/w072/memtest.mjs <vendor dir> <label>` (port 8720, Chrome 8721-8728; LOADS/UPLOADS/IDLE; needs the live
  90. storage copy in `.scratch/w072/live/storage`, deleted after each run — re-tar it): 200 loads new 182 → 205 MB (old 288 → 353);
  91. uploads still retain RAM: 400 × 1 MiB new 185 → 751 MB (old 8efba065 277 → 713 MB, HWM 823), nothing freed after 60 s idle.
  92. Before: master 8efba065 (2026-10-02, antcolony mission 069: #126 the collector also runs by bytes — memory is freed now; #48 a lambda PARAMETER
  93. COPIES its argument like a method does, write `(&p) =>` when the caller must see the change; #112 #117 #119 #120 opt-in, not
  94. used; earlier: #113, #115/#116, #118, SVG namespace, #111, #103–#106, #94, #83 hashed URLs, #82).
  95. Built from a read-only `git archive master` with `zig build -Doptimize=ReleaseFast -Dtarget=x86_64-linux-gnu.2.39` in
  96. `native/`; binary sha256 `231fb9f2…395546fc6`. **No local patch**: a re-vendor = copy binary + plugins (the ones listed;
  97. the build also refreshes their `.so`), run the gate. Previous copy: `.scratch/pre-069/` (master ff51cf46).
  98. - **#48 lambda rule**: the app has 5 lambdas (`python3 .scratch/w069/lambdas.py` / `lambdas2.py` list them and flag writes
  99. to parameters); none writes to a parameter, so none needs `&`. Components are methods / faces, which already copied.
  100. Probe: `bin/hybriel .scratch/w069/probe48.hl` → `copy: n=1 len=0` = #48 active.
  101. - **Memory check** (RSS of one server, live storage copy, 200 loads of the 9 pages + 100 file-upload drops of 1 MiB):
  102. `node .scratch/w069/memtest.mjs <dir with bin/ + plugins/> <label>` (port 8730, Chrome 8722–8729; env LOADS, UPLOADS,
  103. IDLE; it copies the app without .env into `.scratch/w069/mem-<label>/` — copy the live `storage/` to
  104. `.scratch/w069/live/storage` first, delete both afterwards).
  105. ## PWA (antcolony mission 046)
  106. Installable, the same way as calendar/tracker: hl:web's own manifest (`/__hl/manifest.webmanifest`) + service worker
  107. (`/__hl/sw.js`) from settings in `project.hl`, no JavaScript of ours.
  108. - `appTitle` "Hybriel components", `appShortName` "Components", `appIcons` (192 + 512 PNG, each `any` + `maskable`),
  109. `appTouchIcon` (180), `appFavicon` `/icons/favicon.svg`, `appThemeColor` = base `black` (the header, #000),
  110. `appBackgroundColor` = base `white` (#15; before: tokens `darker` / `dark`). `/favicon.ico` is a real icon (16/32/48). Each icon has a `file` route.
  111. - **Icons** (`icons/`): `icon.svg` = source (512, hand-written: three stacked building blocks with studs, white `#fff`
  112. on black `#000` (#15; before green-light on dark), all inside the maskable safe circle r = 204 → one image for `any` + `maskable`);
  113. `favicon.svg` = the same drawing cropped on a rounded tile. Rendered on Loreana:
  114. ```bash
  115. rsvg-convert -w 192 -h 192 icons/icon.svg -o icons/icon-192.png
  116. rsvg-convert -w 512 -h 512 icons/icon.svg -o icons/icon-512.png
  117. rsvg-convert -w 180 -h 180 icons/icon.svg -o icons/apple-touch-icon.png
  118. for s in 16 32 48; do rsvg-convert -w $s -h $s icons/favicon.svg -o /tmp/fav-$s.png; done
  119. magick /tmp/fav-16.png /tmp/fav-32.png /tmp/fav-48.png icons/favicon.ico
  120. ```
  121. - **Offline**: `offline = [ Index ]` — the worker keeps the shell and `/` (the home list). Without a network `/` opens
  122. from the cache and says "You are offline. The demos need the network." (`components/main.hl`: an invisible `netProbe`
  123. runs a 1 s CSS animation, each `animationiteration` reads `navigator.onLine` — hl:web has no connection state / mount
  124. hook). Every demo page offline gets hl:web's "Unavailable offline" page.
  125. - Gate: the `pwa:` / `offline:` checks at the end of `tests/browser.mjs` (manifest + icons over HTTP, Chrome's
  126. installability + manifest parse, worker scope `/`, then CDP offline + the server stopped → reload of `/` shows the
  127. shell; screenshots `.scratch/gate-pwa-phone-{online,offline}.png`, 390 px).
  128. ## Run, test, deploy
  129. - `COMPONENTS_PORT=8700 ./bin/hybriel project.hl` (env: `COMPONENTS_WATCH=0` no watcher, `HL_HOST`).
  130. - `node tests/browser.mjs` — the gate (343 checks since mission 008: #18 19; 324 since mission 006: comments 34; 290 since mission 005: #17 5, #16 16, #5 17; 252 since mission 004; 230 since #15): own server + headless Chrome (ports 8700, 8701–8709). Other ports (workers):
  131. `COMPONENTS_GATE_PORT=8720 COMPONENTS_GATE_CHROME=8721-8729 node tests/browser.mjs`.
  132. - **Same output** (for cleanups, mission 002): run on CODE-ONLY copies (it wipes `<copy>/storage`), ports 8750 (server) + 8751–8759:
  133. ```bash
  134. rsync -a --exclude .scratch --exclude storage --exclude .sessions --exclude .git --exclude '.env*' ./ /tmp/c-new/ # same for the old tree (git worktree / git archive)
  135. node tests/same-output.mjs /tmp/c-old .scratch/out-old; node tests/same-output.mjs /tmp/c-new .scratch/out-new
  136. python3 tests/same-output-compare.py .scratch/out-old .scratch/out-new -v # every page, README, icon, css, manifest, worker, browser module;
  137. # hydrated DOM of the 9 pages; file-upload drop + choose; md-editor drop; stored files' sha256
  138. python3 tests/same-output-modules.py .scratch/out-old .scratch/out-new # browser modules: same component code + imported functions
  139. ```
  140. Masks: `?v=` hashes, source positions, times, upload names. Two runs of one tree compare clean. A moved static changes only a module's
  141. import tables; dropping `let` turns `var` into `const` in the modules (nothing else).
  142. - **Layouts theme gate** after a component change: commit here, then in layouts.worldapi.org `tools/sync-components.sh <commit>`
  143. (byte-verbatim copies out of git) — or for a dry run copy layouts code-only and copy `components/<name>/*` over its `components/<name>/` —, then `LAYOUTS_GATE_PORT=8750 LAYOUTS_GATE_CHROME=8751-8759 node tests/browser.mjs` (73/0) and
  144. `node theme/check-theme.mjs .` (0 problems) in that copy — never in parallel with this gate (same ports).
  145. - `./deploy.sh` on Loreana (architect): gate → backup → rsync → `docker compose up -d --build` on Byrodin (port 45006) → URL 200.
  146. ## History and worker briefs
  147. - `LOG.md` — append-only history, one dated line per step (moved here from the antcolony LOG on 2026-10-01).
  148. - `missions/NNN-*.md` — worker briefs for this app; `reports/NNN-*.md` — their reports (same name). Numbered per
  149. project since 2026-10-01 (antcolony#40); older text, code comments and commits use the old antcolony numbers →
  150. map: `/media/STORAGE/projects/antcolony-docs/docs/mission-map.md` (Byrodin: `/CONTAINERS/projects/antcolony/docs/mission-map.md`).
  151. - B44 re-vendor: day44 SOURCE `222edef7cf3b0960825d005812f7c51b81cda20a`, binary SHA-256 `4f0f263ee2700cb74653172b6c490400db073adc6da92c3efff9e64439ac88dd`. Complete plugin sources from that commit and shared libraries from the verified day44 set; 107 files compared, zero differences.

Branches

Latest commits

  • 51c38187Gate media autoplay on first load and after client mountmre
  • a3f2223dRecord successful B44 deployment and live proofmre
  • 06c1e021Record passing B44 browser rerunmre
  • c9861533Record B44 component proof and browser gate blockermre
  • 1b7413beIgnore detached media events and space demo option outputsmre
  • ca3b4959Re-vendor complete Hybriel plugins and runtime to day44mre
  • df9e7df9Last-item checks run in the browser gate (components#26 fixed on day41); media-player loop is a plain Booleanmre
  • 895a5afcRe-vendor complete Hybriel plugins and runtime to day41mre
  • 16006bb3Backup tar: --hard-dereference, so mpackdb sidecars are never stored as hard links (Tracker's finding)mre
  • 88397fc3Re-vendor complete Hybriel plugins and runtime to day39mre
  • 9b872cedRecord IC28 deployment and live icon verificationmre
  • 46fefaa7Count the icons entry in the offline home-page checkmre
  • c7e14cabRecord IC28 rerun and unchanged-main baseline comparisonmre
  • 5e090ffdRecord IC28 review evidence and gate resultsmre
  • adfe2c4dAdd shuffle, repeat and repeatOne shared iconsmre
  • c96709c8media-player: skip = false and repeat = 'one' options (jukebox#19)mre
  • bd4aa808Record VL24 deployment and live verificationmre
  • e5b98ecfRun virtual-list gate before deploymentmre
  • 2e9b4a8evirtual-list: into main, with centerId and scrollTop/onScroll (jukebox#20)mre
  • 69954249Align all plugin sources with Hybriel day38bmre