Skip to content

feat(bank-connect): DOM scraping pipeline with embedded panel - #1

Merged
rprabhat merged 11 commits into
mainfrom
feat/bank-connect-dom-scraping
Feb 28, 2026
Merged

feat(bank-connect): DOM scraping pipeline with embedded panel#1
rprabhat merged 11 commits into
mainfrom
feat/bank-connect-dom-scraping

Conversation

@rprabhat

Copy link
Copy Markdown
Contributor

Summary

  • Add ScrapedTransaction/ScrapedAccount models with idempotency key support and import_scraped_transactions Tauri command
  • Rewrite all bank automation scripts to scrape DOM transactions (instead of network interception); add find_or_create_bank_account helper and run_id propagation
  • Wire bank_transactions IPC event into the import pipeline; add open/close/resize_bank_panel commands
  • Embedded bank-connect panel layout with auto-start on login and new account modal
  • Fix listener race condition, ref-in-render, and type safety issues; guard auth-token localStorage access in test environments

Test Plan

  • cargo check --workspace passes
  • cargo test -p wealthfolio-core bank_connect passes (3 tests)
  • pnpm type-check passes
  • pnpm test --run passes (322/322)
  • Bank connect panel opens/closes/resizes correctly in desktop app
  • Scraping a bank account imports transactions without duplicates (idempotency key)
  • New account modal flow works end-to-end

rprabhat and others added 11 commits February 28, 2026 19:51
…potency

- Add update_run_stats() to BankConnectRepository (thin wrapper over update_run)
- Add ImportResult struct to bank_connect commands
- Add import_scraped_transactions_inner() helper: maps ScrapedTransactionBatch
  to NewActivity records (DEPOSIT/WITHDRAWAL), deduplicates via idempotency_key,
  updates run stats, emits import-complete and new-account-created events
- Add import_scraped_transactions Tauri command wrapping the inner helper
- Wire command in lib.rs invoke_handler

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Add bank_progress and bank_transactions as Tauri commands so bank
automation scripts can invoke them via window.__TAURI__.invoke().
bank_transactions spawns an async import task and emits an error
progress event on failure. Update all 6 bank scripts from raw
__TAURI_INTERNALS__.ipc.postMessage to proper invoke() calls.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Adds WebviewBounds struct and three new Tauri commands: open_bank_panel,
close_bank_panel, and resize_bank_panel. Uses separate-window fallback
(WebviewWindowBuilder) since Tauri v2 add_child() requires the unstable
feature flag not enabled in this project. Panel windows use the label
prefix "bank-panel-{key}" to distinguish from standalone bank windows.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
- Use mounted-guard + Promise.all pattern in event listener useEffect to prevent leaks on fast unmount
- Add activeBankKey state alongside activeBankRef so conditional render is reactive
- Replace NewAccountInfo local interface with imported NewAccountCreatedPayload in new-accounts-modal
- Narrow BankProgressPayload.level with toLogLevel() instead of unsafe as-cast
- Add TODO comment for adaptCallback/adaptUnlisten de-dup with events.ts

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Node.js webstorage intercepts localStorage when window is defined but
localStorage.getItem is not a real function, crashing form-schemas.test.ts
at module load time. Add typeof guards before the module-level getItem call.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@rprabhat
rprabhat merged commit be0a807 into main Feb 28, 2026
2 checks passed
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.

1 participant