Add cost history to the Costs page: what it cost each month, and what changed

Each cost item's name, amount, currency, period and kind are kept as versions (cost_item_versions), and Hetzner's estimate is written down once a day (cost_snapshots), so a past month's figure and the changes between can be worked out. History card with monthly bars per currency, month-by-month figures and a list of added, changed and removed items.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
bobbanandClaude Sonnet 5.5 committed 2026-11-04 23:57:59 +01:00
1 parent b29c0b7d04
commit 9f366c37de
15 files changed
+9716 -3

No files matched your search

+2
View File
@@ -1,6 +1,7 @@
import { useEffect, useMemo, useState } from "react";
import { Link } from "react-router-dom";
import { api, type CostInput, type CostItem, type CostsReport, type CurrentUser } from "../api/client";
import CostHistory from "../components/CostHistory";
import EmptyState from "../components/EmptyState";
import { BlockSkeleton } from "../components/Skeleton";
import { ErrorNotice } from "../components/Notice";
@@ -264,6 +265,7 @@ export default function Costs({ user }: { user: CurrentUser }) {
</div>
</div>
)}
{report && !empty && <CostHistory refreshKey={report} />}
</>
);
}