Skip to content

Fix: tag percentages incorrectly divided when transactions have multiple tags#12

Open
HessamAyoubi wants to merge 14 commits intopolius:mainfrom
HessamAyoubi:main
Open

Fix: tag percentages incorrectly divided when transactions have multiple tags#12
HessamAyoubi wants to merge 14 commits intopolius:mainfrom
HessamAyoubi:main

Conversation

@HessamAyoubi
Copy link
Copy Markdown

When a transaction had multiple tags, the dashboard breakdown was calculating grandTotal as the sum of all tag buckets, causing double-counting and making each tag's percentage appear proportionally smaller (e.g. 2 tags → each shows ~50% instead of the correct value).

Behavior

  • Before: A $100 transaction with 2 tags would show 50% for each tag.
  • After: A $100 transaction with 2 tags correctly shows each tag as a percentage of
    total expenses (not divided between tags).

Fixed double-counting issue in transaction total calculation
@polius polius added the bug Something isn't working label Mar 26, 2026
@polius polius self-assigned this Mar 26, 2026
HessamAyoubi and others added 12 commits March 28, 2026 01:03
Instead of deleting immediately after confirmation, all delete actions
now show a 5-second undo toast before the API call is made. Clicking
"Undo" within that window cancels the deletion entirely.

Changes:
- web/transactions.html: Added undo toast element
- web/settings.html: Added undo toast element
- web/js/transactions.js: Added showUndoToast() helper; refactored
  submitTransactionDelete and submitTransactionDeleteMultiple to use
  deferred delete pattern
- web/js/settings.js: Added showUndoToast() helper; refactored
  deleteCategorySubmit and deleteTagSubmit to use deferred delete pattern

No backend changes — the undo window is entirely client-side.
Two bugs in editTransaction() caused the Name field to appear blank:

1. nameInput.addOption() was missing before nameInput.setValue(). Since
   TomSelect loads suggestions async (on user typing), the option didn't
   exist in the list yet — so setValue() silently did nothing. Tags
   already handled this correctly.

2. The shown.bs.modal handler was calling focus() on the name input
   regardless of mode. In edit mode, this triggered TomSelect's open
   behavior after the value was set, visually clearing the field.
   Focus is now only called in add mode.
Adds a dedicated Person field to transactions for tracking who in the
household made each expense, replacing the workaround of using tags.

Backend:
- New Person model and CRUD router (GET, POST, PUT with cascade
  rename, DELETE with cascade clear)
- person field added to Transaction (optional, defaults to empty)
- Persons router registered in main.py

Frontend:
- Settings: Persons card alongside Categories and Tags, with full
  add/edit/delete (undo toast on delete)
- Transactions: Person dropdown in the add/edit modal, Person column
  in the grid
- Dashboard: "Person" group-by button on the pie chart, alongside
  Categories and Tags
Add monthly budget per category with progress bars on the dashboard and budget management in Settings. Includes a new Person field on transactions, undo/soft delete for transactions and settings items, and a fix for the Name field being empty when editing transactions.
Add person field to recurring transaction model, modal, and AG Grid table. Include automatic database migration for existing installations.
Warn users before adding a transaction that matches an existing one on amount, person, date, and category. Highlight duplicate groups in the transactions grid with distinct background colors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants