You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Composer: the one-writer rule's fold runs over the whole draft on every edit #741
The composer serialises its draft on every change of the document (src/renderer/src/composer/Composer.tsx, the call of serializeDraft). Since UX wave U1c the serialiser's last step is neutraliseGrant (src/shared/engine/grant.ts), which folds the whole wire text character by character in script code, pasted atoms' bodies included. Everything else the serialiser does to a body is a native string or pattern operation.
An independent review measured the function alone, copied out of the repository: about 37 ns a character for ASCII text and about 150 ns for CJK text. A draft that holds a pasted atom of one million characters would then add 37 to 155 ms to each keystroke. This was not measured in the app.
What "done" looks like
A measured number in the app first: typing in a draft that holds a pasted atom of one million characters, with and without the step (a count or a frame measure on the Mac lane, by the load rule).
If it is a cost a person can feel, one of:
fold each pasted atom's body once and keep the result with the atom (an atom's body does not change), then run the step on the typed text and the joins only; the property "no text readConsents accepts in what goes out" must still be proved on the assembled wire text, since a join can form an opening;
run the step when a send is made, not on each edit; then every consumer of the serialised wire text that sends it must pass the step, and the guard (test/support/person-sends.ts) must hold each one.
The one-writer rule's property and behaviour cases keep passing unchanged.
Not in scope
The rule itself (U1c's Decision Log 65) and the function's reading.
A fact for the measurement, from the round that followed this ticket (U1c head b040d47): the fold now makes four passes over the wire text instead of one (two readings of each character's case, two patterns), plus two folded streams. The reviewer's 37 to 155 ns a character was measured on the one-pass function; measure the built one.
Activity
SSFSKIM commentedon Nov 17, 2026
A fact for the measurement, from the round that followed this ticket (U1c head b040d47): the fold now makes four passes over the wire text instead of one (two readings of each character's case, two patterns), plus two folded streams. The reviewer's 37 to 155 ns a character was measured on the one-pass function; measure the built one.
Composer: red case, an edit beside a paste folds the whole wire text (#…
SSFSKIM commentedon Nov 20, 2026
[board] in-progress: batch 7, group A
Composer: an edit reads the draft's mode and emptiness without the fo…
SSFSKIM commentedon Nov 20, 2026
[board] in-review: batch 7, PR #804