Skip to content

[Insights polish] Details RHP: Biggest changes - #108108

Open
mhawryluk wants to merge 44 commits into
Expensify:mainfrom
software-mansion-labs:insights/details-rhp-biggest-changes
Open

mhawryluk wants to merge 44 commits into
Expensify:mainfrom
software-mansion-labs:insights/details-rhp-biggest-changes

Conversation

@mhawryluk

@mhawryluk mhawryluk commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

Explanation of Change

Adds the Biggest changes section to the Details panel for Spend over time. It lists up to 5 categories, merchants or spenders whose spend in the clicked period moved furthest from their own average, with the change in amount and percent. Clicking a row opens that item's Details panel for the same period, which is now passed in the URL with start, end and period.

The grouping is picked from a dropdown and saved in the new nvp_insightsBiggestChangesGroupBy NVP. Spenders is only offered to people who can see Top spenders. When it isn't offered, the section shows Categories but still requests the picked grouping, and the backend falls back on its own, so the pick isn't overwritten. The panel's request sends the grouping in biggestChangesGroupBy and switching it fetches only the biggestChanges section into the same panel. The panel reads the saved grouping once it loads, so a change made in another session doesn't switch it.

Also splits InsightsDetailsPage into smaller pieces:

  • useInsightsDetailsItem resolves the item from the URL
  • useBiggestChangesGroupBy handles the grouping
  • buildInsightsDetailsQueries builds the requests
  • getInsightsDetailsSectionStates gives each section its state.

Fixed Issues

$ #105763
PROPOSAL: N/A

Tests

  1. Open Insights > Spend, click a point on Spend over time.
  2. Check Biggest changes lists up to 5 categories, each with its amount, the change from its average and the percent change.
  3. Find an item with no spend in earlier periods, or a change of 1,000% or more. Check it shows only the amount change, without a percentage.
  4. Switch the dropdown to Merchants, then Spenders. Check the list updates and only a GetInsightsDetails request with sections: ["biggestChanges"] is sent.
  5. Close and reopen the panel. Check it opens with the last picked grouping.
  6. Click a row. Check the item's panel opens for the clicked time bucket on spend over time, and going back returns to the previous panel.
  7. Select a workspace with a single member. Check Spenders isn't offered.
  8. Pick Spenders, then select a workspace with a single member and open a panel. Check Biggest changes shows Categories, then select a workspace with more members and check the next panel opens on Spenders again.
  9. Select a workspace with at least two members where you're an admin and that has no expenses, plus a workspace where you're only a member and have expenses. Open a point and switch to Spenders. Check an empty state shows with the dropdown still there, so it's possible to select other group-bys that do show rows.
  10. Simulate failing network requests and switch the grouping. Check only Biggest changes shows the error and the button refetches only that section.
  11. Open a period with less than 3 months of history before it. Check Biggest changes is hidden.
  12. Open the same panel in two browsers and switch the grouping in one. Check the other keeps its grouping and doesn't keep sending requests.

Offline tests

  1. Open the Details panel and let it load, then go offline.
  2. Switch the grouping to one that wasn't loaded yet. Check Biggest changes shows the offline state while the other sections stay on screen.
  3. Go back online. Check Biggest changes loads for the picked grouping.
  4. Go offline and open a panel that wasn't loaded before. Check every section shows the offline state, then go back online and check they load.

QA Steps

Same as tests.

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I verified any copy / text that was added to the app is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If the PR adds or modifies the UI:
    • I asked an AI agent to review the changes for accessibility issues and addressed its findings.
    • I tested with a screen reader (VoiceOver on macOS) and verified all new/changed elements are reachable with a logical focus order.
    • I verified all new/changed elements have meaningful accessible names and roles.
    • I verified state changes are announced (e.g. checked/unchecked, expanded/collapsed, selected).
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Nagranie.z.ekranu.2026-12-1.o.13.38.42.mov
Android: mWeb Chrome
iOS: Native
Screen.Recording.iPhone.17.Pro.01-12-2026.at.13.46.13.mp4
iOS: mWeb Safari
MacOS: Chrome / Safari
Nagranie.z.ekranu.2026-12-1.o.13.28.51.mov

@expensify-chore-bot

Copy link
Copy Markdown

Hey, I noticed you changed src/languages/en.ts in a PR from a fork. For security reasons, translations are not generated automatically for PRs from forks.

If you want to automatically generate translations for other locales, an Expensify employee will have to:

  1. Look at the code and make sure there are no malicious changes.
  2. Run the Generate static translations GitHub workflow. If you have write access and the K2 extension, you can simply click: [this button]

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 --help

Typically, you'd want to translate only what you changed by running npx bun ./scripts/generateTranslations.ts --compare-ref main

@codecov

codecov Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ Changes either increased or maintained existing code coverage, great job!

Files with missing lines Coverage Δ
src/CONST/SENTRY_LABEL.ts 100.00% <ø> (ø)
src/CONST/index.ts 96.37% <ø> (ø)
src/ONYXKEYS.ts 100.00% <ø> (ø)
src/ROUTES.ts 36.80% <100.00%> (ø)
src/libs/ExportOnyxState/masking.ts 93.92% <ø> (ø)
...c/pages/Insights/controls/InsightsGroupByPopup.tsx 100.00% <100.00%> (ø)
src/pages/Insights/dashboardSpecs.ts 98.76% <ø> (ø)
src/pages/Insights/details/InsightsDetailsPage.tsx 98.36% <100.00%> (+4.45%) ⬆️
...ages/Insights/details/buildInsightsDetailsQuery.ts 88.46% <100.00%> (+0.46%) ⬆️
.../Insights/details/formatBiggestChangePercentage.ts 100.00% <100.00%> (ø)
... and 20 more
... and 7522 files with indirect coverage changes

@OSBotify

This comment has been minimized.

@mhawryluk
mhawryluk marked this pull request as ready for review December 1, 2026 12:52
@mhawryluk

Copy link
Copy Markdown
Member Author

Yeah, I think you're right. "-100%" isn't wrong, though with the AI Insights cards, from 1,000% and above, we actually drop the percent and show only the amount change. I wonder if we should do the same here as well. Having these crazy big percentage increases/decreases from a small doesn't feel particularly helpful to me. @dannymcclain thoughts?

okie, the percentage is now hidden from +1,000% up and from -1,000% down, so those rows only show the amount change (also did the same for changes from a $0 average, which used to show "—")

Zrzut ekranu 2026-12-2 o 12 42 55

@OSBotify

OSBotify commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

🦜 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 diff
diff --git a/src/languages/de.ts b/src/languages/de.ts
index 583d4081..bf58109e 100644
--- a/src/languages/de.ts
+++ b/src/languages/de.ts
@@ -598,7 +598,7 @@ const translations: TranslationDeepObject<typeof en> = {
         submitter: 'Einreicher',
         clearField: (fieldName: string) => `${fieldName} löschen`,
         merchants: 'Händler',
-        spenders: 'Ausgebende Personen',
+        spenders: 'Ausgabenverursacher',
         previousExpense: 'Vorherige Ausgabe',
         nextExpense: 'Nächste Ausgabe',
         previousReport: 'Vorheriger Bericht',
@@ -1367,7 +1367,7 @@ const translations: TranslationDeepObject<typeof en> = {
             monthAverage: (count: number) => `${count}-Monatsdurchschnitt`,
             quarterAverage: (count: number) => `Durchschnitt der letzten ${count} Quartale`,
             shareOfTotal: 'Anteil am Gesamtbetrag',
-            versusSpenderAverage: (amount: string) => `${amount} im Vergleich zum Durchschnitt dieses Ausgebenden`,
+            versusSpenderAverage: (amount: string) => `${amount} vs. dem Durchschnitt dieses Ausgebenden`,
         },
         generatingAIInsights: 'KI-Einblicke werden erzeugt ...',
         generatingAIInsightsSubtitle: 'Das sollte nicht länger als eine Minute dauern',
@@ -1391,6 +1391,7 @@ const translations: TranslationDeepObject<typeof en> = {
         flaggedExpenses: 'Markierte Ausgaben',
         noFlaggedExpensesInRange: 'Keine markierten Ausgaben in diesem Zeitraum',
         biggestChanges: 'Größte Änderungen',
+        noSpenderData: 'Keine Ausgabendaten für diesen Zeitraum.',
     },
     allSettingsScreen: {
         subscription: 'Abonnement',
diff --git a/src/languages/el.ts b/src/languages/el.ts
index a8485e4f..80fcb883 100644
--- a/src/languages/el.ts
+++ b/src/languages/el.ts
@@ -594,7 +594,7 @@ const translations: TranslationDeepObject<typeof en> = {
         submitter: 'Υποβάλλων',
         clearField: (fieldName: string) => `Εκκαθαρίστε το πεδίο ${fieldName}`,
         merchants: 'Έμποροι',
-        spenders: 'Δαπανητές',
+        spenders: 'Δαπανώντες',
         previousExpense: 'Προηγούμενη δαπάνη',
         nextExpense: 'Επόμενη δαπάνη',
         previousReport: 'Προηγούμενη αναφορά',
@@ -1413,7 +1413,7 @@ const translations: TranslationDeepObject<typeof en> = {
             monthAverage: (count: number) => `μέσος όρος ${count} μηνών`,
             quarterAverage: (count: number) => `μέσος όρος ${count} τριμήνων`,
             shareOfTotal: 'Ποσοστό επί του συνόλου',
-            versusSpenderAverage: (amount: string) => `${amount} σε σύγκριση με τον μέσο όρο αυτού του δαπανητή`,
+            versusSpenderAverage: (amount: string) => `${amount} έναντι του μέσου όρου αυτού του δαπανητή`,
         },
         generatingAIInsights: 'Δημιουργία AI Insights...',
         generatingAIInsightsSubtitle: 'Αυτό δεν θα πάρει πάνω από ένα λεπτό',
@@ -1437,6 +1437,7 @@ const translations: TranslationDeepObject<typeof en> = {
         flaggedExpenses: 'Επισημασμένες δαπάνες',
         noFlaggedExpensesInRange: 'Δεν υπάρχουν επισημασμένες δαπάνες σε αυτό το εύρος',
         biggestChanges: 'Οι μεγαλύτερες αλλαγές',
+        noSpenderData: 'Δεν υπάρχουν δεδομένα δαπανών για αυτήν την περίοδο.',
     },
     allSettingsScreen: {
         subscription: 'Συνδρομή',
diff --git a/src/languages/es.ts b/src/languages/es.ts
index dc0822d2..c459bece 100644
--- a/src/languages/es.ts
+++ b/src/languages/es.ts
@@ -581,7 +581,7 @@ const translations: TranslationDeepObject<typeof en> = {
         submitter: 'Remitente',
         clearField: (fieldName: string) => `Borrar ${fieldName}`,
         merchants: 'Comercios',
-        spenders: 'Gastadores',
+        spenders: 'Personas que gastan',
         previousExpense: 'Gasto anterior',
         nextExpense: 'Gasto siguiente',
         previousReport: 'Informe anterior',
@@ -1361,7 +1361,7 @@ const translations: TranslationDeepObject<typeof en> = {
             monthAverage: (count: number) => `Promedio de ${count} meses`,
             quarterAverage: (count: number) => `Promedio de ${count} trimestres`,
             shareOfTotal: 'Porcentaje del total',
-            versusSpenderAverage: (amount: string) => `${amount} frente a la media de este usuario`,
+            versusSpenderAverage: (amount: string) => `${amount} frente a la media de esta persona que gasta`,
         },
         generatingAIInsights: 'Generando información con IA...',
         generatingAIInsightsSubtitle: 'Esto no debería llevar más de un minuto',
@@ -1385,6 +1385,7 @@ const translations: TranslationDeepObject<typeof en> = {
         flaggedExpenses: 'Gastos marcados',
         noFlaggedExpensesInRange: 'No hay gastos marcados en este intervalo',
         biggestChanges: 'Cambios más importantes',
+        noSpenderData: 'No hay datos de gastos para este periodo.',
     },
     allSettingsScreen: {
         subscription: 'Suscripcion',
diff --git a/src/languages/fr.ts b/src/languages/fr.ts
index 49fc2a42..ee245a5a 100644
--- a/src/languages/fr.ts
+++ b/src/languages/fr.ts
@@ -1374,7 +1374,7 @@ const translations: TranslationDeepObject<typeof en> = {
             monthAverage: (count: number) => `Moyenne sur ${count} mois`,
             quarterAverage: (count: number) => `Moyenne sur ${count} trimestres`,
             shareOfTotal: 'Part du total',
-            versusSpenderAverage: (amount: string) => `${amount} par rapport à la moyenne de ce déclarant`,
+            versusSpenderAverage: (amount: string) => `${amount} par rapport à la moyenne de cette personne qui dépense`,
         },
         generatingAIInsights: 'Génération d’analyses IA...',
         generatingAIInsightsSubtitle: 'Cela ne devrait pas prendre plus d’une minute',
@@ -1397,7 +1397,8 @@ const translations: TranslationDeepObject<typeof en> = {
         },
         flaggedExpenses: 'Dépenses signalées',
         noFlaggedExpensesInRange: 'Aucune dépense signalée dans cet intervalle',
-        biggestChanges: 'Principaux changements',
+        biggestChanges: 'Changements les plus importants',
+        noSpenderData: 'Aucune donnée de dépense pour cette période.',
     },
     allSettingsScreen: {
         subscription: 'Abonnement',
diff --git a/src/languages/it.ts b/src/languages/it.ts
index 5d7ccf42..b3cf0df3 100644
--- a/src/languages/it.ts
+++ b/src/languages/it.ts
@@ -597,7 +597,7 @@ const translations: TranslationDeepObject<typeof en> = {
         submitter: 'Mittente',
         clearField: (fieldName: string) => `Cancella ${fieldName}`,
         merchants: 'Esercenti',
-        spenders: 'Utenti che spendono',
+        spenders: 'Utenti spenditori',
         previousExpense: 'Spesa precedente',
         nextExpense: 'Spesa successiva',
         previousReport: 'Report precedente',
@@ -1370,7 +1370,7 @@ const translations: TranslationDeepObject<typeof en> = {
             monthAverage: (count: number) => `media di ${count} mesi`,
             quarterAverage: (count: number) => `Media di ${count} trimestri`,
             shareOfTotal: 'Quota del totale',
-            versusSpenderAverage: (amount: string) => `${amount} rispetto alla media di chi ha speso`,
+            versusSpenderAverage: (amount: string) => `${amount} rispetto alla media di questa persona che spende`,
         },
         generatingAIInsights: 'Generazione di approfondimenti IA in corso...',
         generatingAIInsightsSubtitle: 'Non dovrebbe volerci più di un minuto',
@@ -1394,6 +1394,7 @@ const translations: TranslationDeepObject<typeof en> = {
         flaggedExpenses: 'Spese contrassegnate',
         noFlaggedExpensesInRange: 'Nessuna spesa contrassegnata in questo intervallo',
         biggestChanges: 'Cambiamenti principali',
+        noSpenderData: 'Nessun dato di spesa per questo periodo.',
     },
     allSettingsScreen: {
         subscription: 'Abbonamento',
diff --git a/src/languages/ja.ts b/src/languages/ja.ts
index 5d0ada81..9594ca66 100644
--- a/src/languages/ja.ts
+++ b/src/languages/ja.ts
@@ -596,7 +596,7 @@ const translations: TranslationDeepObject<typeof en> = {
         submitter: '申請者',
         clearField: (fieldName: string) => `${fieldName}を消去`,
         merchants: '加盟店',
-        spenders: '利用者',
+        spenders: '支出者',
         previousExpense: '前回の経費',
         nextExpense: '次の経費',
         previousReport: '前のレポート',
@@ -1378,7 +1378,8 @@ const translations: TranslationDeepObject<typeof en> = {
         },
         flaggedExpenses: 'フラグ付き経費',
         noFlaggedExpensesInRange: 'この範囲にはフラグ付き経費はありません',
-        biggestChanges: '最大の変更点',
+        biggestChanges: '主な変更点',
+        noSpenderData: 'この期間の利用者データはありません。',
     },
     allSettingsScreen: {
         subscription: 'サブスクリプション',
diff --git a/src/languages/nl.ts b/src/languages/nl.ts
index d47fe4ad..9db35548 100644
--- a/src/languages/nl.ts
+++ b/src/languages/nl.ts
@@ -1366,7 +1366,7 @@ const translations: TranslationDeepObject<typeof en> = {
             monthAverage: (count: number) => `Gemiddelde over ${count} maanden`,
             quarterAverage: (count: number) => `gemiddelde over ${count} kwartalen`,
             shareOfTotal: 'Aandeel van totaal',
-            versusSpenderAverage: (amount: string) => `${amount} vs het gemiddelde van deze gebruiker`,
+            versusSpenderAverage: (amount: string) => `${amount} vs het gemiddelde van deze betaler`,
         },
         generatingAIInsights: 'AI-inzichten genereren...',
         generatingAIInsightsSubtitle: 'Dit duurt niet langer dan een minuut',
@@ -1389,7 +1389,8 @@ const translations: TranslationDeepObject<typeof en> = {
         },
         flaggedExpenses: 'Gemarkeerde uitgaven',
         noFlaggedExpensesInRange: 'Geen gemarkeerde uitgaven in dit bereik',
-        biggestChanges: 'Belangrijkste wijzigingen',
+        biggestChanges: 'Grootste veranderingen',
+        noSpenderData: 'Geen uitgavendata voor deze periode.',
     },
     allSettingsScreen: {
         subscription: 'Abonnement',
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index e6fd6c9e..1c4c909e 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -608,7 +608,7 @@ const translations: TranslationDeepObject<typeof en> = {
         submitter: 'Zgłaszający',
         clearField: (fieldName: string) => `Wyczyść pole ${fieldName}`,
         merchants: 'Sprzedawcy',
-        spenders: 'Wydający',
+        spenders: 'Osoby wydające',
         previousExpense: 'Poprzedni wydatek',
         nextExpense: 'Następny wydatek',
         previousReport: 'Poprzedni raport',
@@ -1408,7 +1408,7 @@ const translations: TranslationDeepObject<typeof en> = {
             monthAverage: (count: number) => `średnia z ${count} miesięcy`,
             quarterAverage: (count: number) => `Średnia z ${count} kwartałów`,
             shareOfTotal: 'Udział w sumie',
-            versusSpenderAverage: (amount: string) => `${amount} vs średnia tego wydającego`,
+            versusSpenderAverage: (amount: string) => `${amount} vs średnia wydatkującego`,
         },
         generatingAIInsights: 'Generowanie podpowiedzi AI...',
         generatingAIInsightsSubtitle: 'To nie powinno zająć więcej niż minutę',
@@ -1432,6 +1432,7 @@ const translations: TranslationDeepObject<typeof en> = {
         flaggedExpenses: 'Oznaczone wydatki',
         noFlaggedExpensesInRange: 'Brak oznaczonych wydatków w tym zakresie',
         biggestChanges: 'Największe zmiany',
+        noSpenderData: 'Brak danych wydatkującego za ten okres.',
     },
     allSettingsScreen: {
         subscription: 'Subskrypcja',
diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts
index 3d772210..9ce64f8c 100644
--- a/src/languages/pt-BR.ts
+++ b/src/languages/pt-BR.ts
@@ -595,8 +595,8 @@ const translations: TranslationDeepObject<typeof en> = {
         amount: 'Valor',
         submitter: 'Remetente',
         clearField: (fieldName: string) => `Limpar ${fieldName}`,
-        merchants: 'Estabelecimentos',
-        spenders: 'Quem gasta',
+        merchants: 'Comerciantes',
+        spenders: 'Gastadores',
         previousExpense: 'Despesa anterior',
         nextExpense: 'Próxima despesa',
         previousReport: 'Relatório anterior',
@@ -1369,7 +1369,7 @@ const translations: TranslationDeepObject<typeof en> = {
             monthAverage: (count: number) => `média de ${count} meses`,
             quarterAverage: (count: number) => `média de ${count} trimestres`,
             shareOfTotal: 'Parcela do total',
-            versusSpenderAverage: (amount: string) => `${amount} vs média deste gastador`,
+            versusSpenderAverage: (amount: string) => `${amount} vs a média deste usuário`,
         },
         generatingAIInsights: 'Gerando insights de IA...',
         generatingAIInsightsSubtitle: 'Isso não deve levar mais de um minuto',
@@ -1392,7 +1392,8 @@ const translations: TranslationDeepObject<typeof en> = {
         },
         flaggedExpenses: 'Despesas sinalizadas',
         noFlaggedExpensesInRange: 'Nenhuma despesa sinalizada neste intervalo',
-        biggestChanges: 'Maiores mudanças',
+        biggestChanges: 'Principais mudanças',
+        noSpenderData: 'Nenhum dado de gasto para este período.',
     },
     allSettingsScreen: {
         subscription: 'Assinatura',
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index 1df4b4ea..32593f9d 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -592,7 +592,7 @@ const translations: TranslationDeepObject<typeof en> = {
         submitter: '提交人',
         clearField: (fieldName: string) => `清除${fieldName}`,
         merchants: '商户',
-        spenders: '支出人',
+        spenders: '消费人',
         previousExpense: '上一笔费用',
         nextExpense: '下一笔报销',
         previousReport: '上一份报表',
@@ -1321,7 +1321,7 @@ const translations: TranslationDeepObject<typeof en> = {
             monthAverage: (count: number) => `${count} 个月平均值`,
             quarterAverage: (count: number) => `${count} 个季度平均值`,
             shareOfTotal: '总份额',
-            versusSpenderAverage: (amount: string) => `${amount} 与此消费人平均值对比`,
+            versusSpenderAverage: (amount: string) => `${amount} 对比此消费人的平均值`,
         },
         generatingAIInsights: '正在生成 AI 洞察…',
         generatingAIInsightsSubtitle: '这不会花费超过一分钟',
@@ -1345,6 +1345,7 @@ const translations: TranslationDeepObject<typeof en> = {
         flaggedExpenses: '被标记的报销费用',
         noFlaggedExpensesInRange: '此范围内没有被标记的报销费用',
         biggestChanges: '最大变更',
+        noSpenderData: '此期间没有报销人数据。',
     },
     allSettingsScreen: {
         subscription: '订阅',

Note

You can apply these changes to your branch by copying the patch to your clipboard, then running pbpaste | git apply 😉

View workflow run

@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

🚧 JmillsExpensify has triggered a test Expensify/App build. You can view the workflow run here.

@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
Built from App PR #108108 with the pinned Mobile-Expensify submodule.

Android 🤖 iOS 🍎
⏩ SKIPPED ⏩ ⏩ SKIPPED ⏩
The build for Android was skipped The build for iOS was skipped
Web 🕸️
https://108108.adhoc.expensify.com
Web

👀 View the workflow run that generated this build 👀

@JmillsExpensify

Copy link
Copy Markdown
Contributor

Yeah, I think you're right. "-100%" isn't wrong, though with the AI Insights cards, from 1,000% and above, we actually drop the percent and show only the amount change. I wonder if we should do the same here as well. Having these crazy big percentage increases/decreases from a small doesn't feel particularly helpful to me. @dannymcclain thoughts?

okie, the percentage is now hidden from +1,000% up and from -1,000% down, so those rows only show the amount change (also did the same for changes from a $0 average, which used to show "—")

Zrzut ekranu 2026-12-2 o 12 42 55

@dannymcclain what are your thoughts on this one? I'm wavering a bit what the best way is to handle it. Maybe we just show the - so there is something there vs nothing? That said, we also don't need to hold this PR up on something so small, though I did want to call out that I'm not confident on this change.

@dannymcclain

Copy link
Copy Markdown
Contributor

@dannymcclain what are your thoughts on this one? I'm wavering a bit what the best way is to handle it. Maybe we just show the - so there is something there vs nothing? That said, we also don't need to hold this PR up on something so small, though I did want to call out that I'm not confident on this change.

Agree we don't need to hold up the PR on this detail, but I'm genuinely not sure what the best way is. Do you think these types of high percentage deltas are common? If the numbers are accurate, is it better to just show them? I really don't know what will resonate with customers the best here.

I agree that just including the — might be better than showing nothing at all, but at the same time, I'm tempted to just give them the data (as long as it's correct).

@JmillsExpensify

Copy link
Copy Markdown
Contributor

Yeah not sure either. Maybe it's an exception, but this is basically bound to happen on most any day in Spend over time because we are comparing day-on-day changes, and sometimes spend just doesn't happen. So you see this large percentage changes when it's ultimately not that big of a deal.

@dannymcclain

Copy link
Copy Markdown
Contributor

but this is basically bound to happen on most any day in Spend over time because we are comparing day-on-day changes, and sometimes spend just doesn't happen. So you see this large percentage changes when it's ultimately not that big of a deal.

Ah yeah ok I wasn't thinking about it like that. So they really aren't super helpful in that context.

@truph01

truph01 commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
  • I verified tests pass on all platforms & I tested again on:
    • Android: HybridApp
    • Android: mWeb Chrome
    • iOS: HybridApp
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained """"why"""" the code was doing something instead of only explaining """"what"""" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: HybridApp
Android: mWeb Chrome
iOS: HybridApp
iOS: mWeb Safari
MacOS: Chrome / Safari 02-oct-panel-biggest-changes-categories 04-grouping-merchants 05-grouping-spenders 06-spender-row-opens-top-spenders-panel 21-meals-row-week-period-panel

OlGierd03 and others added 5 commits December 3, 2026 21:18
…biggest-changes

# Conflicts:
#	src/languages/de.ts
#	src/languages/el.ts
#	src/languages/es.ts
#	src/languages/fr.ts
#	src/languages/it.ts
#	src/languages/ja.ts
#	src/languages/nl.ts
#	src/languages/pl.ts
#	src/languages/pt-BR.ts
#	src/languages/zh-hans.ts
#	src/libs/actions/Insights.ts
#	src/pages/Insights/details/InsightsDetailsPage.tsx
@jmusial jmusial mentioned this pull request Dec 4, 2026
36 tasks done
@mhawryluk
mhawryluk requested a review from truph01 December 4, 2026 12:09
@mhawryluk

Copy link
Copy Markdown
Member Author

failing reassure performance tests are unrelated and will be fixed here: #108892

@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

🚧 JmillsExpensify has triggered a test Expensify/App build. You can view the workflow run here.

This branch has not been deployed

No deployments
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.

7 participants