mirror of
https://github.com/Komediruzecki/token-circles.git
synced 2026-10-20 09:46:43 +02:00
Every aggregate now says what it means, and its math is right: - Analytics Top Categories Breakdown: monthly/daily averages divided by the actual period (elapsed months/days for the current year, 12/365-366 for past years) instead of the hardcoded /6 and /30; title now names the year - Category Trends: legend hint text; double-click a legend item to solo that category (click still toggles); an 'All categories' dropdown solos on small screens where legend clicking is fiddly; solo resets when data reloads - Import session log: new import_logs table (worker migration 0014) + IndexedDB store (v9) with GET/POST /api/import-logs in both modes; the Import page records every successful import (source, imported, duplicates skipped, accounts/categories created with names) and lists them under 'Recent Imports' with expandable details; import/execute responses now report created category/account names in both modes - InfoTip component: small circled-i with formula + time window on Dashboard metric cards, Analytics topline + monthly cards, breakdown stats, and the trends averages - CalcTracer v1 (dev builds, or localStorage.devCalcTracer='1'): clicking an instrumented Dashboard/Analytics metric card opens a trace modal with the formula (values substituted), inputs, contributing monthly rows, and the source endpoint - fix: paste-CSV parse left the 'Processing...' overlay up forever (missing setLoading(false) on the success path), blocking Continue to Preview Verified in chromium (demo mode): breakdown title/denominators, solo dropdown + legend, tracer modals on both pages, paste-CSV import writing and listing its log entry (survives reload). Worker: 46 tests; frontend: 375 tests.
18 lines
819 B
SQL
18 lines
819 B
SQL
-- Per-import session log: what each import created and skipped, so users can audit
|
|
-- past imports from the Import page (counts + a JSON details blob with the created
|
|
-- account/category names). Written by the client after a successful /api/import/execute.
|
|
CREATE TABLE IF NOT EXISTS import_logs (
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
profile_id INTEGER NOT NULL,
|
|
import_id TEXT,
|
|
source TEXT NOT NULL DEFAULT '',
|
|
imported INTEGER NOT NULL DEFAULT 0,
|
|
duplicates_skipped INTEGER NOT NULL DEFAULT 0,
|
|
accounts_created INTEGER NOT NULL DEFAULT 0,
|
|
categories_created INTEGER NOT NULL DEFAULT 0,
|
|
details TEXT,
|
|
created_at TEXT DEFAULT (datetime('now')),
|
|
FOREIGN KEY (profile_id) REFERENCES profiles(id) ON DELETE CASCADE
|
|
);
|
|
CREATE INDEX IF NOT EXISTS idx_import_logs_profile ON import_logs(profile_id);
|