Skip to content

desktop/src/App.svelte

Comment 1, line 43

desktop/src/App.svelte:43

/** Today/two-calendar-day ranges use hourly data bounded by dates in the configured timezone. */

Comment 2, line 59

desktop/src/App.svelte:59

/** Separate today query (D8): summary first_day=last_day for the current-day section. */

Comment 3, line 70

desktop/src/App.svelte:70

// Theme: system/light/dark through data-theme and derived isDark for ECharts.

Comment 4, line 71

desktop/src/App.svelte:71

/** Track system dark-mode changes so system-theme charts update immediately. */

Comment 5, line 81

desktop/src/App.svelte:81

/** Explicit light/dark wins; other values, including unknown settings, use system. */

Comment 6, line 85

desktop/src/App.svelte:85

/** Effective dark mode supplied to ECharts: explicit dark or system with a dark preference. */

Comment 7, line 88

desktop/src/App.svelte:88

// For system theme, remove data-theme and let themes.css prefers-color-scheme apply.

Comment 8, line 95

desktop/src/App.svelte:95

// v6 users: header selection and creation.

Comment 9, line 104

desktop/src/App.svelte:104

/** Force child queries to reload after user switches/imports without a changed query. */

Comment 10, line 108

desktop/src/App.svelte:108

// E10/E11 panel order/visibility, persisted per page in localStorage.

Comment 11, line 163

desktop/src/App.svelte:163

/** Default panel column span in the six-column grid. */

Comment 12, line 194

desktop/src/App.svelte:194

/** Hide trend cost panels when estimates are disabled, without rewriting the saved layout. */

Comment 13, line 208

desktop/src/App.svelte:208

/** Prefer a resized edit-mode column span over the panel default. */

Comment 14, line 214

desktop/src/App.svelte:214

/** Panel height in pixels; unmodified panels size automatically. */

Comment 15, line 219

desktop/src/App.svelte:219

/** Persist span/height and layout when resize dragging ends. */

Comment 16, line 226

desktop/src/App.svelte:226

/** Reset current-page localStorage layout to default order, dimensions and visibility. */

Comment 17, line 241

desktop/src/App.svelte:241

/** Shared overview/trend edit mode enables dragging and visibility controls. */

Comment 18, line 247

desktop/src/App.svelte:247

/**
* Pointer-based panel dragging fixed on 2026-09-26. With default dragDropEnabled=true,
* Tauri WebView2 intercepted HTML5 dragstart/drop. Use panel pointerdown and window
* pointermove/pointerup/pointercancel instead. elementsFromPoint identifies the target
* data-panel-group/-index during movement; releasing swaps and persists panel order.
*/

Comment 19, line 264

desktop/src/App.svelte:264

// A target in another group/page falls back to this panel, leaving its order unchanged.

Comment 20, line 357

desktop/src/App.svelte:357

// One cost query feeds the summary, model rows and curve on the active page.

Comment 21, line 395

desktop/src/App.svelte:395

// Cost curves are daily when usage is hourly; include all visible hours of the day.

Comment 22, line 440

desktop/src/App.svelte:440

/** Overview history and trends share period selection; reselecting the same overview point clears it. */

Comment 23, line 453

desktop/src/App.svelte:453

// User options include a synthetic current entry when absent from the list, such as initial default.

Comment 24, line 462

desktop/src/App.svelte:462

// Today shares include known lower bounds without replacing complete stored totals.

Comment 25, line 475

desktop/src/App.svelte:475

// Trend shares use the same display bounds over the selected range.

Comment 26, line 515

desktop/src/App.svelte:515

/** Date label for the today section. */

Comment 27, line 518

desktop/src/App.svelte:518

/**
* Selected-period cards mirror today: calls, input/cache/uncached, output, total tokens,
* cache ratio and sessions; week/month selections also show active days.
*/

Comment 28, line 578

desktop/src/App.svelte:578

/** Load the main and today queries together for one interaction/refresh.
* Preserve object references when query keys and data revisions are unchanged, avoiding
* idle chart redraws and flicker reported on 2026-09-26. */

Comment 29, line 631

desktop/src/App.svelte:631

/** Reload summary, heatmap and sources after a user switch/import without a changed query. */

Comment 30, line 640

desktop/src/App.svelte:640

// Open user creation while keeping the dropdown on the current user.

Comment 31, line 660

desktop/src/App.svelte:660

// Backend summary/heatmap follow the current user and must reload after switching.

Comment 32, line 693

desktop/src/App.svelte:693

// Collection-status polling and automatic data refresh.

Comment 33, line 694

desktop/src/App.svelte:694

/** Last observed completed-collection timestamp; a change requires data reload. */

Comment 34, line 696

desktop/src/App.svelte:696

/** Loaded summary query key and data revision, used to skip identical assignments. */

Comment 35, line 699

desktop/src/App.svelte:699

/**
* Reload data when collection finishes or its completion timestamp changes, including
* scheduled/headless collection. Idle polling updates status without rebuilding charts,
* preventing periodic overview flicker.
*/

Comment 36, line 705

desktop/src/App.svelte:705

// An accepted request may not have set the worker's running flag yet.

Comment 37, line 728

desktop/src/App.svelte:728

/* Retry a failed poll on the next interval. */

Comment 38, line 734

desktop/src/App.svelte:734

/**
* Poll every 500 ms during collection and every 10 seconds when idle.
* Idle status checks detect system/scheduler collection without redrawing charts.
*/

Comment 39, line 745

desktop/src/App.svelte:745

// Header query-refresh interval: localStorage persistence, default five minutes.

Comment 40, line 747

desktop/src/App.svelte:747

// The v2 key accompanies the default change from 60 to 300 seconds on 2026-09-26.

Comment 41, line 748

desktop/src/App.svelte:748

// Ignore the old stored default on first startup with this key.

Comment 42, line 766

desktop/src/App.svelte:766

/* Without storage access, keep the selection for this session only. */

Comment 43, line 807

desktop/src/App.svelte:807

// Today/two-calendar-day ranges select hourly data.

Comment 44, line 813

desktop/src/App.svelte:813

// Debounce changed queries by 200 ms and clear a selection whose period label may be stale.

Comment 45, line 834

desktop/src/App.svelte:834

// Preserve unchanged reactive fields and nested objects across autosave acknowledgements.

Comment 46, line 847

desktop/src/App.svelte:847

// F2: enabling pricing starts a background cost recomputation for retained details.

Comment 47, line 848

desktop/src/App.svelte:848

// Autosaving unrelated preferences must not start another cost recomputation.

Comment 48, line 878

desktop/src/App.svelte:878

// Collection ETA is empty when unavailable so the template hides it.

Comment 49, line 942

desktop/src/App.svelte:942

<!-- Query-refresh interval is independent of background collection; disabled means manual refresh. -->

Comment 50, line 1108

desktop/src/App.svelte:1108

<!-- Put range/granularity inside history because today uses an independent query. -->

Comment 51, line 1131

desktop/src/App.svelte:1131

<!-- Selecting a historical chart point shows period cards matching the today layout. -->

Comment 52, line 1158

desktop/src/App.svelte:1158

<!-- Model/Agent pies use chart_series with the same selected-period filters.
Match loading/chart heights and retain the old chart while replacing data to reduce movement. -->

Comment 53, line 1220

desktop/src/App.svelte:1220

<!-- Seven fixed range-summary cards above charts use summary.totals. -->

Comment 54, line 1375

desktop/src/App.svelte:1375

/* Highlight the panel-layout edit toggle when active. */

Comment 55, line 1410

desktop/src/App.svelte:1410

/* Header query-refresh selector shares a row with collection progress and refresh. */

Comment 56, line 1419

desktop/src/App.svelte:1419

/* Collection progress width follows its percentage, alongside percentage/ETA text. */

Comment 57, line 1497

desktop/src/App.svelte:1497

/* D8 today/history headings; history range/granularity filters affect that section only. */

Comment 58, line 1521

desktop/src/App.svelte:1521

/* History range/granularity controls sit beside its heading, separate from today. */

Comment 59, line 1535

desktop/src/App.svelte:1535

/* Selected-period heading and reused summary-cards grid inside history. */

Comment 60, line 1569

desktop/src/App.svelte:1569

/* Model/Agent pies use two columns, stacking on narrow screens. */

Comment 61, line 1582

desktop/src/App.svelte:1582

/* Match loading/empty-state height to reduce movement when changing selected periods. */

Comment 62, line 1590

desktop/src/App.svelte:1590

/* Match the SharePie loading placeholder to its 190px chart height. */

Comment 63, line 1596

desktop/src/App.svelte:1596

/* E10 six-column panel grid; Panel span classes set column widths. */

Comment 64, line 1604

desktop/src/App.svelte:1604

/* Keep metric rows compact; account quota has an independent full-width strip. */