Module history
Expand description
History data types shared by activity_timeline and
history_scrubber.
Source-agnostic by design: the producer (today an in-memory iterator over automerge history, later a signed-op stream) is external, so the widgets can be unit-tested without touching automerge, Iroh, or the broker.
Structs§
- History
Attribution - An author that acted for someone: an agent’s change is the agent’s, on behalf of its person, in every history (an app’s, the Files history, and what the history actions return).
- History
Author - Not crypto material — just enough metadata to render a per-author colour dot, display name, and a short identity hash for disambiguation when two authors share a name.
- History
Entry - History
Entry Id - Opaque: only ever compared for equality (revert/restore callbacks pass it back to the caller). The caller picks the byte layout — UUID-v4 today, a content hash later.
- History
Filter - Empty fields are “match everything” so a freshly-constructed filter behaves like no filter at all. The chrome owns the filter (not the widget) so the host can persist it across remounts, e.g. a workspace switch, without poking at widget internals.
- Redaction
Display - Optional on
HistoryEntry— when present, the widget renders the row with the struck-through summary, suppresses the[Revert]chip, and exposes the redactor + reason on hover.
Enums§
- Author
Relation - Who an author is to the person reading the history. Rows draw the reader’s own changes, a collaborator’s and an agent’s differently.
- Entry
Kind - What a history entry did, as the history and activity views mark, filter and group it. Read from the change itself (its entry and what it wrote), not from the transport that carried it.
- History
Classification
Functions§
- format_
relative_ time - Used by both widgets so the wording stays uniform with every other
“time ago” label (
crate::format::relative). Re-renders every frame, so the label freshens naturally asnowadvances — no clock plumbing needed. - hue_
to_ rgb HSV(h, 0.65, 0.95)→ RGB. Saturation and value held constant so generated author colours stay visually coherent (no neon outliers, no muddy ones).