From eebc9d2b41fb6b1154543f540ad96f5fea6306a4 Mon Sep 17 00:00:00 2001 From: h Date: Fri, 16 Oct 2026 03:58:49 +0000 Subject: [PATCH] feat(dashboard,accounts): reconcile, debts box, per-currency charts, validated series palette --- .../components/accounts/AccountShow.svelte | 8 +++-- .../components/accounts/AccountsIndex.svelte | 36 +++++++++++++------ src/lib/components/accounts/Reconcile.svelte | 6 ++-- src/lib/components/charts/BarRows.svelte | 33 +++++++++++++---- .../components/dashboard/AccountsChart.svelte | 10 ++++-- .../components/dashboard/BudgetsChart.svelte | 12 +++++-- .../dashboard/CategoriesChart.svelte | 4 ++- src/lib/components/dashboard/DebtsBox.svelte | 4 ++- src/lib/components/dashboard/InfoBoxes.svelte | 2 +- .../components/dashboard/InsightBox.svelte | 4 ++- .../components/dashboard/PiggyBanksBox.svelte | 4 ++- .../dashboard/SubscriptionsBox.svelte | 4 ++- src/lib/components/dashboard/data.ts | 2 +- src/routes/layout.css | 4 +++ 14 files changed, 101 insertions(+), 32 deletions(-) diff --git a/src/lib/components/accounts/AccountShow.svelte b/src/lib/components/accounts/AccountShow.svelte index 56be7ec..e51f1e3 100644 --- a/src/lib/components/accounts/AccountShow.svelte +++ b/src/lib/components/accounts/AccountShow.svelte @@ -385,14 +385,18 @@ /> {#snippet footer()} {#if everything} - Show the current period and overview {:else} - Show all transactions without grouping them by date {/if} diff --git a/src/lib/components/accounts/AccountsIndex.svelte b/src/lib/components/accounts/AccountsIndex.svelte index 50bcb00..fcdea2a 100644 --- a/src/lib/components/accounts/AccountsIndex.svelte +++ b/src/lib/components/accounts/AccountsIndex.svelte @@ -68,14 +68,19 @@ } const COLUMNS: Record = { - active: { key: "active", label: "Is active?" }, + active: { key: "active", label: "Is active?", wide: true }, activity: { key: "activity", label: "Last activity", wide: true }, balance: { key: "balance", label: "Current balance", num: true }, - difference: { key: "difference", label: "Balance difference", num: true }, - direction: { key: "direction", label: "Liability in/out" }, - due: { key: "due", label: "Amount due", num: true }, + difference: { + key: "difference", + label: "Balance difference", + num: true, + wide: true, + }, + direction: { key: "direction", label: "Liability in/out", wide: true }, + due: { key: "due", label: "Amount due", num: true, wide: true }, interest: { key: "interest", label: "Interest (period)", wide: true }, - liability: { key: "liability", label: "Type of liability" }, + liability: { key: "liability", label: "Type of liability", wide: true }, name: { key: "name", label: "Name" }, number: { key: "number", label: "Account number", wide: true }, role: { key: "role", label: "Role", wide: true }, @@ -163,7 +168,14 @@ ); const otherCount = $derived(others.data?.meta.pagination?.total ?? 0); - const columns = $derived(LAYOUT[type].map((k) => COLUMNS[k])); + const numbered = $derived( + (accounts.data ?? []).some((item) => formatIban(item.attributes)) + ); + const columns = $derived( + LAYOUT[type] + .filter((k) => k !== "number" || numbered) + .map((k) => COLUMNS[k]) + ); const sortParam = $derived(page.url.searchParams.get("sort") ?? ""); const sortKey = $derived(sortParam.replace("-", "") as Key | ""); const descending = $derived(sortParam.startsWith("-")); @@ -447,7 +459,9 @@ : "Nothing archived"}

{#if active} - Create a new {TYPE_ONE[type]} {/if} @@ -456,7 +470,7 @@ @@ -518,7 +532,7 @@ > {#if col.key === "name"} {a.name} {/if} {#snippet footer()} - Create a new {TYPE_ONE[type]} {#if failure} diff --git a/src/lib/components/accounts/Reconcile.svelte b/src/lib/components/accounts/Reconcile.svelte index c327a7e..eafed91 100644 --- a/src/lib/components/accounts/Reconcile.svelte +++ b/src/lib/components/accounts/Reconcile.svelte @@ -361,7 +361,9 @@ {#if a && a.type !== "asset"}

You can only reconcile asset accounts. - Back to {a.name} + Back to {a.name}

{:else}
@@ -512,7 +514,7 @@

The first correction for this account has to be booked in Firefly's own reconcile page(); + let width = $state(0); const stacks = $derived(rows.map((row) => ({ row, ...stack(row, keys) }))); const lo = $derived(Math.min(0, ...stacks.map((s) => s.negative))); @@ -34,6 +37,14 @@ const span = $derived(hi - lo || 1); const pos = (value: number) => ((value - lo) / span) * 100; const total = (s: (typeof stacks)[number]) => s.positive + s.negative; + const valueText = (s: (typeof stacks)[number]) => + s.row.note ?? (s.row.format ?? format)(total(s)); + const wide = $derived( + width === 0 || + width >= + WIDE_BASE + + Math.max(0, ...stacks.map((x) => valueText(x).length)) * CHAR + ); function box({ from, to, outer }: Segment, first: boolean) { const up = to > from; @@ -70,16 +81,20 @@ } -

+ {#snippet footer()} - View your asset accounts {#if converted} diff --git a/src/lib/components/dashboard/BudgetsChart.svelte b/src/lib/components/dashboard/BudgetsChart.svelte index fe1147b..4187ffe 100644 --- a/src/lib/components/dashboard/BudgetsChart.svelte +++ b/src/lib/components/dashboard/BudgetsChart.svelte @@ -92,7 +92,11 @@

No budgets with a limit or spending in this period. Set an amount for a budget on the - budgets page. + budgets page.

{:else} {#each visible as group (group.code)} @@ -116,6 +120,10 @@ {/if}
{#snippet footer()} - Go to your budgets + Go to your budgets {/snippet} diff --git a/src/lib/components/dashboard/CategoriesChart.svelte b/src/lib/components/dashboard/CategoriesChart.svelte index 4818cd2..952aea3 100644 --- a/src/lib/components/dashboard/CategoriesChart.svelte +++ b/src/lib/components/dashboard/CategoriesChart.svelte @@ -101,7 +101,9 @@ {/if}
{#snippet footer()} - Go to your categories {/snippet} diff --git a/src/lib/components/dashboard/DebtsBox.svelte b/src/lib/components/dashboard/DebtsBox.svelte index 3b41f77..e9cce1f 100644 --- a/src/lib/components/dashboard/DebtsBox.svelte +++ b/src/lib/components/dashboard/DebtsBox.svelte @@ -95,7 +95,9 @@ {/each} {#snippet footer()} - See your liabilities {/snippet} diff --git a/src/lib/components/dashboard/InfoBoxes.svelte b/src/lib/components/dashboard/InfoBoxes.svelte index 6ce800b..4b2f796 100644 --- a/src/lib/components/dashboard/InfoBoxes.svelte +++ b/src/lib/components/dashboard/InfoBoxes.svelte @@ -164,7 +164,7 @@ : ""}" >