notes
All repositories: gitoria
1.1 KB
// lib/notes-helpers.hl — what lib/notes.hl looks up (notes mission 002, code order): the size limit, the tombstone// check, the version stamp and the copy mark of a conflict.import { now } from 'hl:time'static maxText = 200000static textError = (text) => {if (text == null || hlTypeName(text) != 'String') { return 'the note must be text' }if (text.length > maxText) { return 'the note is too long (at most ' + maxText + ' characters)' }return null}// alive = not deleted (gone == 0; the row of a deleted note stays as a tombstone)static isAlive = (n) => { return n != null && (n.gone == null || n.gone == 0) }// the version stamp of an edit made at `at` (the browser's clock): never in the future, always after `prev` —// so the sidebar order is the order the edits were really made in, and a version stamp is never reusedstatic stampOf = (at, prev) => {t = now()cand = at > 0 && at < t ? at : treturn cand > prev ? cand : prev + 1}// the line at the end of the version that lost a conflict (kept as a note of its own)static copyMark = '*(kept as a copy: this note was changed on two devices at once)*'
Branches
Latest commits
- 542a0383notes mission 015: e2e-chrome E2E_HOST (own cookie jar in the shared Chrome)mre
- 8b30f510notes mission 015: main-menu from layouts 0bcc629, current = true kept (route marks only /), server-HTML marker checksmre
- 84b574c4notes mission 015: re-vendor plugins from hybriel f9614007 (incl. web, #117)mre
- 447da53dnotes mission 014: report — remaining gates and lisbeth E2E proofmre
- fd9f92c3notes mission 014: report (partial), LOG, STATUSmre
- b2501360notes mission 014: open() sets asking=false before flush(0) (hybriel#196)mre
- 9414ce59notes mission 014: merge theme 76f99f6, components 3794c59, strict single-press openAsk (fails on old open())mre
- c08c655anotes 013: theme re-copied from layouts 76f99f6 (menu marks the current page), current = true on the menu item, e2e marker checks, reportmre
- 21c8f65dnotes mission 012: STATUSmre
- 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