Skip to content

Web UI: instant filter toggles, Envelope-first Spending, mark-from-missing, missing-charge coverage fix - #11

Merged
dfrysinger merged 1 commit into
mainfrom
subs-ui-and-toggle-improvements
Jul 10, 2026
Merged

dfrysinger merged 1 commit into
mainfrom
subs-ui-and-toggle-improvements

Conversation

@dfrysinger

Copy link
Copy Markdown
Owner

Summary

Four bundled Subscriptions/Spending web-UI improvements plus a correctness fix to the "missing expected charges" alert.

UI

  • Instant filter toggles — boolean filters (exclude income, transfers) now render as checkboxes that apply immediately on change. The Load button is dropped on tabs whose only manual filter is a toggle. Filter state round-trips through filterVal/setFilterVal, so the subtab-crossing rebuild preserves checkbox state.
  • Envelope-first Spending — Envelope is now the first Spending subtab and the default grouping.
  • Mark from missing — the "missing expected charges" rows get a Mark control that reuses the tracked-row modal, resolving the bill by name (no more scrolling to find the parent subscription).

Missing-charge coverage fix

  • Only report an occurrence as missing when our data fully covers the span in which its charge could have posted. A charge may clear up to day_tolerance days early, so the coverage floor is min(window_start, earliest_txn). If the earliest-possible payment date falls before that floor, an early payment there would be unobserved and the occurrence's absence is unknowable — not a proven miss. This is the just-started-bill leading edge that was showing "missing … last seen never" beside a real tracked last-seen (the Intermountain MyChart discrepancy).
  • Genuine, fully-covered skips are still reported (including a narrow-window leading edge over an archive with older history, and a skip before a bill's first observed charge).
  • A missing row's last_seen is now derived from the matched charge dates strictly before the occurrence, so it can never postdate its own due date even under a large (but valid) day_tolerance where greedy matching assigns a later charge to an earlier occurrence.

Tests

  • New subscription regression tests: uncovered leading edge suppressed; covered occurrence reported; covered narrow-window leading edge reported; last_seen never postdates the due date (incl. large-tolerance case). All proven to fail for the right reason.
  • New web-UI design guards INV-WEBUI-007/008/009 (Envelope-first, mark-from-missing, instant bool checkbox) registered in docs/architecture/INVARIANTS.md.
  • Full suite: 769 passing.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

…ssing, missing-charge fix

- Render bool filters (exclude income, transfers) as checkboxes that apply
  instantly on change; drop the Load button on tabs whose only manual filter is
  a toggle. Filter state now reads/writes through filterVal/setFilterVal so the
  subtab-crossing rebuild preserves checkbox state.
- Make Envelope the first Spending subtab and the default grouping.
- Add a Mark control to the Subscriptions "missing expected charges" rows,
  reusing the tracked-row modal and resolving the bill by name.
- Only report a missing occurrence when our data fully covers the span in which
  its charge could have posted. A charge may clear up to day_tolerance days
  early, so the coverage floor is the earlier of the earliest transaction we
  hold and the audit window start. If that earliest-possible payment date falls
  before the floor, an early payment there would be unobserved and the
  occurrence's absence is unknowable, not a proven miss. This is the
  just-started-bill leading edge that was reported "missing ... last seen never"
  beside a real tracked last-seen. Genuine, fully-covered skips (including a
  narrow-window leading edge over an archive with older history, and a skip
  before a bill's first observed charge) are still reported, and a missing row's
  last_seen is always on or before its own due date.
- Register INV-WEBUI-007..009 and guard tests; add subscription regression tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dfrysinger
dfrysinger requested a review from Copilot July 10, 2026 22:51
@dfrysinger
dfrysinger merged commit 92d5b67 into main Jul 10, 2026
3 checks passed
@dfrysinger
dfrysinger deleted the subs-ui-and-toggle-improvements branch July 10, 2026 22:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR bundles several Subscriptions/Spending Web UI ergonomics improvements (instant boolean filter toggles, Envelope-first Spending grouping, and “Mark…” actions directly from the missing-charges table) and tightens the correctness of the “missing expected charges” audit logic by suppressing uncovered leading-edge “misses” and ensuring a missing row’s last_seen cannot postdate its own due date.

Changes:

  • Web UI: render bool filters as instant-apply checkboxes (dropping “Load” on toggle-only tabs) and preserve toggle state across subtab rebuilds.
  • Web UI: make Envelope the first/default Spending grouping and add “Mark…” actions to missing expected charges.
  • Subscriptions audit: suppress uncovered leading-edge missing occurrences and derive missing-row last_seen from matches strictly before the occurrence; add regression tests + new INV-WEBUI-007/008/009 guards.
Show a summary per file
File Description
tests/test_webui_design_guards.py Adds invariants/guards for Envelope-first Spending, mark-from-missing wiring, and instant bool-checkbox filters.
tests/test_subscription.py Adds regression tests covering uncovered leading-edge suppression and last_seen correctness for missing occurrences.
src/finance_mcp/webui.py Implements checkbox-based bool filters, Envelope-first Spending ordering, and “Mark…” buttons in missing expected charges.
src/finance_mcp/subscription.py Updates missing-occurrence reporting to require coverage of the early-payment window and fixes missing-row last_seen derivation.
docs/architecture/INVARIANTS.md Registers INV-WEBUI-007/008/009 invariants tied to the new design-guard tests.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 5/5 changed files
  • Comments generated: 1
  • Review effort level: Low

Comment thread src/finance_mcp/webui.py
Comment on lines +1225 to +1226
const i = _trackedRows.findIndex(t=>t.name===r.name);
return i>=0 ? `<button class="mini" onclick="openMark(${i})">Mark&hellip;</button>` : "";
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