Skip to content

#385: Add currency selection#553

Merged
BauZee merged 31 commits intodevelopfrom
feature/currency-selector
Apr 16, 2026
Merged

#385: Add currency selection#553
BauZee merged 31 commits intodevelopfrom
feature/currency-selector

Conversation

@BauZee
Copy link
Copy Markdown
Collaborator

@BauZee BauZee commented Apr 1, 2026

No description provided.

@BauZee BauZee self-assigned this Apr 1, 2026
@cloudflare-workers-and-pages
Copy link
Copy Markdown
Contributor

cloudflare-workers-and-pages bot commented Apr 1, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
aura-historia-staging ed903d7 Commit Preview URL

Branch Preview URL
Apr 14 2026, 09:20 PM

@BauZee BauZee linked an issue Apr 1, 2026 that may be closed by this pull request
@BauZee BauZee requested a review from lfranke42 April 1, 2026 21:28
@BauZee
Copy link
Copy Markdown
Collaborator Author

BauZee commented Apr 1, 2026

For me, the currency selection is a user preference. That’s why it’s stored in UserPreferences, just like trackingConsent.

Specifically, this means that the value(currency) it’s stored in localStorage (so it’s still there after a page reload) and in a cookie (so the server already knows the currency when the page first loads and renders it directly in the correct currency).

For users who log in, the same thing happens, plus backend sync is added, which means, the backend value (currency) overrides the local value (localStorage) because the selector reads the currency from UserPreferences (and those are stored in localStorage). This ensures that the backend value is always displayed after login and that the setting is preserved across devices. And when a logged-in user changes the currency, localStorage and the cookie are updated immediately, and a PATCH request is sent to the backend at the same time, of course.

Copy link
Copy Markdown
Member

@bruderj15 bruderj15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dropdown entries aren't aligned.

Comment thread src/components/common/CurrencySelector.tsx Outdated
Comment thread src/components/common/CurrencySelector.tsx
Comment thread src/components/common/CurrencySelector.tsx Outdated
Comment thread src/hooks/period/usePeriodProducts.ts Outdated
Comment thread src/routes/index.tsx Outdated
Comment thread src/data/internal/preferences/UserPreferences.ts Outdated
Comment thread src/test/utils.tsx Outdated
@BauZee BauZee requested a review from lfranke42 April 7, 2026 09:13
Copy link
Copy Markdown
Collaborator

@lfranke42 lfranke42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currency selection doesn't survive refresh. Get's reset back to default euro when not signed in.

Comment thread src/hooks/preferences/useCurrency.ts Outdated
@bruderj15
Copy link
Copy Markdown
Member

bruderj15 commented Apr 13, 2026

@BauZee please note the changes here: https://github.com/aura-historia/internal-api/blob/master/CHANGELOG.md#2026-04-13---expanded-currency-support-backend822

A whole lot more currencies have been added. All of them are to be fully supported.

EDIT: Not yet deployed

@BauZee
Copy link
Copy Markdown
Collaborator Author

BauZee commented Apr 13, 2026

@BauZee please note the changes here: https://github.com/aura-historia/internal-api/blob/master/CHANGELOG.md#2026-04-13---expanded-currency-support-backend822

A whole lot more currencies have been added. All of them are to be fully supported.

EDIT: Not yet deployed

Let me know when it's deployed

Copy link
Copy Markdown
Member

@bruderj15 bruderj15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On e.g. search results the ISO 4217 currency codes are displayed for some currencies. Can you instead display the currency-symbol there?
(Everywhere where currencies are displayed, nut just search).

Also revisit the actual formatting.
Some currencies use , over ..
Some prefix the currency-sign, some postfix it.

@lfranke42
Copy link
Copy Markdown
Collaborator

Also revisit the actual formatting.
Some currencies use , over ..
Some prefix the currency-sign, some postfix it.

This should be tied to the locale, not the currency. As far as I can tell this is currently implemented correctly.

@BauZee
Copy link
Copy Markdown
Collaborator Author

BauZee commented Apr 14, 2026

On e.g. search results the ISO 4217 currency codes are displayed for some currencies. Can you instead display the currency-symbol there? (Everywhere where currencies are displayed, nut just search).

Also revisit the actual formatting. Some currencies use , over .. Some prefix the currency-sign, some postfix it.

On e.g. search results the ISO 4217 currency codes are displayed for some currencies. Can you instead display the currency-symbol there? (Everywhere where currencies are displayed, nut just search).

Also revisit the actual formatting. Some currencies use , over .. Some prefix the currency-sign, some postfix it.

Symbols are now used everywhere instead of ISO currency codes. This was generated automatically by Intl.NumberFormat, but I am now replacing the ISO currency codes with the corresponding symbols.

Regarding the second point: We use Intl.NumberFormat with the user locale everywhere -> this automatically handles the decimal separators (i.e., , & .), as well as the thousands separators and symbol position (prefix/postfix) correctly based on the selected language, so it’s already set up correctly.

Copy link
Copy Markdown
Member

@bruderj15 bruderj15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine from my side

Copy link
Copy Markdown
Collaborator

@lfranke42 lfranke42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currency still resets when refreshing the page, also the currency button has a differnt border then the language selection button. They should look the same imo

@BauZee BauZee requested a review from lfranke42 April 14, 2026 21:21
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
69.7% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@BauZee
Copy link
Copy Markdown
Collaborator Author

BauZee commented Apr 14, 2026

Currency still resets when refreshing the page, also the currency button has a differnt border then the language selection button. They should look the same imo

That was my mistake, I accidentally added a fallback that kept overriding the saved currency. Reverted it as it was, works now.
Borderstyle is now the same like language. I also added a max-height so the selector isn't so tall, but is limited so you can scroll within it. If more currencies are added later, it won't get any bigger. The problem is that by default, there isn't a scrollbar here, just these weird arrows that the component library provides :/

Copy link
Copy Markdown
Collaborator

@lfranke42 lfranke42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've noticed that we also need to make the price filter on the search page dynamic. It's currently hardcoded to Euro. I can also adjust it in my PR though, as I'm already touching all the filters anyways.

@BauZee BauZee merged commit da37f3a into develop Apr 16, 2026
9 of 10 checks passed
@BauZee BauZee deleted the feature/currency-selector branch April 16, 2026 15:16
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.

Currency Selection

3 participants