* [AI] Fix live spending reports not following the current month
Spending reports marked Live stayed pinned to the month they were saved
in. Every other report stores liveness inside its range object
(TimeFrame's `mode`), which makes "live but pinned to a month"
unrepresentable and lets a live range be read for its width rather than
its position. Spending instead stores `isLive` as a sibling of
`compare`/`compareTo`, so it can persist both at once, and #7672 made
`calculateSpendingReportTimeRange` resolve that conflict in favour of
the saved month.
Restore the two invariants the other reports rely on:
- Budget and average live reports resolve to the current month instead
of the saved one, and live single-month reports fall through to the
sliding-window path, which re-anchors to now while preserving the gap
between the two series.
- Picking a compare month now makes the report static, the same way the
date picker does elsewhere. This keeps #7648 fixed - the chosen month
is still preserved - without making live reports behave statically.
The "to" select deliberately stays live, since its offset is what
slides.
- Toggling Static back to Live re-anchors the shown months immediately,
matching the Live button in the shared reports header.
Already-saved cards self-heal on load; no migration is needed.
Co-Authored-By: Claude Opus 5 <[email protected]>
* [AI] Default a missing compareTo to the month before compare
A spending report saved with `compare` but no `compareTo` fell through
to the default end, which is the month before now. The comparison then
widened to the distance between the two months instead of staying on
the adjacent-month pair - a report on 2016-01 became a 12-month span.
The #7672 early return masked this for live reports by never reaching
the shared range path; removing it exposed the gap, which predates that
PR. Static reports were affected the same way and are fixed too.
Co-Authored-By: Claude Opus 5 <[email protected]>
* [AI] Trim comments in the spending range code
Co-Authored-By: Claude Opus 5 <[email protected]>
---------
Co-authored-by: Claude Opus 5 <[email protected]>