Use real timestamps on history chart x-axes.

Plot snapshots by export or import time instead of category indices so
coins, level, skill, and inventory trends reflect actual elapsed time.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-20 09:43:31 +02:00
parent b6cc0f6984
commit 3314de829d
2 changed files with 105 additions and 24 deletions
+3 -3
View File
@@ -338,7 +338,7 @@ def timeline(db_path: Path | str = DEFAULT_DB) -> list[dict]:
init_db(conn)
rows = conn.execute(
"""
SELECT s.id, s.exported_at, s.coins, s.total_level, s.character_name, s.source_file
SELECT s.id, s.imported_at, s.exported_at, s.coins, s.total_level, s.character_name, s.source_file
FROM snapshots s ORDER BY s.exported_at ASC, s.id ASC
"""
).fetchall()
@@ -352,7 +352,7 @@ def inventory_timeline(db_path: Path | str = DEFAULT_DB) -> dict[str, Any]:
init_db(conn)
snap_rows = conn.execute(
"""
SELECT id, exported_at FROM snapshots
SELECT id, imported_at, exported_at FROM snapshots
ORDER BY exported_at ASC, id ASC
"""
).fetchall()
@@ -1047,7 +1047,7 @@ def skill_timeline(db_path: Path | str = DEFAULT_DB) -> dict[str, Any]:
init_db(conn)
snap_rows = conn.execute(
"""
SELECT id, exported_at FROM snapshots
SELECT id, imported_at, exported_at FROM snapshots
ORDER BY exported_at ASC, id ASC
"""
).fetchall()