Add support for Brazilian Real currency#619
Conversation
Add the Brazilian Real Currency R$ in cost dashboard
PR Summary by QodoAdd BRL (R$) currency support to cost dashboard
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
| const fmt = (n) => { | ||
| const cur = summary?.rates?.currency || 'EUR'; | ||
| const sym = ({ EUR: '€', USD: '$', GBP: '£', CHF: 'CHF', JPY: '¥' }[cur] || cur); | ||
| const sym = ({ EUR: '€', USD: '$', GBP: '£', CHF: 'CHF', JPY: '¥', BRL: 'R$' }[cur] || cur); |
There was a problem hiding this comment.
Suggestion: Extract the currency-to-symbol mapping into a single shared constant/helper and reuse it here instead of embedding another inline map literal. [custom_rule]
Severity Level: Major
Why it matters? ⭐
The file already contains repeated inline currency maps in multiple places, which makes updates error-prone and harder to maintain. This is a real maintainability issue because the same mapping is duplicated rather than sourced from one shared helper or constant.
Rule source 📖
CodeAnt dashboard (rule "agent-persona-maintainability")
(Use Cmd/Ctrl + Click for best experience)
Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** web/src/dashboard.js
**Line:** 4270:4270
**Comment:**
*Custom Rule: Extract the currency-to-symbol mapping into a single shared constant/helper and reuse it here instead of embedding another inline map literal.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix| <option value="GBP">GBP (£)</option> | ||
| <option value="CHF">CHF</option> | ||
| <option value="JPY">JPY (¥)</option> | ||
| <option value="BRL">BRL (R$)</option> |
There was a problem hiding this comment.
Suggestion: Drive currency dropdown options from the same shared currency configuration used by formatters so all selectors stay in sync automatically. [custom_rule]
Severity Level: Major
Why it matters? ⭐
The dropdown option is hardcoded alongside formatter mappings, so adding or changing currencies requires editing multiple separate spots. That duplication is a genuine maintainability concern and is directly visible in the updated file.
Rule source 📖
CodeAnt dashboard (rule "agent-persona-maintainability")
(Use Cmd/Ctrl + Click for best experience)
Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** web/src/dashboard.js
**Line:** 4594:4594
**Comment:**
*Custom Rule: Drive currency dropdown options from the same shared currency configuration used by formatters so all selectors stay in sync automatically.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
Code Review by Qodo
Context used✅ Compliance rules (platform):
1 rule 1. Deployed build not updated
|
| <option value="GBP">GBP (£)</option> | ||
| <option value="CHF">CHF</option> | ||
| <option value="JPY">JPY (¥)</option> | ||
| <option value="BRL">BRL (R$)</option> |
There was a problem hiding this comment.
1. Deployed build not updated 🐞 Bug ≡ Correctness
This PR adds BRL support in web/src/dashboard.js, but the deployed artifact web/index.html is not rebuilt, so the running UI will still not show BRL symbol/formatting or the BRL currency dropdown option. As a result, users won’t actually get BRL support after deployment.
Agent Prompt
## Issue description
The repo deploys `web/index.html` as the compiled single-file SPA, but the PR only updates `web/src/dashboard.js`. Without regenerating `web/index.html`, the deployed UI will still contain the old currency mappings/options (no BRL).
## Issue Context
`web/Dev/build.sh` documents that after editing `web/src/*.js`, you must rebuild because the compiled `web/index.html` is what gets deployed.
## Fix
1. Run `web/Dev/build.sh` to regenerate `web/index.html` from `web/src/*.js`.
2. Commit the updated `web/index.html` output in this PR.
## Fix Focus Areas
- web/Dev/build.sh[10-25]
- web/index.html[6568-6575]
- web/src/dashboard.js[4268-4272]
- web/src/dashboard.js[4586-4595]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
User description
Add the Brazilian Real Currency R$ in cost dashboard
CodeAnt-AI Description
Add Brazilian Real support in the cost dashboard
What Changed
Impact
✅ Cost shown in BRL✅ Easier use for Brazilian users✅ Fewer unsupported-currency displays💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.