Show the Income plan AI chips only when there is a plan
Problem
With no income declared, the Income plan showed "What's due before my next paycheck?" and "How much is safe to spend this period?" above "Declare your income schedule". There is no paycheck and no period yet, so both chips opened a chat that could only say so. #3905 removed the same dead-end chat from the overview; this is the Income plan's copy of it, found while reviewing that PR.
Change
paycheck.html.erb renders the chips only when @plan is set. load_paycheck_plan sets @plan = planner.plan.presence, so it is nil exactly when the "Declare your income schedule" empty state renders. The income list keeps its own condition: a family whose income can't be planned (for example, only paused income) still sees that income and the empty state, without the chips. With a plan, the page is unchanged.
Validation
- New controller test, with AI available, walks three states: no income (empty state, "Review with AI" present to prove AI is on, no chips), paused income (income listed, empty state, no chips), active income (plan and both chips). Dropping the income list from the view fails it.
bin/rails test: 10430 runs, 1 error,ReportsControllerTest"a disposal carried in a third currency…". It fails on its own on a month's first days, and #3902 fixes it.- Bills system tests:
DeclareAndPayBillTest"declare rent, allocate a real payment…" errors withRecordNotFoundfor aRecurringOccurrence. It fails the same way with this change reverted, so it predates this PR (looks date-dependent; today is the 1st). - erb_lint, rubocop and Brakeman are clean. No JS changes.
Screenshots
Captured from a throwaway system test (2026-09-16, chips stubbed as available). Each grid: before light, before dark, after light, after dark.
No income, 1440

No income, 375

With a plan, 1440 (unchanged)

With a plan, 375 (unchanged)

Summary by CodeRabbit
- Bug Fixes
- AI prompt chips on the paycheck view now appear only when a paycheck plan exists. The AI review button remains available when no plan exists and a provider is configured.