feat(articles): filter the article register by currency (#1229)

Non-SEK article prices became first-class in #1166, so a mixed register needs a
way to look at one currency at a time (user request, christian@odinaero.se
2026-07-25).

- ContextPicker chip far right in the toolbar (convention 8), options = the
  currencies actually present in the register, default "Alla valutor". A
  single-currency register does not render it: a control with one meaningful
  position is noise.
- The scope lives in the URL alongside sort/dir, so a filtered register survives
  opening an article and coming back, and can be linked to. A code that is not
  in the register (last EUR article deleted, hand-edited link) falls back to
  "Alla" instead of hiding every row.
- Search and scope combine, and the no-matches copy names the scope when one is
  active: otherwise "no articles match X" reads as a claim about the whole
  register when it is only true inside the current currency.
- Predicates live in lib/articles/currency-scope.ts with unit tests; blank and
  legacy-null currencies fold into SEK the way the price column already
  displays them.

New strings in both messages/sv.json and messages/en.json. npm test 11369
passed, lint 0 errors, no new tsc errors. Chip screenshotted against the design
system via a temporary sandbox route.

Closes #1189

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jakob Wennberg
2026-07-27 14:39:13 +02:00
committed by GitHub
co-authored by Claude Opus 5
parent d4f82cafc4
commit f5697cfc2f
5 changed files with 211 additions and 4 deletions
+4
View File
@@ -4827,6 +4827,10 @@
"search_placeholder": "Search articles",
"no_search_results_title": "No matches",
"no_search_results_description": "No articles match \"{term}\".",
"no_search_results_in_currency_description": "No articles in {currency} match \"{term}\".",
"currency_filter_all": "All currencies",
"currency_filter_selected": "Currency {currency}",
"currency_filter_aria": "Filter articles by currency",
"empty_title": "No articles yet",
"empty_description": "Add articles for goods and services to fill in invoice rows quickly.",
"empty_action": "Add article",
+4
View File
@@ -4827,6 +4827,10 @@
"search_placeholder": "Sök artiklar",
"no_search_results_title": "Inga träffar",
"no_search_results_description": "Inga artiklar matchar \"{term}\".",
"no_search_results_in_currency_description": "Inga artiklar i {currency} matchar \"{term}\".",
"currency_filter_all": "Alla valutor",
"currency_filter_selected": "Valuta {currency}",
"currency_filter_aria": "Filtrera artiklar på valuta",
"empty_title": "Inga artiklar ännu",
"empty_description": "Lägg till artiklar för varor och tjänster för att snabbt fylla i fakturarader.",
"empty_action": "Lägg till artikel",