Diff Timeline
An agent's edits over a run as lines added and removed against time, with a row per file and any edit opened to its changed lines; or one file across revisions on a rail, any two compared.
oxyn add diff-timelinersx! {
DiffTimelineRun {
edits: Some(run.edits()),
at: Some(run.elapsed_ms()),
agent: "UI agent",
context: "PR #57",
now: clock.now(),
}
}Rendered from Rust at build time · goes live when visible
When to use
- A file was edited several times by the agent and by you.
- The rail lists each revision (label, who, age, +/− against the one before via revision_stats); picking two points shows revision_diff between them in an embedded diff viewer.
When not to use
- An agent asks before it acts: use Approval Card instead.
- Several open requests in one card: use Approval pager instead.
- An agent's question in its own card above the composer: use Decision Card instead.
Installation
Diff Timeline is free and MIT. The oxyn CLI copies its code, and the components it needs, into src/oxyn/ of your Dioxus or GPUI project, so it is yours to change.
cargo install --git https://github.com/ismailqureshi72/Oxyn oxyn-cli
oxyn init
oxyn add diff-timelineuse crate::oxyn::{DiffTimeline, STATUS_INDICATOR_CSS};Rather depend on the crate? cargo add oxyn-dioxus oxyn-core --git https://github.com/ismailqureshi72/Oxyn, then use oxyn_dioxus::{DiffTimeline, STATUS_INDICATOR_CSS};
Usage
rsx! {
DiffTimelineRun {
edits: Some(run.edits()),
at: Some(run.elapsed_ms()),
agent: "UI agent",
context: "PR #57",
now: clock.now(),
}
}Examples
Run
The run replays and loops: files join the list as the agent first touches them, bars grow piece by piece, the green and red lines climb with breathing ends, then the status reads Done.
Code
rsx! {
DiffTimelineRun {
edits: Some(run.edits()),
at: Some(run.elapsed_ms()),
agent: "UI agent",
context: "PR #57",
now: clock.now(),
}
}Early
Under a minute in: four edits to three files, the row being edited washed grey.
Code
rsx! {
DiffTimelineRun {
edits: Some(run.edits()),
at: Some(run.elapsed_ms()),
agent: "UI agent",
context: "PR #57",
now: clock.now(),
}
}Done
Finished: fifteen edits in 3:22 across seven files, the image listed as binary, the net in the legend.
Code
rsx! {
DiffTimelineRun {
edits: Some(run.edits()),
at: Some(run.elapsed_ms()),
agent: "UI agent",
context: "PR #57",
now: clock.now(),
}
}Open
An edit picked on the chart: its file and time, running totals with this edit's share, the changed lines; other rows fade.
- Added
- 169 (+8)
- Removed
- 46 (−6)
+ {plan.badge && <img src="/plan-badge.png" alt="" />}- <span>{plan.tag}</span>
Code
rsx! {
DiffTimelineRun {
edits: Some(run.edits()),
at: Some(run.elapsed_ms()),
agent: "UI agent",
context: "PR #57",
now: clock.now(),
}
}Narrow
Under about 410 px the totals drop under the name, folders hide and big counts shorten.
Code
rsx! {
DiffTimelineRun {
edits: Some(run.edits()),
at: Some(run.elapsed_ms()),
agent: "UI agent",
context: "PR #57",
now: clock.now(),
}
}Classic
Classic style: a grey tray holding the chart and the file list as two panels.
Code
rsx! {
DiffTimelineRun {
edits: Some(run.edits()),
at: Some(run.elapsed_ms()),
agent: "UI agent",
context: "PR #57",
now: clock.now(),
}
}Rail
Revisions on a rail; the last two compared.
@@ -1,5 +1,9 @@function fetchInvoice+7 −3Code
rsx! {
DiffTimeline {
path: "src/billing/fetch-invoice.ts",
revisions: history.revisions(),
now: clock.now(),
}
}Stacked
Before over after, for narrow panels.
@@ -1,5 +1,9 @@function fetchInvoice+7 −3Code
rsx! {
DiffTimeline {
path: "src/billing/fetch-invoice.ts",
revisions: history.revisions(),
now: clock.now(),
layout: "stacked",
}
}API reference
DiffTimeline
| Prop | Type | Default | Description |
|---|---|---|---|
pathrequired | String | — | File path. |
revisionsrequired | Vec<Revision> | — | Revisions, oldest first. |
nowrequired | ClockMs | — | Clock for the time labels. |
layout | String | "unified" | Diff layout under the rail. |
on_range | EventHandler<(usize, usize)> | — | The compare range changed. |
Read from the Rust signature and doc comments.
Keyboard interactions
| Key | Action |
|---|---|
| Tab | Run view: the chart is one stop |
| ←or→ (run) | Step to the previous / next edit and open it |
| HomeorEnd (run) | First / last edit |
| Escape (run) | Closes the open edit |
| ←or→ | Move the compare target |
| Shift←or→ | Move the base |
| HomeorEnd | First base / latest revision |
Accessibility
- Run view: the chart takes a single tab stop and is named with its edit count; an opened edit is announced politely, and the line under the name is a status region.
- Each file row reads its path, lines added and removed and how many edits, so the bar colours are never the only signal; reduced motion stops the breathing, the rise and the growing bars.
- The rail is a listbox; each revision says who wrote it, when and its +/− counts.
- Your revisions draw a square dot and the agent's a round one, so author is not colour alone.
From the spec
- Listbox with aria-activedescendant on the target; author shown by shape (square for you, round for the agent) and text.
Motion & interaction
Timing
- Selected dots scale to 1.15 over 160 ms; the rail line fills between base and target.
- The diff below is re-keyed per range, so it swaps without stale hunks.
- Reduced motion: no scale.
Responsive behaviour
- Run view: the card fills its container up to 440 px; under about 410 px the totals move under the name, folders hide and counts shorten (4.8k); more than seven files scroll inside the list.
- The rail scrolls sideways when there are more revisions than room.
Edge cases (spec)
- The rail scrolls sideways; nodes are at least 120 px.
Notes for AI
- Import
DiffTimelinefromoxyn_dioxusand includeSTATUS_INDICATOR_CSSplus the token stylesheet once. - A GPUI version exists:
DiffTimelineElinoxyn_gpui. - Props to set first:
path,revisions,now. - It reads a clock (
now) for live timers; pass one clock for the whole page rather than one per component. - Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.