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
- c92e4a0ftests/e2e-outside.mjs: real-Chrome E2E, a note pushed from another device while open, then typingmre
- 0516b4ccmd-editor.hl: verbatim copy of components f3-mdvalue (an older text handed back is kept)mre
- 38cc11ecmd-editor.hl: verbatim copy of components f3-mdvalue (an outside value change is shown by the editor)mre
- 3e7e79f5reports/H1-hydrate.mdmre
- d98775e8tests/browser.mjs: wait for hydration before the clicks after a goto('/') (tables new note, phone sidebar)mre
- 1f3198b6tests/cdp.mjs: HL_CPU_THROTTLE=<rate> optional CPU throttling for gate runsmre
- 39cf9fdfre-vendor Hybriel 5406d146 (hl:web batches 9+10: #72 emits while the socket is closed delivered after reconnect, browser boot linear, faster list appends; contains int 6–14 + m406)mre
- db07aa84tests: short-id-switch ports from env (NOTES_SWITCH_IDENT_PORT/_PORT), defaults unchangedmre
- ef9f9feere-vendor Hybriel 6f8a0689 (int 6–11: streaming cursors, #203 index heal + close() fix, fd403 listDir/cursor fds, hl:time browser side, hl:web batches 5+6)mre
- 5485467cdocker-compose: nofile 65536 (Hybriel int 6+ boot opened >1024 files in the tracker)mre
- 86ea4a85deploy: backup copies index files first and *.mpack data last (hot-copy skew, hybriel #203)mre
- edeab20fnotes mission 015: mission, report, LOG, STATUSmre
- 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