[PR #6565] [CLOSED] fix(budget-automations): Fix period text display and currency conversion in automation UI #25214

Closed
opened 2026-04-16 18:27:39 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/6565
Author: @dhavalsavalia
Created: 1/6/2026
Status: Closed

Base: masterHead: fix/budget-automations-ui-bugs


📝 Commits (10+)

  • 085cce8 fix(budget-automations): convert periodic template amounts between dollars and cents
  • 01baef4 test: add failing tests for WeekAutomationReadOnly period display bug
  • 1a8706b fix(budget-automations): display dynamic period text instead of hardcoded 'each week'
  • b908fd9 test: add currency conversion tests for WeekAutomationReadOnly
  • 93edab6 fix(budget-automations): use currency-aware conversion in WeekAutomationReadOnly
  • bb6aa3b fix(budget-automations): use currency-aware conversion in WeekAutomation editor
  • 87f5cb6 test: add failing tests for SimpleAutomationReadOnly dollar conversion bug
  • d9d7e4a fix(budget-automations): add currency-aware dollar to cents conversion in SimpleAutomationReadOnly
  • 2f58544 style: fix import ordering and formatting
  • 7793617 docs: update release notes with all automation UI fixes

📊 Changes

6 files changed (+249 additions, -6 deletions)

View changed files

packages/desktop-client/src/components/budget/goals/editor/SimpleAutomationReadOnly.test.tsx (+67 -0)
📝 packages/desktop-client/src/components/budget/goals/editor/SimpleAutomationReadOnly.tsx (+10 -1)
📝 packages/desktop-client/src/components/budget/goals/editor/WeekAutomation.tsx (+12 -3)
packages/desktop-client/src/components/budget/goals/editor/WeekAutomationReadOnly.test.tsx (+130 -0)
📝 packages/desktop-client/src/components/budget/goals/editor/WeekAutomationReadOnly.tsx (+24 -2)
upcoming-release-notes/6565.md (+6 -0)

📄 Description

Summary

Fixes multiple issues in the budget automation UI components:

  • Crash with decimal amounts - SimpleAutomationReadOnly crashed when template amounts contained decimals (e.g., $50.25) because raw float values were passed to a function expecting integers
  • Period text display - WeekAutomationReadOnly showed "each week" regardless of actual period configuration. Now correctly displays dynamic text like "every 2 weeks", "every 3 months", etc.
  • Amount conversion - Template amounts (stored as dollars by the parser) were not being converted to cents before display, causing incorrect values
  • Currency-aware conversion - WeekAutomation and WeekAutomationReadOnly now use the currency's decimal places setting instead of hardcoded values

Changes

File Change
WeekAutomationReadOnly.tsx Added getPeriodText() for dynamic period display + currency-aware conversion
WeekAutomation.tsx Added currency-aware conversion using format.currency.decimalPlaces
SimpleAutomationReadOnly.tsx Added amountToInteger with currency-aware decimal places (fixes crash)

Screenshots

Before (crash on decimal amounts)

CleanShot 2026-01-06 at 17 29 00

After (all fixes applied)

  • JPY
    CleanShot 2026-01-06 at 17 31 09

  • CAD
    CleanShot 2026-01-06 at 17 31 40

Test Plan

  • Added 8 tests for WeekAutomationReadOnly (period display + amount conversion)
  • Added 4 tests for SimpleAutomationReadOnly (amount conversion)
  • All desktop-client tests pass
  • TypeScript compiles without errors

Manual Testing

  • Create a periodic template with "every 2 weeks" and verify it displays correctly
  • Create a simple template with $100/month and verify correct display
  • Create a template with decimal amount (e.g., 819.54) and verify no crash
  • Set currency to JPY and test for correct format

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/actualbudget/actual/pull/6565 **Author:** [@dhavalsavalia](https://github.com/dhavalsavalia) **Created:** 1/6/2026 **Status:** ❌ Closed **Base:** `master` ← **Head:** `fix/budget-automations-ui-bugs` --- ### 📝 Commits (10+) - [`085cce8`](https://github.com/actualbudget/actual/commit/085cce885ce679d99045f049f1423732453d1efe) fix(budget-automations): convert periodic template amounts between dollars and cents - [`01baef4`](https://github.com/actualbudget/actual/commit/01baef43a0b0463b45a1f228a7924ce1963e8a91) test: add failing tests for WeekAutomationReadOnly period display bug - [`1a8706b`](https://github.com/actualbudget/actual/commit/1a8706b4dc24696a1c23498a2691a86d832bedd8) fix(budget-automations): display dynamic period text instead of hardcoded 'each week' - [`b908fd9`](https://github.com/actualbudget/actual/commit/b908fd9dc7c8654676af6d3be76d4eb4a9ae3826) test: add currency conversion tests for WeekAutomationReadOnly - [`93edab6`](https://github.com/actualbudget/actual/commit/93edab682a4b6ad9915276c4a839845032229f5b) fix(budget-automations): use currency-aware conversion in WeekAutomationReadOnly - [`bb6aa3b`](https://github.com/actualbudget/actual/commit/bb6aa3b2108bc4e22eabfce0de8687e3d22fe3af) fix(budget-automations): use currency-aware conversion in WeekAutomation editor - [`87f5cb6`](https://github.com/actualbudget/actual/commit/87f5cb64a8510796bbcba2f1ceb45e003a5f0e01) test: add failing tests for SimpleAutomationReadOnly dollar conversion bug - [`d9d7e4a`](https://github.com/actualbudget/actual/commit/d9d7e4a26a3559b3b3eca151d8d7a6de3b988567) fix(budget-automations): add currency-aware dollar to cents conversion in SimpleAutomationReadOnly - [`2f58544`](https://github.com/actualbudget/actual/commit/2f5854445a6a8a40e26cbd7db70a9145bee297ba) style: fix import ordering and formatting - [`7793617`](https://github.com/actualbudget/actual/commit/77936172161fd553334a0cb23a1457b2161e9999) docs: update release notes with all automation UI fixes ### 📊 Changes **6 files changed** (+249 additions, -6 deletions) <details> <summary>View changed files</summary> ➕ `packages/desktop-client/src/components/budget/goals/editor/SimpleAutomationReadOnly.test.tsx` (+67 -0) 📝 `packages/desktop-client/src/components/budget/goals/editor/SimpleAutomationReadOnly.tsx` (+10 -1) 📝 `packages/desktop-client/src/components/budget/goals/editor/WeekAutomation.tsx` (+12 -3) ➕ `packages/desktop-client/src/components/budget/goals/editor/WeekAutomationReadOnly.test.tsx` (+130 -0) 📝 `packages/desktop-client/src/components/budget/goals/editor/WeekAutomationReadOnly.tsx` (+24 -2) ➕ `upcoming-release-notes/6565.md` (+6 -0) </details> ### 📄 Description ## Summary Fixes multiple issues in the budget automation UI components: - **Crash with decimal amounts** - SimpleAutomationReadOnly crashed when template amounts contained decimals (e.g., $50.25) because raw float values were passed to a function expecting integers - **Period text display** - WeekAutomationReadOnly showed "each week" regardless of actual period configuration. Now correctly displays dynamic text like "every 2 weeks", "every 3 months", etc. - **Amount conversion** - Template amounts (stored as dollars by the parser) were not being converted to cents before display, causing incorrect values - **Currency-aware conversion** - WeekAutomation and WeekAutomationReadOnly now use the currency's decimal places setting instead of hardcoded values ## Changes | File | Change | |------|--------| | `WeekAutomationReadOnly.tsx` | Added `getPeriodText()` for dynamic period display + currency-aware conversion | | `WeekAutomation.tsx` | Added currency-aware conversion using `format.currency.decimalPlaces` | | `SimpleAutomationReadOnly.tsx` | Added `amountToInteger` with currency-aware decimal places (fixes crash) | ## Screenshots ### Before (crash on decimal amounts) <img width="544" height="334" alt="CleanShot 2026-01-06 at 17 29 00" src="https://github.com/user-attachments/assets/9ef165e9-0454-4557-a8c9-d854c85530e1" /> ### After (all fixes applied) - JPY <img width="868" height="669" alt="CleanShot 2026-01-06 at 17 31 09" src="https://github.com/user-attachments/assets/509db9f8-05a1-47f0-8fff-4a75a5fb6715" /> - CAD <img width="875" height="665" alt="CleanShot 2026-01-06 at 17 31 40" src="https://github.com/user-attachments/assets/d766e3d4-ca1d-4aa9-a55b-c4ba6b6be7f1" /> ## Test Plan - [x] Added 8 tests for WeekAutomationReadOnly (period display + amount conversion) - [x] Added 4 tests for SimpleAutomationReadOnly (amount conversion) - [x] All desktop-client tests pass - [x] TypeScript compiles without errors ### Manual Testing - [x] Create a periodic template with "every 2 weeks" and verify it displays correctly - [x] Create a simple template with $100/month and verify correct display - [x] Create a template with decimal amount (e.g., 819.54) and verify no crash - [x] Set currency to JPY and test for correct format --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-16 18:27:39 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#25214