Skip to content

fix(dashboard): format Potential savings stat with configured currency - #215

Open
SomSamantray wants to merge 3 commits into
jez500:mainfrom
SomSamantray:fix/196-potential-savings-currency
Open

fix(dashboard): format Potential savings stat with configured currency#215
SomSamantray wants to merge 3 commits into
jez500:mainfrom
SomSamantray:fix/196-potential-savings-currency

Conversation

@SomSamantray

@SomSamantray SomSamantray commented Aug 9, 2026

Copy link
Copy Markdown

The dashboard "Potential savings" stat now renders in the configured default currency and locale instead of a hardcoded dollar sign. A user on EUR/GBP/AUD previously saw a $ value that did not match the rest of their dashboard; the stat now uses the same CurrencyHelper formatting as the min/avg/max aggregates and product cards.

Fixes #196

Tests: new tests/Feature/View/StatBarTest.php covers configured-currency (EUR) and USD rendering of the stat cell. The full suite runs in CI (php artisan test); a local run was not possible in this environment (no PHP/Docker), so CI is the verification run.


Compound Engineering

Summary by CodeRabbit

  • Bug Fixes

    • Potential savings on the dashboard now respects the configured currency and locale.
    • Values display correctly for currencies such as EUR and USD.
  • Tests

    • Added coverage to verify currency formatting and prevent regressions.
  • Documentation

    • Added an implementation plan documenting the currency-formatting change and verification steps.

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c261f0c8-f888-4666-bfff-fce9fdba880f

📥 Commits

Reviewing files that changed from the base of the PR and between cec656b and d698dbf.

📒 Files selected for processing (3)
  • docs/plans/196-potential-savings-currency.md
  • resources/views/filament/widgets/dashboard/stat-bar.blade.php
  • tests/Feature/View/StatBarTest.php

📝 Walkthrough

Walkthrough

The dashboard Potential Savings stat now uses CurrencyHelper::toString() with configured currency settings. A feature test verifies EUR and USD rendering. An implementation plan documents the scope and validation steps.

Changes

Potential Savings currency formatting

Layer / File(s) Summary
Currency formatting plan and validation contract
docs/plans/196-potential-savings-currency.md
The plan defines configured-currency formatting, preserves other stat cells and the $stats structure, and specifies EUR and USD regression tests.
Stat bar formatting and regression tests
resources/views/filament/widgets/dashboard/stat-bar.blade.php, tests/Feature/View/StatBarTest.php
The view uses CurrencyHelper::toString() for Potential Savings. The feature test verifies configured EUR output and default USD output.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: formatting the dashboard Potential savings stat with the configured currency.
Linked Issues check ✅ Passed The implementation uses CurrencyHelper with configured currency and adds EUR and USD regression tests, satisfying issue #196.
Out of Scope Changes check ✅ Passed The view change, regression tests, and implementation plan directly support the currency-formatting objective in issue #196.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@SomSamantray

Copy link
Copy Markdown
Author

Babysit run report

Automated watch of this PR (pipeline mode) stopped with one residual:

  • CI run #439 is awaiting approval. This is a first-time fork-PR workflow run; only an admin of jez500/pricebuddy can approve it (POST /actions/runs/439/approve requires admin rights). Until it is approved, the tests check cannot start, so merge readiness cannot be confirmed from CI.

State at stop: no unresolved review threads, no other actionable feedback. CodeRabbit's own review was still in progress on the current head and will report separately.

Once the run is approved, re-run /ce-babysit-pr https://github.com/jez500/pricebuddy/pull/215 to watch it through to CI-decided.

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.

"Potential Savings" currency is hardcoded to dollars

1 participant