Skip to main content

Module history_group

Module history_group 

Expand description

Turning a flood of individual changes into a small number of things a person can name, collapse and restore to. History surfaces show groups, expanding to individual changes on demand.

An explicit action work-group (issue, task, agent run) forms the strongest automatic boundary and may span people, apps, and operation families. With no explicit group, a boundary forms when: the author changed; the clock jumped more than GroupingConfig::idle_gap (an unstamped change is not a gap — splitting on it would tear a session differently per peer); the op family changed (matching the timeline’s filter chips); or the group hit GroupingConfig::max_changes. All are checked against data every change already carries, so grouping is a pure function of the change graph and every peer computes the same groups. Not used: “a burst of edits to the same region” — its boundaries would move as the document changes, so two peers could group it differently.

A NamedRange is a user’s name over a run of changes, authoritative and never split or extended automatically. Named ranges nest one level (MAX_GROUP_DEPTH); see group_entries for concurrent naming.

Structs§

GroupNameRequest
What a host must write when a user names, renames, or un-names a run of changes. Both history surfaces emit this rather than writing to the document directly — neither widget has one, only the host does.
GroupingConfig
HistoryGroup
One collapsible band in a history surface.
NamedRange
A user’s name over a run of history, as stored in the document.

Enums§

OpFamily
Grouping never mixes two families, so a filter chip can never empty a group while leaving its header claiming rows that are no longer shown.

Constants§

DEFAULT_IDLE_GAP
Five minutes: long enough to survive reading a paragraph before typing the next one, short enough that a coffee break shows up as a break.
DEFAULT_MAX_GROUP
Ceiling on how many changes one automatic group may hold.
MAX_GROUP_DEPTH
Two levels is what a reader can hold; three is a tree of edit history nobody asked for.

Functions§

authors_more
“Alice, Bob + 4”, in the desktop’s language.
authors_pair
“Alice and Bob”, in the desktop’s language.
from_hex16
Parse the hex produced by hex16 back into an id. None on anything that is not exactly 32 hex characters (either case), so a corrupted document key is skipped rather than silently resolving to a wrong change.
group_entries
Group entries (oldest first, in the producer’s causal order).
hex16
Lower-case hex of an entry id. Also the document key a name is stored under, which is why it lives here rather than in the persistence layer.