Show a bill row's verb only when the bill needs you now

Merged
GA
2mo ago
+231-122

Problem

Each Bills overview row gets one trailing verb (bills/_row_action.html.erb), and the choice was inconsistent:

  • Settled rows (paid, skipped, missed) showed an outline Manage payments. It was as loud as Add payment on a row that still owes money. The partial's own rule was "a row that needs nothing from you now shows nothing", and the drawer already offers it.
  • Pay depended only on a portal link. Comcast showed an accent Pay 23 days out while every other upcoming row was silent.
  • Autopay was checked before overdue, so an autopay bill past its grace got no verb, even though its charge never showed up. On schedule, autopay rows with a portal carried an external-link icon on every date.
  • A partial row offered Add payment whatever the date, and a paused bill's leftover (Dormant) offered Find payment.
  • A trailing labelled verb pushed its amount about 125px left, so the amounts zig-zagged.
  • Below @lg the verbs were bare icons (search, plus, git-compare, receipt-text). The last two don't read as Review match or Manage payments.

Change

One rule, first match wins (BillsHelper#bills_row_verb):

SituationRow verb
Series not active (Dormant)none
Settled (paid, skipped, missed)none
Pending match suggestion, any dateReview match
Partial, and due or overdueAdd payment
Autopay, and not overduenone (the portal is in the drawer)
Due or overdue, with a portal linkPay
Due or overdue, without oneFind payment
Anything elsenone

An autopay bill past its grace now falls through to Pay or Find payment like any other bill. The drawer keeps its own rule (bills_drawer_verb) and always offers a verb, including Manage payments and the Find payment fallback.

Layout.

  • From @lg, the verb sits in a min-w-36 slot that every row reserves, right-aligned. Silent rows keep the empty slot, so the amounts share one right edge.
  • 144px fits the widest English verb, Review match, which measures 130px (Find payment is 127px, Add payment 125px).
  • The slot uses min-w rather than w, so a longer locale widens it instead of overflowing.
  • Below @lg, rows carry no verb, Pay included. The subline already says why the row matters, and tapping the row opens the drawer with the verb spelled out.
  • @lg is measured on the list's container, so this also covers 1280px with both sidebars open, and 1400px too (the list is about 507px there).

Pay moves into recurring_transactions/_pay_link, which _pay_action and the row now share. That lets a row offer Pay for an overdue autopay bill, which _pay_action never does. _pay_action's show_state: false branch, the autopay external-link icon, had only the row as a caller. It goes, along with its open_site key.

Screenshots

These come from the Bills audit harness: every row state seeded and pinned to Wed 2026-09-16, plus a month-end run on 09-29. "Before" is origin/main at 14638a701.

1440: This month, After this month, Dormant. Gone: Rent's Manage payments, Comcast's Pay 23 days out, Spotify's portal icon and The Atlantic's Find payment. The amounts line up.

1440 before and after

Dark

1440 dark before and after

1440: Needs attention. Same verbs as before, and the amounts now share one edge.

Needs attention before and after

375. No verbs, and the names get that room back ("PG&E Electric" in full).

375 before and after

Dark

375 dark before and after

Month end, 2026-09-29. The Oct 1–2 rows are inside the 3-day notify window, so they show Find payment, or Pay where there's a portal. The Oct 12 and Oct 30 rows stay silent.

Month end before and after

1280 with both sidebars. The list is below @lg, so no row carries a verb.

1280 before and after

Row verbs at rest, on hover and with keyboard focus. Manage payments no longer appears on rows, and Pay now appears only inside the window.

BeforeAfter
verbs beforeverbs after
All section grids (desktop 1440 and 375, light and dark)
BeforeAfter
Needs attention
This month
After this month
Dormant
Month end, 09-29
1280 with both sidebars

Validation

  • bin/rails test: 10511 runs, 0 failures, 0 errors, 33 skips.
  • Bills system tests (bill_drawer, bills_mobile, declare_and_pay_bill, find_my_bills, recurring_transaction_frequency): 15 runs, 0 failures.
  • New helper tests:
    • one per rule row, plus the exclusions: settled, Dormant, autopay on schedule, a partial outside its window, and Pay outside its window;
    • the order: settled beats a pending match, and a match or a partial beats autopay;
    • the drawer's rule.
      Moving the autopay line above Review match turns them red.
  • New phone system test in bills_mobile_test: a row has no verb, and its drawer has Find payment. Showing the slot below @lg turns it red.
  • Updated tests:
    • The autopay portal is checked in the drawer, not on the row.
    • Declare-and-pay reaches Add payment through the drawer, because its bill is 10 days out.
    • One drawer-Back test widens the window to 1440 so its row shows Find payment.
  • RuboCop, erb_lint, Biome and Brakeman: clean.

Notes

  • A paid row that still has a pending match shows no verb, because Settled comes first in the table. Needs review still lists the match.
  • An overdue autopay row keeps the row-level opacity-70, so its Pay is dimmed. #3911 replaces that opacity with per-text tones, so this PR leaves it alone.
  • #3911 and #3921 also edit _occurrence.html.erb, on the row's classes rather than this slot. Whichever lands second needs a small merge.

Summary by CodeRabbit

  • New Features
    • Bill actions now reflect payment status: due or overdue bills can offer Pay or Find payment, while partial payments can offer Add payment.
    • Bill drawers provide relevant actions, including Find payment for scheduled bills and payment management options for other bills.
    • Bills with a payment link show a clearly labeled Pay link.
  • Updates
    • Payment actions are hidden from bill rows on phones and for autopay bills that are still due; open the bill drawer to access available actions.