Skip to content

Fix split - #36

Merged
paperplate merged 5 commits into
mainfrom
fixSplit
Aug 1, 2026
Merged

Fix split#36
paperplate merged 5 commits into
mainfrom
fixSplit

Conversation

@paperplate

@paperplate paperplate commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features

    • Added JSON transaction data support for filtered transaction lists.
    • Split-bill calculations now update automatically when filters or transaction selections change.
    • Split-bill displays now use filtered transaction details and preserve totals when data cannot be loaded.
  • Bug Fixes

    • Corrected transaction refresh detection so split-bill totals stay synchronized after filtering.
  • Tests

    • Added coverage verifying filtered transaction totals on the Transactions page.

@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@paperplate, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 1 minute

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9379a43d-01d0-4b1e-b42c-c25d986e6228

📥 Commits

Reviewing files that changed from the base of the PR and between b122c43 and 288c7af.

📒 Files selected for processing (8)
  • JustAnotherExpenseManager/routes/transactions.py
  • JustAnotherExpenseManager/static/js/filter_component.js
  • JustAnotherExpenseManager/static/js/split_bill.js
  • JustAnotherExpenseManager/utils/services.py
  • static_src/js/filter_component.ts
  • static_src/js/split_bill.ts
  • tests/07-filter-combinations.spec.ts
  • tests/11-split-bill.spec.ts
📝 Walkthrough

Walkthrough

The transaction API now supports filtered JSON responses across all pages. Split-bill handlers consume supplied or fetched transactions, normalize data, and recalculate totals after transaction updates. Transaction-page category filtering now has split-total coverage.

Changes

Transaction filtering and split-bill updates

Layer / File(s) Summary
Filtered transaction JSON API
JustAnotherExpenseManager/routes/transactions.py
GET /api/transactions?json=true returns normalized amounts and non-category tags from all filtered pages.
Transaction update event wiring
JustAnotherExpenseManager/static/js/filter_component.js, static_src/js/filter_component.ts, JustAnotherExpenseManager/static/js/transactions.js, static_src/js/transactions.ts
Transaction-list refreshes emit transactionsUpdated. Split-bill events now distinguish selected transactions from summary totals.
Split-bill synchronization and validation
JustAnotherExpenseManager/static/js/split_bill.js, static_src/js/split_bill.ts, tests/11-split-bill.spec.ts
Split-bill handlers use event transactions or fetch filtered JSON data, then render normalized values. Category filtering on the Transactions page is tested.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant FilterComponent
  participant TransactionsAPI
  participant Transactions
  participant SplitBill
  FilterComponent->>Transactions: dispatch transactionsUpdated after transaction-list refresh
  Transactions->>SplitBill: emit splitBillUpdate with selected or summary data
  SplitBill->>TransactionsAPI: request filtered transactions with json=true when details are absent
  TransactionsAPI-->>SplitBill: return normalized amounts and tags
  SplitBill->>SplitBill: calculate total and render transactions
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title refers to split-bill changes but does not clearly describe the transaction filtering and total update behavior. Use a specific title such as "Fix split-bill totals after transaction filter updates".
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fixSplit

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@JustAnotherExpenseManager/routes/transactions.py`:
- Around line 153-170: The JSON branch in the transaction route currently calls
get_all_transactions once per page, repeating filtered transaction and tag
queries. Add a service method that retrieves all transactions matching the
existing categories, tags, date, description, and amount filters in a single
query, then use that method in the json=true path and serialize its complete
result without iterating through result['total_pages'].

In `@static_src/js/split_bill.ts`:
- Around line 78-90: Preserve the summary event’s expense-card total in the
transaction-loading path instead of replacing it with the sum of all normalized
transactions, and filter loaded transactions to those represented by that
summary total. Apply this behavior in static_src/js/split_bill.ts at lines 78-90
and mirror it in JustAnotherExpenseManager/static/js/split_bill.js at lines
54-64. Update tests/11-split-bill.spec.ts at lines 199-224 to include an income
transaction and assert the filtered summary total remains expense-only.
- Around line 68-90: Prevent stale transaction fetches from overwriting newer
state in the splitBillUpdate listener: add request-order protection, preferably
by aborting the previous AbortController or tracking a latest-request revision
and ignoring outdated responses. Apply the equivalent fix in
static_src/js/split_bill.ts (lines 68-90) and
JustAnotherExpenseManager/static/js/split_bill.js (lines 44-64), preserving
updates from selected transaction events and only rendering results from the
current request.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: af822ed8-0e05-45a8-8b4f-a093ddaf45dd

📥 Commits

Reviewing files that changed from the base of the PR and between c286c45 and b122c43.

📒 Files selected for processing (8)
  • JustAnotherExpenseManager/routes/transactions.py
  • JustAnotherExpenseManager/static/js/filter_component.js
  • JustAnotherExpenseManager/static/js/split_bill.js
  • JustAnotherExpenseManager/static/js/transactions.js
  • static_src/js/filter_component.ts
  • static_src/js/split_bill.ts
  • static_src/js/transactions.ts
  • tests/11-split-bill.spec.ts

Comment thread JustAnotherExpenseManager/routes/transactions.py Outdated
Comment thread static_src/js/split_bill.ts
Comment thread static_src/js/split_bill.ts
@paperplate
paperplate merged commit 3b54711 into main Aug 1, 2026
8 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