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§
- Group
Name Request - 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.
- Grouping
Config - History
Group - One collapsible band in a history surface.
- Named
Range - 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
hex16back into an id.Noneon 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.