Hide net contributions before a linked account's history

JA
7d ago
+119-9

Closes jaysbeekay/sure#878

What: for a period that ends before a linked investment account's supported history starts, the account chart no longer draws the net contributions comparison. It used to read 0 under the raw balances, with a "+∞" difference at every point. The comparison, its legend and the incomplete note are hidden together.
Where to start: Account::Chartable#net_contributions_comparable?, read by UI::Account::Chart#show_net_contributions?.
Key tests: chart_test.rb "a linked account's period before its supported history draws no net contributions"; chartable_test.rb "a linked account's period ending before its supported history is not comparable".
Behaviour change: only for such a period. What the line means is unchanged (option A, owner's decision 2026-11-20). A period ending on the first supported date is trimmed and still compared.
Base: up/portfolio-pending-counterpart-v3 (returns stack top, #5396), at 7ef65fe1f. No upstream PR yet.

Evidence
  • Re-scoped against jjmata's opening-marker fix (8c1b77d5c): that fix changes only the anchor-day point. With an untrimmed line the builder's start (the anchor) is after through, so it returns no rows and every point is fetch(date, 0). The defect stands.
  • Red: the component test failed before the fix, with the comparison rendered at 0 against 1,000 and "+∞" at both points.
  • Mutations (each caught): dropping the gate in show_net_contributions?; <= instead of < at the boundary; a missing anchor read as not comparable.
  • Full unit suite on 43ffb77ae: 18,012 runs, 0 failures. The 8 errors are ReleaseNotesWorkflowTest (no node).
  • Siblings: net_contributions_incomplete? reads the same anchor and builder rows as the line and already answers false here, because the rows are empty. That is asserted, not changed. InvestmentStatement#net_contributions is a separate statement figure.

Upstream PR: we-promise/sure#5624 (same branch, same commits; stacked on we-promise/sure#5396 in the returns stack). Upstream issue: we-promise/sure#5623.

Screenshots

A linked (Plaid) investment account from fixtures: balances from day one, first provider activity on day three, chart period day one to day two, so the whole period sits before the supported history. Before, the Total value chart draws a flat dashed net-contributions line at 0 with its legend; after, the chart shows the value line alone.

LightDark
Before (we-promise/sure#5396 head)before-lightbefore-dark
After (this PR)after-lightafter-dark