Skip to content

apple: fix Budgets spend resolution and first-run import wiring - #37

Draft
kGeee wants to merge 3 commits into
mainfrom
cursor/phase1-native-screens-eb61
Draft

kGeee wants to merge 3 commits into
mainfrom
cursor/phase1-native-screens-eb61

Conversation

@kGeee

@kGeee kGeee commented Aug 26, 2026

Copy link
Copy Markdown
Owner

Summary

Finishes the Phase 1 native slice on apple/ without touching working Dashboard/Accounts/Review/Recurring implementations. Fixes Budgets spend resolution, first-run import CTAs, then two marketing bugs: transfers in Overview spend, and capped budget meters.

Changes

Budgets correctness

  • Extract CategorySpend domain helper (override wins, else Plaid-primary → category id) with unit tests pinning the old bug.
  • Rewrite BudgetsView: only categories with a CDBudget row (read-only limits), per-category meters, hero left-to-spend + cumulative pace chart + BudgetPacing projection.
  • CategoriesView uses the same CategorySpend.totals path so Budgets spent matches Categories for a category this month.

Transfers / reimbursable out of spend

  • CategoryMapping.countsTowardSpend skips group = transfer (covers Reimbursable) and unmapped TRANSFER_IN / TRANSFER_OUT / LOAN_PAYMENTS — matches web.
  • Wired through Overview (DashboardView), Budgets totals/pace, Categories, and CategorySpend.
  • Domain tests pin transfers and reimbursable are not spend.

Budget meter overflow

  • MeterBar draws past the track when over 100% (10× ≠ slightly-over).
  • Rows show 1.3× / 10× plus leftover / over-by copy (no all-caps OVER BUDGET hero).

First-run / dual-destination import

  • EmptyStorePrompt with a direct Import budgetr.db… button.
  • Centralise fileImporter in AppShell; propagate triggerImport via environment.
  • iPhone PhoneTabs: Overview, Ledger, and Budgets are direct tabs.

Unchanged

  • CloudKit stays off. No Shared/Holdings/pairing/Plaid/widgets/privacy routes.

Testing

Could not run xcodebuild on the Linux cloud VM. On macOS:

cd apple && ./scripts/test.sh

New/extended tests: CategorySpendTests (incl. transfer/reimbursable exclusion), BudgetUtilisationTests (multiplier labels), CategoryMappingTests spend rules.

Open in Web Open in Cursor 

- Extract CategorySpend domain helper with override-then-Plaid-primary
  resolution; add unit tests for the bug BudgetsView had (userCategory-only).
- Rewrite BudgetsView: only categories with CDBudget, jade/brass/coral meters,
  left-to-spend hero, cumulative pace chart, BudgetPacing projection.
- Add EmptyStorePrompt and centralise fileImporter in AppShell for iOS + macOS.
- Wire import CTA into Dashboard, Accounts, Review, Recurring, Budgets, Ledger.
- Reorder PhoneTabs so Overview, Ledger, and Budgets are direct tabs.
- CategoriesView uses CategorySpend so Budgets spent matches Categories.

CloudKit remains off (local NSPersistentContainer). xcodebuild unavailable on
the Linux cloud VM — run apple/scripts/test.sh on macOS to verify.

Co-authored-by: Kevin George <kGeee@users.noreply.github.com>
@vercel

vercel Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
budgetr Ready Ready Preview Aug 27, 2026 3:01am

Use CategorySpend.spent(for:in:) instead of subscripting totals directly,
so XCTAssertEqual gets a Double rather than Double?.

Co-authored-by: Kevin George <kGeee@users.noreply.github.com>
- CategoryMapping.countsTowardSpend skips group=transfer (incl. Reimbursable)
  and unmapped TRANSFER_* / LOAN_PAYMENTS Plaid primaries — matches web queries.
- CategorySpend / Dashboard / Budgets / Categories all use that filter so
  Overview month spent and "where it went" no longer include transfers.
- MeterBar draws past the track when over 100%; rows show 1.3×/10× plus
  leftover/over copy instead of a capped full bar.
- Domain tests pin transfers and reimbursable are not spend.

Co-authored-by: Kevin George <kGeee@users.noreply.github.com>
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