Skip to main content

v1.2.x

All releases on the 1.2 minor line. Newest first.


v1.2.0 — 2026-06-02

Adds a new asset tracking model for recurring-contribution products, collapses asset and liability groups by default, and fixes a tracking-model bug that affected edits.

New Features

  • Contribution-based assets (Assets). A fourth tracking model for products you pay into over time while the value floats on its own — a robo-advisor pot is the canonical example. Unlike unit-based assets there are no share quantities, and unlike balance-based accounts it tracks a cost basis, so it can show real profit and loss. Pick "Contribution-Based" when adding an asset, enter the total contributed and the current value, then use the Contribute / Withdraw action to record top-ups and withdrawals over time.
  • Profit & loss that survives withdrawals (Assets). Withdrawals use average-cost accounting: taking money out reduces the cost basis proportionally to the share of value withdrawn, so the displayed P&L always reflects the gain or loss on what's still invested. The asset's history shows each contribution and withdrawal as a signed flow.

Bug Fixes

  • Editing an asset no longer changes its tracking model (Assets). A defaulting bug silently rewrote balance-based, unit-based, and contribution-based assets to value-based on every edit, which broke their dedicated flows (balance updates, buy/sell) and mis-classified them in the summary breakdown. Edits now preserve the model. Assets that had already been mislabeled by this bug were repaired — their underlying values were intact, only the model label was corrected.

Improvements

  • Asset and liability groups start collapsed (Assets, Liabilities). Opening either table now shows every group collapsed, so you land on a compact overview and expand only the groups you care about instead of scrolling past every category at once.

Internals & quality

  • 246 unit tests, up from 211 at v1.1.0. New coverage spans the contribution money math (gains, losses, full withdrawals, over-withdrawal rejection, the home-currency mirror, and the unrealized-P&L invariant), the payload/validation/calculation wiring for the new model, and a regression test that guarantees an edit preserves every tracking model.
  • New pure helper lib/finance/contribution.ts holds the average-cost contribution/withdrawal math, kept separate from persistence so it is exhaustively unit-tested.

Migration & data notes

  • One database change: the asset tracking-model constraint now also permits contribution_based. It is forward-compatible — existing rows are unaffected and no action is required on upgrade.
  • Data repair (one-off): assets previously converted to value-based by the editing bug were restored to their correct unit-based or balance-based model. Stored quantities, prices, and balances were untouched; only the model label changed.