Skip to main content

Module history

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§

HistoryAttribution
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).
HistoryAuthor
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.
HistoryEntry
HistoryEntryId
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.
HistoryFilter
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.
RedactionDisplay
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§

AuthorRelation
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.
EntryKind
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.
HistoryClassification

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 as now advances — 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).