Hide the bills month pulse on a page of only paused bills

Merged
GA
2mo ago
+59-2

Stacked on #3905. Merge that first; this PR's diff is only the commit on top.

Problem

#3905 hides the month pulse and the AI prompts when the overview has no bill rows. It counts Dormant rows as bill rows, but Dormant rows don't feed the pulse: compute_kpis totals overdue + this-month rows, and Next up draws from this-month + later rows. So a page whose only rows are paused bills still shows the zero card ("–", "left to pay", "$0.00 paid", "0 bills") and chips asking "What's due before my next paycheck?" about bills nobody is paying.

You can reach it with a real pause: pause your only bill while its occurrence is overdue. The open occurrence stays and comes back as a Dormant row.

Behavior

The pulse and the chips now need an overdue, this-month (paid or unpaid) or later row. The empty state keeps its own check, which still counts Dormant rows, so a paused-only page shows the header, the view switcher and the Dormant section, with no "No bills yet".

  • Only Dormant rows: no pulse, no chips.
  • Only later rows: the pulse stays (Next up lists them).
  • Only paid rows: the pulse stays (it shows the paid total).
BeforeAfter
beforeafter

Validation

  • Three new controller tests: paused-only (seeded with a real mark_inactive! and a leftover overdue occurrence), later-only, and paid-only (paid this month, then paused). With the view change reverted, only the paused-only test fails.
  • bin/rails test: 10432 runs, 0 failures, 1 error. The error is ReportsControllerTest "a disposal carried in a third currency…", which is date-dependent: on the 1st of the month, Date.current.beginning_of_month collides with a fixture exchange rate. It's unrelated to this change.
  • Bills system tests: declare_and_pay_bill_test.rb:15 errors with the same RecordNotFound on the base branch without this change, so it's also date-dependent and not caused by this PR. The rest pass.
  • Rubocop, erb_lint and Brakeman are clean. No JS changed, so Biome doesn't apply.

Summary by CodeRabbit

  • Bug Fixes
    • The month overview and AI prompts appear when bills are overdue, due this month, or due later. Paused bills alone no longer trigger them, while the empty state continues to account for paused bills.
  • Tests
    • Added coverage confirming that paused-only bills do not trigger the overview or prompts, future-due bills retain the overview, and paid bills can appear in the overview without showing the paused section.