Skip to content

feat: payment history, price changes over time and actual spending - #6

Merged
lestolo merged 1 commit into
mainfrom
claude/brave-ride-ephvtr
Oct 4, 2026
Merged

lestolo merged 1 commit into
mainfrom
claude/brave-ride-ephvtr

Conversation

@lestolo

@lestolo lestolo commented Oct 4, 2026

Copy link
Copy Markdown
Owner

Description

Adds a payment history so the app tracks what was actually paid, not only the projected monthly cost.

A. Calculated history. Past charges are derived from each subscription's start date, frequency and a new price history. A price applies to charges on or after its date, so a price increase no longer rewrites the past.

B. Manual corrections. Any past charge can be confirmed with the amount actually paid, or marked as not charged. Either can be reset to the automatic value.

Changes

  • js/core/history.js (new, pure and tested): priceAt, charges, summary, monthly (12-month buckets per currency), withPrice and skippedWhilePaused.
  • db.sanitize validates the new optional fields priceHistory, charges and pausedAt, including in imported backups. Older records get a single-entry history, so no IndexedDB schema migration is needed.
  • Edit form:
    • a "Paid so far" card opens the history sheet;
    • changing the price asks whether the new price applies from the next renewal, from the last charge, or to the whole history;
    • pausing records pausedAt, and resuming marks the renewals in between as not charged.
  • History sheet: charges listed newest first, each with a status chip (Calculated / Confirmed / Not charged / Upcoming), "expected X" when a confirmed amount differs, and the list of price changes. Tapping a charge opens a small editor.
  • "Actual spending" card on the home screen: last 12 months and year to date, plus a single-series monthly bar chart.
    • The bars have 4 px rounded tops anchored to the baseline. Hover, focus or tap shows the month's value in a readout, and every bar has an aria-label.
    • Amounts in other currencies are converted with the user's exchange rates. A note appears when a currency is left out because it has no rate.
    • The accent colour passes the palette validator against both the light and dark surfaces.
  • The upcoming cards, the list and the reminder notifications now use the price in force at the next renewal.
  • Undo after delete restores the latest stored copy, including confirmations made in the history sheet.
  • Price history and charges are included in the JSON backup.

Also fixed

  • On narrow phones (iPhone SE/mini, 320–375 px) the content of the sheets overflowed horizontally. The form grids now use minmax(0, 1fr), and the frequency selector wraps to a 2×2 grid under 420 px.

Bumps ST.VERSION to 1.1.0, and updates the CHANGELOG and both READMEs.

Known limitation

Subscriptions paused before this version have no pausedAt, so their history keeps counting charges. Users can mark those charges as not charged by hand.

Type of change

  • Bug fix
  • New feature
  • Catalogue / translations
  • Documentation
  • Refactoring / tooling

Checklist

  • npm test passes (25 tests; 8 new ones in tests/history.test.js cover month-end dates, price changes, overrides, pause/resume, monthly buckets and sanitising malformed input)
  • Tested on a phone-sized viewport, in light and dark mode:
    • iPhone 14 and iPhone SE emulation, with legacy v1.0.x records written straight to IndexedDB;
    • all totals checked by hand: 9 × 6,99 € = 62,91 €, and after one confirmation at 7,49 € plus one skipped charge, 56,42 € over 8 charges;
    • a price change from the next renewal leaves past charges at the old price;
    • saving the form keeps the confirmations made in the history sheet, and Undo after delete restores them;
    • there is no horizontal overflow at 320 px;
    • regression runs pass for the full flow, offline mode, the sheet animations and the single-currency "null" fix, with no console errors.
  • New UI strings are translated in every language in js/core/i18n.js
  • ST.VERSION bumped if cached assets changed (sw.js → ASSETS, which now includes js/core/history.js)
  • No secrets, API keys or personal data added
  • No new runtime dependencies or third-party requests

🤖 Generated with Claude Code

https://claude.ai/code/session_0127iNTyhnYEypEm4cd97XPA


Generated by Claude Code

Past charges are derived from the billing schedule and a per-subscription
price history; any charge can be confirmed with the amount actually paid
or marked as not charged.

- js/core/history.js: priceAt, charges, summary, monthly buckets,
  withPrice and skippedWhilePaused (pure, covered by tests)
- db.sanitize validates priceHistory, charges and pausedAt; legacy
  records get a single-entry history, so no schema migration is needed
- Editing the price asks whether it applies from the next renewal, from
  the last charge or to the whole history
- Pausing records pausedAt; resuming marks the renewals in between as
  not charged
- History sheet from the edit form, per-charge editor, and an "Actual
  spending" card with last 12 months, year to date and a monthly chart
- Upcoming cards, list and reminders use the price in force at the
  next renewal
- Undo after delete restores the latest stored copy (with confirmations)

Also fixes horizontal overflow on narrow phones: form grids use
minmax(0, 1fr) and the frequency selector wraps to 2x2 under 420px.

Bumps the version to 1.1.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0127iNTyhnYEypEm4cd97XPA
@vercel

vercel Bot commented Oct 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
sub-track Ready Ready Preview Oct 4, 2026 5:04pm UTC

Request Review

@lestolo
lestolo merged commit dfd95c1 into main Oct 4, 2026
3 checks passed
@lestolo
lestolo deleted the claude/brave-ride-ephvtr branch October 4, 2026 17:06

This branch was successfully deployed

1 active deployment
Preview — 6b82a2ea Deployed Oct 4, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants