Repository navigation
[NoQA] [Insights] Add Compare to page controls - #102526
luacmartins merged 8 commits into
Conversation
|
Hey, I noticed you changed If you want to automatically generate translations for other locales, an Expensify employee will have to:
Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running: npx bun ./scripts/generateTranslations.ts --helpTypically, you'd want to translate only what you changed by running |
|
Running translations. 👍 |
🦜 Polyglot Parrot! 🦜Squawk! Looks like you added some shiny new English strings. Allow me to parrot them back to you in other tongues: View the translation diffdiff --git a/src/languages/de.ts b/src/languages/de.ts
index 1b8f0e88..00eff929 100644
--- a/src/languages/de.ts
+++ b/src/languages/de.ts
@@ -1163,6 +1163,7 @@ const translations: TranslationDeepObject<typeof en> = {
viewOnSpend: 'In Ausgaben anzeigen',
emptyState: {title: 'Nichts anzuzeigen', subtitle: 'Versuchen Sie, Ihre Kriterien oben anzupassen'},
noExpensesState: {title: 'Sehen Sie, wohin Ihr Geld fließt', subtitle: 'Sobald Sie Ausgaben haben, finden Sie Ausgabentrends, Top-Händler und mehr.'},
+ compare: {label: 'Vergleichen', previousPeriod: 'Vorheriger Zeitraum', average: 'Durchschnitt'},
},
allSettingsScreen: {
subscription: 'Abonnement',
diff --git a/src/languages/el.ts b/src/languages/el.ts
index 150e5abc..3025336c 100644
--- a/src/languages/el.ts
+++ b/src/languages/el.ts
@@ -1208,6 +1208,7 @@ const translations: TranslationDeepObject<typeof en> = {
viewOnSpend: 'Προβολή στο Spend',
emptyState: {title: 'Τίποτα προς εμφάνιση', subtitle: 'Δοκιμάστε να προσαρμόσετε τα κριτήριά σας παραπάνω'},
noExpensesState: {title: 'Δείτε πού πηγαίνουν τα χρήματά σας', subtitle: 'Μόλις έχετε δαπάνες, θα βλέπετε τάσεις δαπανών, κορυφαίους εμπόρους και άλλα.'},
+ compare: {label: 'Σύγκριση', previousPeriod: 'Προηγούμενη περίοδος', average: 'Μέσος όρος'},
},
allSettingsScreen: {
subscription: 'Συνδρομή',
diff --git a/src/languages/es.ts b/src/languages/es.ts
index f8b9b288..365c0de6 100644
--- a/src/languages/es.ts
+++ b/src/languages/es.ts
@@ -1158,6 +1158,7 @@ const translations: TranslationDeepObject<typeof en> = {
viewOnSpend: 'Ver en Gastos',
emptyState: {title: 'Nada que mostrar', subtitle: 'Prueba a ajustar tus criterios de arriba'},
noExpensesState: {title: 'Ve adónde va tu dinero', subtitle: 'Una vez que tengas gastos, encontrarás tendencias de gasto, principales comercios y mucho más.'},
+ compare: {label: 'Comparar', previousPeriod: 'Periodo anterior', average: 'Promedio'},
},
allSettingsScreen: {
subscription: 'Suscripcion',
diff --git a/src/languages/fr.ts b/src/languages/fr.ts
index 25aa1b34..c6c82c29 100644
--- a/src/languages/fr.ts
+++ b/src/languages/fr.ts
@@ -1168,6 +1168,7 @@ const translations: TranslationDeepObject<typeof en> = {
title: 'Voyez où va votre argent',
subtitle: 'Une fois que vous aurez des dépenses, vous verrez des tendances de dépenses, les principaux marchands et plus encore.',
},
+ compare: {label: 'Comparer', previousPeriod: 'Période précédente', average: 'Moyenne'},
},
allSettingsScreen: {
subscription: 'Abonnement',
diff --git a/src/languages/it.ts b/src/languages/it.ts
index 6064e9b5..91fe9761 100644
--- a/src/languages/it.ts
+++ b/src/languages/it.ts
@@ -1163,6 +1163,7 @@ const translations: TranslationDeepObject<typeof en> = {
viewOnSpend: 'Visualizza in Spese',
emptyState: {title: 'Niente da mostrare', subtitle: 'Prova a modificare i criteri qui sopra'},
noExpensesState: {title: 'Scopri dove va il tuo denaro', subtitle: 'Una volta che avrai delle spese, troverai tendenze di spesa, principali esercenti e altro ancora.'},
+ compare: {label: 'Confronta', previousPeriod: 'Periodo precedente', average: 'Media'},
},
allSettingsScreen: {
subscription: 'Abbonamento',
diff --git a/src/languages/ja.ts b/src/languages/ja.ts
index 042a7c0d..3251881c 100644
--- a/src/languages/ja.ts
+++ b/src/languages/ja.ts
@@ -1150,6 +1150,7 @@ const translations: TranslationDeepObject<typeof en> = {
viewOnSpend: '支出で表示',
emptyState: {title: '表示するものはありません', subtitle: '上の条件を調整してみてください'},
noExpensesState: {title: 'お金の使い道を確認する', subtitle: '経費が登録されると、支出の傾向や上位の加盟店など、さまざまな情報を確認できるようになります。'},
+ compare: {label: '比較', previousPeriod: '前の期間', average: '平均'},
},
allSettingsScreen: {
subscription: 'サブスクリプション',
diff --git a/src/languages/nl.ts b/src/languages/nl.ts
index eae27830..9d264f93 100644
--- a/src/languages/nl.ts
+++ b/src/languages/nl.ts
@@ -1162,6 +1162,7 @@ const translations: TranslationDeepObject<typeof en> = {
viewOnSpend: 'Bekijken in Uitgaven',
emptyState: {title: 'Niets om weer te geven', subtitle: 'Probeer je criteria hierboven aan te passen'},
noExpensesState: {title: 'Zie waar je geld naartoe gaat', subtitle: 'Zodra je uitgaven hebt, zie je bestedingspatronen, topverkopers en meer.'},
+ compare: {label: 'Vergelijken', previousPeriod: 'Vorige periode', average: 'Gemiddeld'},
},
allSettingsScreen: {
subscription: 'Abonnement',
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index 482f1f88..6caf62af 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -1183,6 +1183,7 @@ const translations: TranslationDeepObject<typeof en> = {
viewOnSpend: 'Zobacz w Wydatkach',
emptyState: {title: 'Nic do wyświetlenia', subtitle: 'Spróbuj zmienić kryteria powyżej'},
noExpensesState: {title: 'Zobacz, na co idą twoje pieniądze', subtitle: 'Gdy będziesz mieć wydatki, zobaczysz trendy w wydawaniu, najważniejszych sprzedawców i więcej.'},
+ compare: {label: 'Porównaj', previousPeriod: 'Poprzedni okres', average: 'Średnia'},
},
allSettingsScreen: {
subscription: 'Subskrypcja',
diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts
index ce56c5ca..07d04c73 100644
--- a/src/languages/pt-BR.ts
+++ b/src/languages/pt-BR.ts
@@ -1162,6 +1162,7 @@ const translations: TranslationDeepObject<typeof en> = {
viewOnSpend: 'Ver em Gastos',
emptyState: {title: 'Nada para mostrar', subtitle: 'Tente ajustar seus critérios acima'},
noExpensesState: {title: 'Veja para onde vai o seu dinheiro', subtitle: 'Quando você tiver despesas, vai encontrar tendências de gastos, principais estabelecimentos e muito mais.'},
+ compare: {label: 'Comparar', previousPeriod: 'Período anterior', average: 'Média'},
},
allSettingsScreen: {
subscription: 'Assinatura',
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index ba103eb5..370640de 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -1116,6 +1116,7 @@ const translations: TranslationDeepObject<typeof en> = {
viewOnSpend: '在支出中查看',
emptyState: {title: '没有可显示的内容', subtitle: '请尝试调整上面的条件'},
noExpensesState: {title: '查看你的资金流向', subtitle: '添加报销后,您就能查看消费趋势、主要商家等更多信息。'},
+ compare: {label: '比较', previousPeriod: '上一期', average: '平均'},
},
allSettingsScreen: {
subscription: '订阅',
Note You can apply these changes to your branch by copying the patch to your clipboard, then running |
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
@eVoloshchak Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
@daledah @bernhardoj @truph01 can one of you please review this PR? it's part of the Insights project |
|
I can review it, please assign me so it will be in my K2 |
|
@MelvinBot assign @truph01 and unassign @eVoloshchak on this PR |
|
@MelvinBot review |
|
Done. I removed |
Code reviewI found no blocking bugs. The request logic is correct:
Nits (non-blocking)
What I checked
|
I did test it and I didn't find it to happen. and we'll be changing how persisting the filter works anyway
okay, done
not an issue |
|
@truph01 all yours |
Reviewer Checklist
Screenshots/VideosMacOS: Chrome / SafariScreen.Recording.2026-09-30.at.08.44.09.mov |
fe7878f
|
@truph01 back to you |
|
🚧 luacmartins has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/luacmartins in version: 9.5.0-0 🚀
|
|
🚀 Deployed to production by https://github.com/Julesssss in version: 9.5.0-5 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
Adds a new filter to the Insights page for setting Compare mode (None vs Previous period vs Average). Doesn't change how the charts render yet, that will be implemented in the next issues.
Also updates the
getInsightsaction, so that it sends all properties necessary for the backend to send the compare data:previousPeriodSnapshotHash,averageSnapshotHash,numberOfPeriods. The action is not called when changing the compare mode, backend sends data for all three modes together.The
comparefilter is not yet persisted on the backend as it requires separating the mechanism out ofGetInsightsas we don't call this command when changing compare modes by design. It's fine for now, will be addressed in a follow-up issue.The dropdown button is hidden behind the
insightsComparebeta.Fixed Issues
$ #100663
PROPOSAL: N/A
Tests
insightsPageandinsightsComparebetas.Offline tests
N/A
QA Steps
No tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
iOS: Native
Simulator.Screen.Recording.-.iPhone.17.Pro.-.2026-09-29.at.13.22.45.mov
MacOS: Chrome / Safari
Nagranie.z.ekranu.2026-09-29.o.13.11.41.mov