Skip to content

desktop/src/lib/derive.ts

Comment 1, line 1

desktop/src/lib/derive.ts:1

/**
* Pure frontend calculations without IPC: period durations and grouped chart data.
*/

Comment 2, line 6

desktop/src/lib/derive.ts:6

/** Native Copilot turn input is a lower bound for display only;
* never replace complete query/export totals with it. */

Comment 3, line 16

desktop/src/lib/derive.ts:16

/** Short display keeps complete totals, observed bounds and unknown distinct. */

Comment 4, line 22

desktop/src/lib/derive.ts:22

/** A model can appear under several providers; name-only pies combine them. */

Comment 5, line 33

desktop/src/lib/derive.ts:33

/** Mean call duration in milliseconds; null without known data. */

Comment 6, line 35

desktop/src/lib/derive.ts:35

/** Known period duration sum in milliseconds; null without known data. */

Comment 7, line 39

desktop/src/lib/derive.ts:39

/** Sum/average known total_duration_ms periods only, without zero-filling unknowns. */

Comment 8, line 57

desktop/src/lib/derive.ts:57

/** One series/time-label value; null means unknown, not zero. */

Comment 9, line 69

desktop/src/lib/derive.ts:69

/** chart_series output: chronological labels, series names and cells keyed by series/label. */

Comment 10, line 77

desktop/src/lib/derive.ts:77

/**
* Turn unique backend GROUP BY label/series rows into chart arrays.
* Missing series/label pairs mean no records for that period; queries
* let charts render those gaps as zero or a dash.
*/