[PR #331] [MERGED] Implement currency symbol handling and update related components #1000

Closed
opened 2026-05-06 12:34:25 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/maziggy/bambuddy/pull/331
Author: @bnap00
Created: 2/11/2026
Status: Merged
Merged: 2/11/2026
Merged by: @maziggy

Base: 0.2.0bHead: feature/currency-symbol-prefix


📝 Commits (6)

  • e8b2deb Merge branch 'main' into 0.1.9
  • 38641e9 Merge pull request #326 from maziggy/0.1.9
  • ced51e0 Implement currency symbol handling and update related components
  • f5d9c4a Adjust padding for input fields to accommodate currency symbol length
  • 3c0c499 Add 14 additional currency options (KRW, SEK, NOK, DKK, PLN, BRL, TWD, SGD, NZD, MXN, CZK, THB, ZAR, TRY)
  • 71560b7 Merge origin/0.2.0b, resolve conflict keeping SUPPORTED_CURRENCIES.map()

📊 Changes

6 files changed (+149 additions, -54 deletions)

View changed files

📝 frontend/src/__tests__/pages/StatsPage.test.tsx (+1 -1)
frontend/src/__tests__/utils/currency.test.ts (+43 -0)
📝 frontend/src/pages/ProjectDetailPage.tsx (+2 -1)
📝 frontend/src/pages/SettingsPage.tsx (+44 -51)
📝 frontend/src/pages/StatsPage.tsx (+2 -1)
frontend/src/utils/currency.ts (+57 -0)

📄 Description

Description

Improve the Cost Tracking settings card UX by reordering fields, adding currency symbol prefixes to cost inputs, and expanding supported currencies. Also centralizes currency code-to-symbol mapping into a shared utility, fixing display across Stats and Project Detail pages.

#329

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Code refactoring
  • Performance improvement
  • Test addition or update

Changes Made

  • Moved Currency selector to the top of the Cost Tracking card for better UX
  • Added currency symbol prefix (e.g. $, €, ₹) inside filament cost and electricity cost input fields
  • Added INR (₹) and HKD (HK$) currency support
  • Created centralized getCurrencySymbol() utility and SUPPORTED_CURRENCIES array in frontend/src/utils/currency.ts
  • Fixed StatsPage and ProjectDetailPage to display proper currency symbols instead of raw codes (e.g. €12.50 instead of EUR 12.50)
  • Fixed smart plug energy display in SettingsPage to use currency symbols
  • Updated StatsPage test mock to use currency code 'USD' instead of symbol '$'
  • Added unit tests for the new currency utility (10 tests)

Screenshots

Screenshot 2026-02-11 at 10 30 44 AM Screenshot 2026-02-11 at 10 30 34 AM Screenshot 2026-02-11 at 10 30 19 AM

Testing

  • I have tested this on my local machine
  • I have tested with my printer model:

Checklist

  • My code follows the project's coding style
  • I have commented my code where necessary
  • I have updated the documentation (if needed)
  • My changes generate no new warnings
  • I have tested my changes thoroughly

Additional Notes


🔄 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/maziggy/bambuddy/pull/331 **Author:** [@bnap00](https://github.com/bnap00) **Created:** 2/11/2026 **Status:** ✅ Merged **Merged:** 2/11/2026 **Merged by:** [@maziggy](https://github.com/maziggy) **Base:** `0.2.0b` ← **Head:** `feature/currency-symbol-prefix` --- ### 📝 Commits (6) - [`e8b2deb`](https://github.com/maziggy/bambuddy/commit/e8b2deb54afe1ea68f726170840de5447199c7cf) Merge branch 'main' into 0.1.9 - [`38641e9`](https://github.com/maziggy/bambuddy/commit/38641e91e2531df8ae123bcf7884e8ec5f7b1d84) Merge pull request #326 from maziggy/0.1.9 - [`ced51e0`](https://github.com/maziggy/bambuddy/commit/ced51e06fb3a5c6850aec1bec21fc21a0fcd8f41) Implement currency symbol handling and update related components - [`f5d9c4a`](https://github.com/maziggy/bambuddy/commit/f5d9c4a1db8ddda4747acefa03d485a03cd41acd) Adjust padding for input fields to accommodate currency symbol length - [`3c0c499`](https://github.com/maziggy/bambuddy/commit/3c0c4995241bc689f8ea4eee6a971f8bba28b2eb) Add 14 additional currency options (KRW, SEK, NOK, DKK, PLN, BRL, TWD, SGD, NZD, MXN, CZK, THB, ZAR, TRY) - [`71560b7`](https://github.com/maziggy/bambuddy/commit/71560b7634d0830508825943f3c47145818b4482) Merge origin/0.2.0b, resolve conflict keeping SUPPORTED_CURRENCIES.map() ### 📊 Changes **6 files changed** (+149 additions, -54 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/__tests__/pages/StatsPage.test.tsx` (+1 -1) ➕ `frontend/src/__tests__/utils/currency.test.ts` (+43 -0) 📝 `frontend/src/pages/ProjectDetailPage.tsx` (+2 -1) 📝 `frontend/src/pages/SettingsPage.tsx` (+44 -51) 📝 `frontend/src/pages/StatsPage.tsx` (+2 -1) ➕ `frontend/src/utils/currency.ts` (+57 -0) </details> ### 📄 Description ## Description <!-- Provide a brief description of your changes --> Improve the Cost Tracking settings card UX by reordering fields, adding currency symbol prefixes to cost inputs, and expanding supported currencies. Also centralizes currency code-to-symbol mapping into a shared utility, fixing display across Stats and Project Detail pages. ## Related Issue <!-- Link to the issue this PR addresses (if applicable) --> #329 ## Type of Change <!-- Mark the relevant option with an "x" --> - [ ] Bug fix (non-breaking change that fixes an issue) - [x] New feature (non-breaking change that adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update - [x] Code refactoring - [ ] Performance improvement - [x] Test addition or update ## Changes Made <!-- List the specific changes made in this PR --> - Moved Currency selector to the top of the Cost Tracking card for better UX - Added currency symbol prefix (e.g. $, €, ₹) inside filament cost and electricity cost input fields - Added INR (₹) and HKD (HK$) currency support - Created centralized getCurrencySymbol() utility and SUPPORTED_CURRENCIES array in frontend/src/utils/currency.ts - Fixed StatsPage and ProjectDetailPage to display proper currency symbols instead of raw codes (e.g. €12.50 instead of EUR 12.50) - Fixed smart plug energy display in SettingsPage to use currency symbols - Updated StatsPage test mock to use currency code 'USD' instead of symbol '$' - Added unit tests for the new currency utility (10 tests) ## Screenshots <img width="706" height="227" alt="Screenshot 2026-02-11 at 10 30 44 AM" src="https://github.com/user-attachments/assets/c99b6e33-4c7a-4007-8ccf-e53ca243b7e9" /> <img width="464" height="453" alt="Screenshot 2026-02-11 at 10 30 34 AM" src="https://github.com/user-attachments/assets/94730adb-0a26-434c-8dbb-b76d25f09b6d" /> <img width="472" height="456" alt="Screenshot 2026-02-11 at 10 30 19 AM" src="https://github.com/user-attachments/assets/cdb6741f-0e2d-4f95-ae27-305de0981f82" /> <!-- If applicable, add screenshots to demonstrate your changes --> ## Testing <!-- Describe how you tested your changes --> - [x] I have tested this on my local machine - [ ] I have tested with my printer model: <!-- e.g., X1C, P1S, A1 --> ## Checklist - [x] My code follows the project's coding style - [x] I have commented my code where necessary - [x] I have updated the documentation (if needed) - [x] My changes generate no new warnings - [x] I have tested my changes thoroughly ## Additional Notes <!-- Add any additional information that reviewers should know --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-06 12:34:25 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/bambuddy#1000
No description provided.