Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
dd38da2
feat(timeline): date picker and custom date ranges
san360 Nov 21, 2026
bf4c3ac
fix(timeline): open Timeline links on load, keep picked dates without…
san360 Nov 21, 2026
a7e85bc
fix(timeline): keep axis ticks on whole hours over half-hour daylight…
san360 Nov 21, 2026
e8ed042
perf(timeline): redraw only the date picker while moving around the c…
san360 Nov 21, 2026
da81d68
fix(timeline): return focus to the date after a click outside the cal…
san360 Nov 21, 2026
f9405bc
fix(timeline): keep the Range view when opening a session active in it
san360 Nov 21, 2026
de97442
fix(timeline): read the text of a long Range lane, and say when it ha…
san360 Nov 21, 2026
15759b8
fix(timeline): keep focus in the calendar when a month button turns d…
san360 Nov 21, 2026
8e74f6e
fix(timeline): build the lane of a dense session without overflowing …
san360 Nov 21, 2026
21ddc11
fix(timeline): find a family's longest unattended stretch without ove…
san360 Nov 21, 2026
7177fb7
fix(timeline): ground the day strip and calendar dots in the filters,…
san360 Nov 22, 2026
08211e6
perf(timeline): find each turn's predecessor once when reading a lane…
san360 Nov 22, 2026
4dc419e
fix(timeline): end a day at the next midnight where the clock skips m…
san360 Nov 22, 2026
6090826
perf(timeline): sort a session's activity into its days once for the …
san360 Nov 22, 2026
4c23e84
fix(timeline): start a week at its Monday's midnight whichever day is…
san360 Nov 22, 2026
e292ffb
chore: merge the updated wait details, with main, into the date picker
san360 Nov 23, 2026
128c7c5
fix(timeline): keep calendar focus when a month button turns disabled…
san360 Nov 23, 2026
b9dc714
chore: merge the updated wait details into the date picker
san360 Nov 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ A few features depend on the local VS Code language model and are hidden in canv
| Page | Description |
| ------------------ | ------------------------------------------------------------------------------------- |
| **Dashboard** | Practice scores with week-over-week trends, daily activity chart, top workspace stats |
| **Timeline** | Autonomy lanes per day or week, waits on you, and session families with verdicts |
| **Timeline** | Autonomy lanes per day, week or chosen range, waits on you, families with verdicts |
| **Coding Moments** | Screenshot gallery from AI coding sessions with story reels and workspace filtering |

### Measure
Expand Down
41 changes: 29 additions & 12 deletions docs/content/observe/timeline.md

Large diffs are not rendered by default.

Binary file added docs/static/screenshots/screen-timeline-range.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/static/screenshots/screen-timeline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
86 changes: 84 additions & 2 deletions src/core/timeline-model.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

import { afterAll, beforeAll, describe, expect, it } from 'vitest';
import {
buildFamilies, buildLanes, buildViewFamilies, createNamer, familiesInsights, familyUnattendedMs, filterLanes, formatDuration, hourTicks,
buildFamilies, buildLanes, buildViewFamilies, createNamer, familiesInsights, familyUnattendedMs, filteredDayTotals, filterLanes, formatDuration, hourTicks,
NO_LANE_FILTERS, peakParallel, prepareTimeline, sessionWaits, sessionWork, stepDate, timelineKpis, timelineWindow, turnTimes,
verdictText, VERDICTS, viewInsights, type PreparedTimeline,
textScope, verdictText, VERDICTS, viewInsights, type PreparedTimeline,
waitInWindow,
} from './timeline-model';
import type { TimelineDataset, TimelineSessionRecord, TimelineTurn, TurnSender } from './types/timeline-types';
Expand Down Expand Up @@ -319,3 +319,85 @@ describe('waitInWindow', () => {
]).toEqual([true, true, true, false, false, false]);
});
});

describe('textScope', () => {
it('lists each turn once: a wait’s preceding turn is often one the lane lists', () => {
const scope = textScope([at(9), at(18)], [{ t: at(10), id: 'a' }, { t: at(11) }, { t: at(10), id: 'a' }, { t: at(11) }, { t: at(11), id: 'b' }]);
expect(scope).toEqual({ from: at(9), to: at(18), turns: [{ t: at(10), id: 'a' }, { t: at(11) }, { t: at(11), id: 'b' }] });
});
});

describe('a dense session', () => {
it('builds its lane and family whatever its number of turns', () => {
// More values than a call can take as arguments: Math.min(...values) throws a RangeError on them.
// Measured agent turns between your prompts: a stretch the family ran unattended for each.
const prepared = (n: number) => {
const list = Array.from({ length: n }, (_, i) => turn(at(0) + i * 60_000, i % 2 ? 0.5 : 0, i % 2 ? 'agent' : 'you'));
return { list, p: prepareTimeline({ forkedSessions: 0, sessions: [session('busy', list), session('kid', [turn(at(22, 0, 14), 5, 'agent')], { parent: 0, via: 'create' })] }) };
};
const { list: turns, p } = prepared(300_000);
const win: [number, number] = [at(0), at(0, 0, 15 + 220)];
// The same pattern in 10 turns (the child is before the window): the longest unattended stretch doesn't depend on how many there are.
const small = prepared(10).p;
const smallLanes = buildLanes(small, ...win);
const longest = buildViewFamilies(smallLanes, small)[0].unattendedMs;
expect(longest).toBeGreaterThan(0);
const lanes = buildLanes(p, ...win);
expect([lanes[0].first, lanes[0].turns.length]).toEqual([at(0), 300_000]);
expect(lanes[0].last).toBeGreaterThanOrEqual(turns[turns.length - 1].t);
expect(p.stretches.get(0)!.length).toBe(150_000);
const families = buildViewFamilies(lanes, p);
expect(families[0].unattendedMs).toBe(longest);
expect(timelineKpis(lanes, families).unattendedMs).toBe(longest);
expect(viewInsights(lanes, families, createNamer(p, false), 'range', p).length).toBeGreaterThan(0);
const overview = buildFamilies(p);
expect(overview.families[0].from).toBe('2024-03-14');
expect(familiesInsights(overview.totals).length).toBeGreaterThan(0);
});
});

describe('filteredDayTotals', () => {
// A types on the 15th only and works alone on the 16th; B, in Claude Code, types on the 16th.
const p = prepareTimeline({
forkedSessions: 0,
sessions: [
session('a', [turn(at(9), 30, 'you'), turn(at(10, 0, 16), 20, 'agent'), turn(at(11, 0, 16), 10, 'agent')]),
session('b', [turn(at(14, 0, 16), 5, 'you'), turn(at(14, 40, 16), 3, 'you')], { harness: 'Claude Code' }),
],
});
const dayKpis = (day: string, f = NO_LANE_FILTERS) => {
const lanes = filterLanes(buildLanes(p, ...timelineWindow('day', day)), f, p);
const k = timelineKpis(lanes, buildViewFamilies(lanes, p));
return { typed: k.typed, automated: k.turns - k.typed, agentMs: k.agentMs, waitMs: k.waitMs };
};
const none = { typed: 0, automated: 0, agentMs: 0, waitMs: 0 };

it('counts each day what the Day view shows with the same filters', () => {
for (const f of [{ ...NO_LANE_FILTERS, harness: 'Claude Code' }, { ...NO_LANE_FILTERS, youTyped: true }, { ...NO_LANE_FILTERS, hideOneTurn: true }]) {
const totals = filteredDayTotals(p, f);
for (const day of p.days) expect([day, totals.get(day) ?? none]).toEqual([day, dayKpis(day, f)]);
}
// A session counts on a day when its lane that day passes: A typed nothing on the 16th.
expect(filteredDayTotals(p, { ...NO_LANE_FILTERS, youTyped: true }).get('2024-03-16')).toMatchObject({ typed: 2, automated: 0 });
expect(filteredDayTotals(p, { ...NO_LANE_FILTERS, harness: 'Claude Code' }).has('2024-03-15')).toBe(false);
});

it('reads a long, busy session once, not once per day', () => {
// 300,000 turns over 209 days; preparing them is linear, and so must be filtering them.
const turns = Array.from({ length: 300_000 }, (_, i) => turn(at(0) + i * 60_000, i % 2 ? 0.5 : 0, i % 2 ? 'agent' : 'you'));
const data: TimelineDataset = { forkedSessions: 0, sessions: [session('busy', turns)] };
let started = performance.now();
const busy = prepareTimeline(data);
const prepareMs = performance.now() - started;
started = performance.now();
const totals = filteredDayTotals(busy, { ...NO_LANE_FILTERS, youTyped: true });
expect(performance.now() - started).toBeLessThan(prepareMs);
expect(totals.size).toBe(busy.days.length);
expect(totals.get(busy.days[1])).toEqual(busy.dayTotals.get(busy.days[1]));
});

it('is the unfiltered totals without filters', () => {
expect(filteredDayTotals(p, NO_LANE_FILTERS)).toBe(p.dayTotals);
for (const day of p.days) expect(p.dayTotals.get(day)).toEqual(dayKpis(day));
});
});
Loading
Loading