Skip to content
Back

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-timeline
MCP
UI agent· PR #57
Starting
+0+0−0−0across 0 files
No files changed yet
Dioxus
rsx! {
    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.

Terminal
cargo install --git https://github.com/ismailqureshi72/Oxyn oxyn-cli
oxyn init
oxyn add diff-timeline
Rust
use 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

Dioxus · rust
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.

UI agent· PR #57
Starting
+0+0−0−0across 0 files
No files changed yet
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.

UI agent· PR #57
Editing app/billing/page.tsx
+105+105−25−25across 3 files
lib/plans.ts+18+18 −4−4
app/billing/page.tsx+46+46 −21−21
components/plan-card.tsx+41+41 −0−0
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.

UI agent· PR #57
Done · 15 edits in 3:22
+267+267−73−73across 7 files
lib/plans.ts+29+29 −7−7
app/billing/page.tsx+73+73 −31−31
components/plan-card.tsx+49+49 −6−6
public/plan-badge.pngbinary
styles/billing.css+36+36 −26−26
components/usage-meter.tsx+35+35 −2−2
tests/billing.test.ts+45+45 −1−1
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.

UI agent· PR #57
Editing app/billing/page.tsx
+202+202−56−56across 6 files
lib/plans.ts+29+29 −7−7
app/billing/page.tsx+68+68 −28−28
components/plan-card.tsx+49+49 −6−6
public/plan-badge.pngbinary
styles/billing.css+27+27 −15−15
components/usage-meter.tsx+29+29 −0−0
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.

UI agent· PR #57
Done · 15 edits in 3:22
+267+267−73−73across 7 files
lib/plans.ts+29+29 −7−7
app/billing/page.tsx+73+73 −31−31
components/plan-card.tsx+49+49 −6−6
public/plan-badge.pngbinary
styles/billing.css+36+36 −26−26
components/usage-meter.tsx+35+35 −2−2
tests/billing.test.ts+45+45 −1−1
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.

UI agent· PR #57
Editing app/billing/page.tsx
+202+202−56−56across 6 files
lib/plans.ts+29+29 −7−7
app/billing/page.tsx+68+68 −28−28
components/plan-card.tsx+49+49 −6−6
public/plan-badge.pngbinary
styles/billing.css+27+27 −15−15
components/usage-meter.tsx+29+29 −0−0
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.

Comparing Abort signal → Retry with backoff+7−3
src/billing/fetch-invoice.ts1 file changed+7−3
Msrc/billing/fetch-invoice.ts+7 −3
@@ -1,5 +1,9 @@function fetchInvoice+7 −3
export async function fetchInvoice(id: string, signal?: AbortSignal) {
Removed: const res = await fetch(`/api/invoices/${id}`, { signal });
Removed: if (!res.ok) throw new Error(`Invoice ${id} failed: ${res.status}`);
Removed: return res.json();
Added: for (let attempt = 0; attempt < 3; attempt++) {
Added: const res = await fetch(`/api/invoices/${id}`, { signal });
Added: if (res.ok) return res.json();
Added: if (res.status < 500) throw new Error(`Invoice ${id} failed: ${res.status}`);
Added: await sleep(2 ** attempt * 250);
Added: }
Added: throw new Error(`Invoice ${id} kept failing`);
}
Hunk 1 of 11 to review
Code
rsx! {
    DiffTimeline {
        path: "src/billing/fetch-invoice.ts",
        revisions: history.revisions(),
        now: clock.now(),
    }
}

Stacked

Before over after, for narrow panels.

Comparing Abort signal → Retry with backoff+7−3
src/billing/fetch-invoice.ts1 file changed+7−3
Msrc/billing/fetch-invoice.ts+7 −3
@@ -1,5 +1,9 @@function fetchInvoice+7 −3
Before
export async function fetchInvoice(id: string, signal?: AbortSignal) {
Removed: const res = await fetch(`/api/invoices/${id}`, { signal });
Removed: if (!res.ok) throw new Error(`Invoice ${id} failed: ${res.status}`);
Removed: return res.json();
}
After
export async function fetchInvoice(id: string, signal?: AbortSignal) {
Added: for (let attempt = 0; attempt < 3; attempt++) {
Added: const res = await fetch(`/api/invoices/${id}`, { signal });
Added: if (res.ok) return res.json();
Added: if (res.status < 500) throw new Error(`Invoice ${id} failed: ${res.status}`);
Added: await sleep(2 ** attempt * 250);
Added: }
Added: throw new Error(`Invoice ${id} kept failing`);
}
Hunk 1 of 11 to review
Code
rsx! {
    DiffTimeline {
        path: "src/billing/fetch-invoice.ts",
        revisions: history.revisions(),
        now: clock.now(),
        layout: "stacked",
    }
}

API reference

DiffTimeline

PropTypeDefaultDescription
pathrequiredString—File path.
revisionsrequiredVec<Revision>—Revisions, oldest first.
nowrequiredClockMs—Clock for the time labels.
layoutString"unified"Diff layout under the rail.
on_rangeEventHandler<(usize, usize)>—The compare range changed.

Read from the Rust signature and doc comments.

Keyboard interactions

KeyAction
TabRun 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
HomeorEndFirst 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 DiffTimeline from oxyn_dioxus and include STATUS_INDICATOR_CSS plus the token stylesheet once.
  • A GPUI version exists: DiffTimelineEl in oxyn_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.

Guides

Oxyn · 74 free components · 264 Pro components · 96 screens · 20 blocks · Dioxus and GPUI