Repository navigation
Web UI: instant filter toggles, Envelope-first Spending, mark-from-missing, missing-charge coverage fix - #11
Merged
Conversation
…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>
There was a problem hiding this comment.
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
boolfilters 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_seenfrom 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 on lines
+1225
to
+1226
| const i = _trackedRows.findIndex(t=>t.name===r.name); | ||
| return i>=0 ? `<button class="mini" onclick="openMark(${i})">Mark…</button>` : ""; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Four bundled Subscriptions/Spending web-UI improvements plus a correctness fix to the "missing expected charges" alert.
UI
filterVal/setFilterVal, so the subtab-crossing rebuild preserves checkbox state.Missing-charge coverage fix
day_tolerancedays early, so the coverage floor ismin(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).last_seenis 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_tolerancewhere greedy matching assigns a later charge to an earlier occurrence.Tests
last_seennever postdates the due date (incl. large-tolerance case). All proven to fail for the right reason.docs/architecture/INVARIANTS.md.Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com