Stack the bills pay-period band on narrow lists

Merged
GA
2mo ago
+30-23

Problem

On the Bills overview, weekly or biweekly income splits This month with pay-period bands: "Paycheck Sep 18 · +$1,240.00" on the left and "$575.47 due before Sep 25" on the right (bills/_pay_period_marker.html.erb). The two halves need about 350px side by side. At 375px they don't fit, so the label wrapped onto two ragged lines while the total stayed on one line beside it.

The partial's comment explains that both halves name a date on purpose, so shortening the copy wasn't an option.

Change

Below the list's @lg container, the band stacks: the label first, then the total underneath, aligned with the label's text rather than the icon. From @lg up it's a single line, as before.

The breakpoint is the container query the rows already use. A 1280px window with both sidebars (where #main is about 475px) gets the stacked band too, which matches the phone-style rows around it there.

Markup: the icon stays outside a text column, and that column is flex-col below @lg and flex-row from it. Because the total sits in the same column as the label, it lines up with the label text without a padding value tied to the icon's size.

Screenshots

These come from the Bills audit harness: seeded bills with weekly pay, pinned to 2026-09-16.

375, light and dark, before and after. Both bands in This month.

375 before and after

1280 with both sidebars open (#main about 475px). The list lays out phone-style here, and now so does the band.

1280 before and after

1440, light and dark: unchanged. Before and after are pixel-identical (ImageMagick compare -metric AE = 0).

Validation

  • bin/rails test: 10430 runs, 0 failures, 0 errors, 33 skips.
  • Bills system tests (bills_mobile, find_my_bills, recurring_transaction_frequency, declare_and_pay_bill): 9 runs, 1 error. The error is declare_and_pay_bill_test.rb:15 (RecordNotFound), which only happens locally: it types %m/%d/%Y into a native date field, and this machine's Chrome reads that day-first. It fails on main too and is fixed by the first commit of #3885. CI's Chrome is month-first.
  • erb_lint on the changed partial, npm run lint (Biome) and bin/brakeman are all clean. No Ruby files changed.
  • No new test: the change is layout only, with no behaviour for Minitest to check. The screenshots above are the check.

Summary by CodeRabbit

  • Style
    • Pay-period labels and due totals now stack on narrower displays and appear side by side on wider displays.