components
All repositories: gitoria
7.8 KB
# components.hybriel.worldapi.orgHybriel components, developed standalone (CONCEPT.md). The home lists them; each component has a demo page, a READMEand a browser gate. Apps vendor a component by copying its folder. https://components.hybriel.worldapi.org## Components| Component | Demo | README ||-----------|------|--------|| Month view | `/month-view` | `components/month-view/README.md` (also `/month-view/README.md`) || Date picker | `/date-picker` | `components/date-picker/README.md` (also `/date-picker/README.md`) || Date range picker | `/range-picker` | `components/range-picker/README.md` (also `/range-picker/README.md`) || Pagination | `/pagination` | `components/pagination/README.md` (also `/pagination/README.md`) || Markdown editor | `/md-editor` | `components/md-editor/README.md` (also `/md-editor/README.md`) || Code editor | `/code-editor` | `components/code-editor/README.md` (also `/code-editor/README.md`) || Modal | `/modal` | `components/modal/README.md` (also `/modal/README.md`) |The Markdown editor takes files and images (drop, paste, File button) through `emit server mdUpload` (hybriel#94). The one-file upload (`components/file-upload/`, ticket #4) sends its file through `emit server saveFile` (hybriel#94). The multi-file upload (#5) is not built yet.## Layout- `project.hl` routes · `styles.hl` the site's page layout only (tokens from `shared/tokens.hl`, accent = light blue) · `components/main.hl` shell ·`components/index.hl` the home · `components/<name>/` one folder per component (component, demo, script, README).- To add a component: its folder, a demo route + a README route in `project.hl`, one entry in `components/index.hl`,its own `Style` in its file, checks in `tests/browser.mjs`.- `bin/hybriel` + `plugins/` (core crypto data fs http http1 proc time web) are vendored = hybriel **master 06617221**(2026-10-03, antcolony mission 074: plugin allocators 3a781359 + 413f60e4 (#126), http1 773de63e (request owns its parse —uploads no longer retained), mpackdb 2cb7ae5e, f0ac2d2d (plugin ABI field — bin and .so must match); no lambda semantics change;sha256 `21059cc7…d77bdb`, built the same way from `git archive 06617221`; previous copy (190aa11d) in `.scratch/pre-074/`. Gate`COMPONENTS_GATE_PORT=8760 COMPONENTS_GATE_CHROME=8761-8769 node tests/browser.mjs` → 220/0. Memory: `LOADS=N UPLOADS=N [IDLE=s]node .scratch/w074/memtest.mjs <vendor dir with bin/+plugins/> <label>` (port 8760, Chrome 8761–8769; needs the live storage copy in`.scratch/w074/live/storage`, deleted after the run): 2000 loads 184 → 205 MB flat, 400 × 1 MiB uploads level at ~363–403 MB(old 190aa11d: +1 MB per upload, 829 MB).Before: master 190aa11d (2026-10-02, antcolony mission 072: fc838894 GC correctness (string index / plugin error read freed memory), 038d84b3 #126returned closure scopes, #127 d98926c6/04df4428; no lambda semantics change since 8efba065), sha256 `860f5e61…0a23626`,built read-only from `git archive 190aa11d`; previous copy (8efba065) in `.scratch/pre-072/`. Gate`COMPONENTS_GATE_PORT=8720 COMPONENTS_GATE_CHROME=8721-8729 node tests/browser.mjs` 220/0. Memory:`node .scratch/w072/memtest.mjs <vendor dir> <label>` (port 8720, Chrome 8721-8728; LOADS/UPLOADS/IDLE; needs the livestorage copy in `.scratch/w072/live/storage`, deleted after each run — re-tar it): 200 loads new 182 → 205 MB (old 288 → 353);uploads still retain RAM: 400 × 1 MiB new 185 → 751 MB (old 8efba065 277 → 713 MB, HWM 823), nothing freed after 60 s idle.Before: master 8efba065 (2026-10-02, antcolony mission 069: #126 the collector also runs by bytes — memory is freed now; #48 a lambda PARAMETERCOPIES its argument like a method does, write `(&p) =>` when the caller must see the change; #112 #117 #119 #120 opt-in, notused; earlier: #113, #115/#116, #118, SVG namespace, #111, #103–#106, #94, #83 hashed URLs, #82).Built from a read-only `git archive master` with `zig build -Doptimize=ReleaseFast -Dtarget=x86_64-linux-gnu.2.39` in`native/`; binary sha256 `231fb9f2…395546fc6`. **No local patch**: a re-vendor = copy binary + plugins (the ones listed;the build also refreshes their `.so`), run the gate. Previous copy: `.scratch/pre-069/` (master ff51cf46).- **#48 lambda rule**: the app has 5 lambdas (`python3 .scratch/w069/lambdas.py` / `lambdas2.py` list them and flag writesto parameters); none writes to a parameter, so none needs `&`. Components are methods / faces, which already copied.Probe: `bin/hybriel .scratch/w069/probe48.hl` → `copy: n=1 len=0` = #48 active.- **Memory check** (RSS of one server, live storage copy, 200 loads of the 9 pages + 100 file-upload drops of 1 MiB):`node .scratch/w069/memtest.mjs <dir with bin/ + plugins/> <label>` (port 8730, Chrome 8722–8729; env LOADS, UPLOADS,IDLE; it copies the app without .env into `.scratch/w069/mem-<label>/` — copy the live `storage/` to`.scratch/w069/live/storage` first, delete both afterwards).## PWA (antcolony mission 046)Installable, the same way as calendar/tracker: hl:web's own manifest (`/__hl/manifest.webmanifest`) + service worker(`/__hl/sw.js`) from settings in `project.hl`, no JavaScript of ours.- `appTitle` "Hybriel components", `appShortName` "Components", `appIcons` (192 + 512 PNG, each `any` + `maskable`),`appTouchIcon` (180), `appFavicon` `/icons/favicon.svg`, `appThemeColor` = token `darker` (the header,rgb(15, 20, 25)), `appBackgroundColor` = token `dark`. `/favicon.ico` is a real icon (16/32/48). Each icon has a `file` route.- **Icons** (`icons/`): `icon.svg` = source (512, hand-written: three stacked building blocks with studs, green-light`#b5cea8` on rgb(25,30,35), all inside the maskable safe circle r = 204 → one image for `any` + `maskable`);`favicon.svg` = the same drawing cropped on a rounded tile. Rendered on Loreana:```bashrsvg-convert -w 192 -h 192 icons/icon.svg -o icons/icon-192.pngrsvg-convert -w 512 -h 512 icons/icon.svg -o icons/icon-512.pngrsvg-convert -w 180 -h 180 icons/icon.svg -o icons/apple-touch-icon.pngfor s in 16 32 48; do rsvg-convert -w $s -h $s icons/favicon.svg -o /tmp/fav-$s.png; donemagick /tmp/fav-16.png /tmp/fav-32.png /tmp/fav-48.png icons/favicon.ico```- **Offline**: `offline = [ Index ]` — the worker keeps the shell and `/` (the home list). Without a network `/` opensfrom the cache and says "You are offline. The demos need the network." (`components/main.hl`: an invisible `netProbe`runs a 1 s CSS animation, each `animationiteration` reads `navigator.onLine` — hl:web has no connection state / mounthook). Every demo page offline gets hl:web's "Unavailable offline" page.- Gate: the `pwa:` / `offline:` checks at the end of `tests/browser.mjs` (manifest + icons over HTTP, Chrome'sinstallability + manifest parse, worker scope `/`, then CDP offline + the server stopped → reload of `/` shows theshell; screenshots `.scratch/gate-pwa-phone-{online,offline}.png`, 390 px).## Run, test, deploy- `COMPONENTS_PORT=8700 ./bin/hybriel project.hl` (env: `COMPONENTS_WATCH=0` no watcher, `HL_HOST`).- `node tests/browser.mjs` — the gate: own server + headless Chrome (ports 8700, 8701–8709). Other ports (workers):`COMPONENTS_GATE_PORT=8720 COMPONENTS_GATE_CHROME=8721-8729 node tests/browser.mjs`.- `./deploy.sh` on Loreana (architect): gate → backup → rsync → `docker compose up -d --build` on Byrodin (port 45006) → URL 200.## History and worker briefs- `LOG.md` — append-only history, one dated line per step (moved here from the antcolony LOG on 2026-10-01).- `missions/NNN-*.md` — worker briefs for this app; `reports/NNN-*.md` — their reports (same name). Numbered perproject since 2026-10-01 (antcolony#40); older text, code comments and commits use the old antcolony numbers →map: `/media/STORAGE/projects/antcolony-docs/docs/mission-map.md` (Byrodin: `/CONTAINERS/projects/antcolony/docs/mission-map.md`).
Branches
- mainmain branch
Latest commits
- 172914a3components code order (mission 002) 2/4: lib/uploads.hl (demo upload storage), thin demo handlers, project.hl map; gate 220/0, same outputmre
- d29f35b1components code order (mission 002) 1/4: styles.hl -> components/styles.hl; gate 220/0, same outputmre
- 09945750components: Hybriel master 06617221 (plugin allocators 3a781359 + 413f60e4, http1 773de63e); gate 220/0mre
- ede4d19acomponents: Hybriel master 190aa11d (fc838894 GC correctness, #126 closure scopes, #127); gate 220/0mre
- 2bb9a935components: Hybriel master 8efba065 (re-vendor round 069: #126 memory, #48 lambda copy)mre
- e4f01768antcolony#40: mission references point to the moved missionsmre
- d32b44e2antcolony#40: history (LOG.md), worker briefs (missions/) and reports moved here from antcolony, numbered per project; old numbers in antcolony docs/mission-map.mdmre
- 0fb80b57components: Hybriel master ff51cf46 (re-vendor round)mre
- 57408b6ecomponents#14: installable app (manifest, service worker, offline index), own iconmre
- 317bd09fdeploy.sh: back up live storage/.sessions/.env before every deploy (newest 5 kept)mre
- becbd59bcomponents#13: modal dialog (<dialog> based, focus wrap, backdrop/Esc/x close with reason, scroll lock, footer buttons)mre
- 367dd19adeploy.sh: never send .git or .gitignore to Byrodinmre
- 4b4dabe5State of 2026-09-27, before the move to gitoriamre