Skip to content

[NoQA] [Insights] Draw multi-series bar charts - #104085

Merged
luacmartins merged 18 commits into
Expensify:mainfrom
software-mansion-labs:insights/multi-series-bar-charts
Oct 19, 2026
Merged

luacmartins merged 18 commits into
Expensify:mainfrom
software-mansion-labs:insights/multi-series-bar-charts

Conversation

@mhawryluk

@mhawryluk mhawryluk commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Explanation of Change

Bar charts on Insights now draw the comparison picked in the Compare filter as a second bar in each group (both Average and Previous period)

  • With compare:Average Top spenders, Top merchants and Top categories show each group's typical amount next to its current amount, labeled "Typical".
  • For Previous period, the second bar is the same group in the period before. The tooltip names each bar by the period it covers, like "October 2026" and "September 2026". The previous period comes from the Date filter: This month, Last month and Last 12 months compare against the same span of months before, Year to date compares against the same days of last year, and custom ranges compare against the same number of days just before.
  • Search results only include groups with spend, so a group missing from the compared results (like a merchant with no spend last month) compares against $0
  • Each compared bar is a lighter shade of its own bar's color, so the two read as one group. buildChartSeries decides each bar's color, and the tooltip dots use the same colors.
  • A pie chart can only show one period, so it's drawn as bars while comparing.
  • Each row in the inline table below the chart shows the change with an up or down arrow and a percentage.
  • A line chart with one point is drawn as a bar, it now gets its Average bar.

Fixed Issues

$ #103769
PROPOSAL: N/A

Tests

  1. Enable the insightsPage and insightsCompare betas. Go to Insights and set Date to This month and Compare to Average. Verify that Top spenders and Top merchants show two bars per group: the current one, and a lighter shade of the same color next to it.
  2. Hover over a bar on desktop web, or tap it on other platforms. Verify that the tooltip shows the amount, "Typical: [amount]", and the change with an arrow and percentage.
  3. Verify that Top categories shows grouped bars instead of a pie. Set Compare to None and verify that the pie returns.
  4. With Compare set to Average, verify that each table row under the bar charts shows a red up arrow or a green down arrow with the change percentage, and that rows with equal amounts show none.
  5. Pick a range where Spend over time has a single point and set Compare to Average. Verify that it's drawn as two bars: the current amount and the Average.
  6. Set Compare to Previous period. Verify that the tooltip names the bars by the current and previous month, like "October 2026" and "September 2026".
  7. Set Date to Year to date. Verify that the bars are named by the dates from January 1 to today, this year and last year, like "Jan 1 - Oct 15, 2026" and "Jan 1 - Oct 15, 2025".
  8. Set a custom Date range of October 1 to October 31, 2026. Verify that the bars are named "October 2026" and "Aug 31 - Sep 30, 2026
  9. Set Date to This month and add an expense dated the last day of the month before last. Verify that it isn't counted in the previous period.
  10. Set Date to a single day, October 10, 2026. Verify that the bars are named "Oct 10, 2026" and "Oct 9, 2026".
  11. Switch to dark mode and verify that the compared bars and tooltip dots use the darker shade of each bar's hue.
  12. Set Compare to None and verify that all charts look as they did before this change.

Offline tests

  1. Load Insights with Compare set to Average or Previous period, then go offline. Verify that charts already loaded keep showing both bars.
  2. While offline, change the Date filter. Verify that charts without loaded data show the offline state, not single bars that turn into two later.
  3. Go back online. Verify that the charts load and show both bars.
  4. Go online. Clear cache and restart. Load a Top- chart on Home. Go offline. Go to insights. Enable Compare. Verify the chart shows an offline state.

QA Steps

No 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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Nagranie.z.ekranu.2026-10-15.o.15.26.06.mov

@melvin-bot

melvin-bot Bot commented Oct 15, 2026

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

@OSBotify

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 0cea6445..1b9a1120 100644
--- a/src/languages/de.ts
+++ b/src/languages/de.ts
@@ -1176,7 +1176,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'},
+        compare: {label: 'Vergleichen', previousPeriod: 'Vorheriger Zeitraum', average: 'Durchschnitt', typical: 'Typisch'},
     },
     allSettingsScreen: {
         subscription: 'Abonnement',
diff --git a/src/languages/el.ts b/src/languages/el.ts
index 8ae8d6e7..48be3f96 100644
--- a/src/languages/el.ts
+++ b/src/languages/el.ts
@@ -1221,7 +1221,7 @@ const translations: TranslationDeepObject<typeof en> = {
         viewOnSpend: 'Προβολή στο Spend',
         emptyState: {title: 'Τίποτα προς εμφάνιση', subtitle: 'Δοκιμάστε να προσαρμόσετε τα κριτήριά σας παραπάνω'},
         noExpensesState: {title: 'Δείτε πού πηγαίνουν τα χρήματά σας', subtitle: 'Μόλις έχετε δαπάνες, θα βλέπετε τάσεις δαπανών, κορυφαίους εμπόρους και άλλα.'},
-        compare: {label: 'Σύγκριση', previousPeriod: 'Προηγούμενη περίοδος', average: 'Μέσος όρος'},
+        compare: {label: 'Σύγκριση', previousPeriod: 'Προηγούμενη περίοδος', average: 'Μέσος όρος', typical: 'Τυπικό'},
     },
     allSettingsScreen: {
         subscription: 'Συνδρομή',
diff --git a/src/languages/es.ts b/src/languages/es.ts
index 23fc4be3..0c4acc63 100644
--- a/src/languages/es.ts
+++ b/src/languages/es.ts
@@ -1171,7 +1171,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'},
+        compare: {label: 'Comparar', previousPeriod: 'Periodo anterior', average: 'Promedio', typical: 'Típico'},
     },
     allSettingsScreen: {
         subscription: 'Suscripcion',
diff --git a/src/languages/fr.ts b/src/languages/fr.ts
index 7f37b163..7300244c 100644
--- a/src/languages/fr.ts
+++ b/src/languages/fr.ts
@@ -1180,7 +1180,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'},
+        compare: {label: 'Comparer', previousPeriod: 'Période précédente', average: 'Moyenne', typical: 'Typique'},
     },
     allSettingsScreen: {
         subscription: 'Abonnement',
diff --git a/src/languages/it.ts b/src/languages/it.ts
index bd8eb402..5173e86a 100644
--- a/src/languages/it.ts
+++ b/src/languages/it.ts
@@ -1176,7 +1176,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'},
+        compare: {label: 'Confronta', previousPeriod: 'Periodo precedente', average: 'Media', typical: 'Tipico'},
     },
     allSettingsScreen: {
         subscription: 'Abbonamento',
diff --git a/src/languages/ja.ts b/src/languages/ja.ts
index 7da59e4d..b0e3d84b 100644
--- a/src/languages/ja.ts
+++ b/src/languages/ja.ts
@@ -1164,7 +1164,7 @@ const translations: TranslationDeepObject<typeof en> = {
         viewOnSpend: '支出で表示',
         emptyState: {title: '表示するものはありません', subtitle: '上の条件を調整してみてください'},
         noExpensesState: {title: 'お金の使い道を確認する', subtitle: '経費が登録されると、支出の傾向や上位の加盟店など、さまざまな情報を確認できるようになります。'},
-        compare: {label: '比較', previousPeriod: '前の期間', average: '平均'},
+        compare: {label: '比較', previousPeriod: '前の期間', average: '平均', typical: '標準'},
     },
     allSettingsScreen: {
         subscription: 'サブスクリプション',
diff --git a/src/languages/nl.ts b/src/languages/nl.ts
index b96c6121..0baa78b1 100644
--- a/src/languages/nl.ts
+++ b/src/languages/nl.ts
@@ -1175,7 +1175,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'},
+        compare: {label: 'Vergelijken', previousPeriod: 'Vorige periode', average: 'Gemiddeld', typical: 'Typisch'},
     },
     allSettingsScreen: {
         subscription: 'Abonnement',
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index 95e7b90a..8e943df6 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -1197,7 +1197,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'},
+        compare: {label: 'Porównaj', previousPeriod: 'Poprzedni okres', average: 'Średnia', typical: 'Typowe'},
     },
     allSettingsScreen: {
         subscription: 'Subskrypcja',
diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts
index 0a675362..cbf83371 100644
--- a/src/languages/pt-BR.ts
+++ b/src/languages/pt-BR.ts
@@ -1175,7 +1175,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'},
+        compare: {label: 'Comparar', previousPeriod: 'Período anterior', average: 'Média', typical: 'Típico'},
     },
     allSettingsScreen: {
         subscription: 'Assinatura',
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index 3b4ae9ff..f12bc305 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -1129,7 +1129,7 @@ const translations: TranslationDeepObject<typeof en> = {
         viewOnSpend: '在支出中查看',
         emptyState: {title: '没有可显示的内容', subtitle: '请尝试调整上面的条件'},
         noExpensesState: {title: '查看你的资金流向', subtitle: '添加报销后,您就能查看消费趋势、主要商家等更多信息。'},
-        compare: {label: '比较', previousPeriod: '上一期', average: '平均'},
+        compare: {label: '比较', previousPeriod: '上一期', average: '平均', typical: '典型'},
     },
     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

@mhawryluk

Copy link
Copy Markdown
Member Author

@MelvinBot review, but only the changes on top of this other PR's branch: #103989

@codecov

codecov Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

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.

Files with missing lines Coverage Δ
src/components/Charts/barChartConstants.ts 100.00% <100.00%> (ø)
...components/Charts/utils/formatTooltipComparison.ts 92.00% <100.00%> (+2.00%) ⬆️
src/components/Search/SearchChartView.tsx 82.92% <100.00%> (-0.41%) ⬇️
src/pages/Insights/InsightsDashboard.tsx 82.75% <100.00%> (+0.40%) ⬆️
src/pages/Insights/charts/InsightsChartWidget.tsx 95.83% <100.00%> (+0.18%) ⬆️
src/pages/Insights/insightsQueries.ts 93.02% <100.00%> (ø)
src/pages/Insights/resolveDashboardState.ts 100.00% <ø> (ø)
...nents/Charts/components/ChartTooltipComparison.tsx 0.00% <0.00%> (ø)
src/pages/Insights/insightsCompare.ts 93.75% <93.75%> (ø)
src/styles/utils/index.ts 63.17% <0.00%> (-0.08%) ⬇️
... and 4 more
... and 43 files with indirect coverage changes

@MelvinBot

Copy link
Copy Markdown
Contributor

Review: changes on top of [NoQA] [Insights] Draw Average mode baseline on Spend over time

I reviewed only the 6 commits from c187c5e (the head of that PR) to 872903a. The other PR's head is an ancestor of this branch, so this diff is clean.

The changes look good. Please address two issues and consider one nit.

1. The $0 fallback may be wrong if the backend limits the compared rows.
The previous-period and average queries still pass limit: chart.limit (insightsQueries.ts:47). The client drops the limit only when it groups the rows (useInsightsChartData.ts:79). If the backend also returns only the top N groups for those queries, the fallback breaks. Example: a merchant that ranks #2 this month but ranked #7 last month is missing from the compared rows. buildChartSeries.ts:154 then plots $0, and the table shows "↑ ∞%".
To fix it, confirm that the backend returns every group for compared queries, or drop limit from those queries.

2. Screen readers can't tell whether spend went up or down.
In InsightsDataTable.tsx:89-97, only the arrow icon and the color show the direction. The text reads just "12%". Add a translated accessibility label that includes the direction, such as "Up 12%".

Nit: A group with no spend in the compared period shows "∞%" in the table and tooltip (formatTooltipComparison.ts:45). Consider checking with design whether "New" would read better.

What I checked that looks correct
  • The Y-axis range includes both series, so the compared bars aren't clipped.
  • The tooltip sits above the taller bar in each group.
  • The period math for each preset matches getDateRangeForPreset, and the custom and single-day ranges use the same number of days just before.
  • Each compared bar gets the 200 shade of its own color in light mode and the 700 shade in dark mode. The tooltip dots match.
  • The pie chart is drawn as bars only while a comparison is shown.
  • A missing compared snapshot still shows the loading or offline state.
  • Line charts skip Previous period. A line chart with one point now gets its Average bar.
  • CI: only the checklist and approval checks are failing.

view run

@mhawryluk

Copy link
Copy Markdown
Member Author

1. The $0 fallback may be wrong if the backend limits the compared rows.

I tested and it works correctly. The backend does not simply send top 10 of previous period, but values in previous period of items in current period's top 10. we still need to drop the limit, cause the limit is 5 and the backend sends 10 though

2. Screen readers can't tell whether spend went up or down. In InsightsDataTable.tsx:89-97, only the arrow icon and the color show the direction. The text reads just "12%". Add a translated accessibility label that includes the direction, such as "Up 12%".

true, done, I went with "Up x%" and "Down x%"

Nit: A group with no spend in the compared period shows "∞%" in the table and tooltip (formatTooltipComparison.ts:45). Consider checking with design whether "New" would read better.

👍

@mhawryluk

Copy link
Copy Markdown
Member Author

Nit: A group with no spend in the compared period shows "∞%" in the table and tooltip (formatTooltipComparison.ts:45). Consider checking with design whether "New" would read better.

@dannymcclain @JmillsExpensify is this correct? up infinity for new items, shorter row for no change

Zrzut ekranu 2026-10-16 o 18 12 02

@mhawryluk
mhawryluk marked this pull request as ready for review October 16, 2026 16:13
@mhawryluk
mhawryluk requested review from a team as code owners October 16, 2026 16:13
@melvin-bot
melvin-bot Bot requested review from truph01 and removed request for a team October 16, 2026 16:13
@melvin-bot

melvin-bot Bot commented Oct 16, 2026

Copy link
Copy Markdown

@truph01 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]

@melvin-bot
melvin-bot Bot requested review from dylanexpensify and removed request for a team October 16, 2026 16:13
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T16:33:20.051202Z c2236c5 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Comment thread src/components/Charts/BarChart/VerticalBarChartContent.tsx
@dannymcclain

Copy link
Copy Markdown
Contributor

@dannymcclain @JmillsExpensify is this correct? up infinity for new items, shorter row for no change

Would love @JmillsExpensify to weigh in here with what he thinks, but ^ infinity doesn't seem super helpful to me. I'd rather show something like New or +$200 (new) or something that's easier to understand, or maybe even nothing at all.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c2236c57a5

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/components/Charts/BarChart/VerticalBarChartContent.tsx Outdated
@luacmartins
luacmartins self-requested a review October 16, 2026 16:40

Copy link
Copy Markdown
Contributor

That looks good to me, though defer to @dannymcclain when he's online in a bit.

@truph01

truph01 commented Oct 19, 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
Screen.Recording.2026-10-19.at.17.25.32.mov
Android: mWeb Chrome
Screen.Recording.2026-10-19.at.17.30.52.mov
iOS: HybridApp
iOS: mWeb Safari
MacOS: Chrome / Safari
Screen.Recording.2026-10-19.at.17.21.30.mov

@OlGierd03 OlGierd03 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great work! Few small comments 🚀

Comment thread src/components/Charts/types/index.ts
Comment thread src/components/Search/buildChartSeries.ts
Comment thread src/components/Search/buildChartSeries.ts
Comment thread src/pages/Insights/charts/InsightsDataTable.tsx Outdated
Comment thread src/pages/Insights/charts/InsightsChartWidget.tsx
}

/** Resolves the period the Date filter covers and the one before it, which name the compared series. The backend picks the compared rows itself. */
function resolveComparisonPeriods(dateFilter: InsightsFilters['date']): ChartComparisonPeriods | undefined {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

NAB: Since we're mirroring the backend's previous-period math here, the label and the data could drift apart if that logic changes. Fine for now, but returning the resolved range from the backend could be a nice follow-up

@mhawryluk mhawryluk Oct 19, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yeah, it's a very good idea and I wish we had thought about this when writing the design doc. I agree that we shouldn't block the PR on this and instead do it in a follow-up

@mhawryluk
mhawryluk requested a review from a team as a code owner October 19, 2026 13:29
@github-actions

Copy link
Copy Markdown
Contributor

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

@github-actions

This comment has been minimized.

@JmillsExpensify JmillsExpensify left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks really great!

@dannymcclain

Copy link
Copy Markdown
Contributor

That looks good to me, though defer to @dannymcclain when he's online in a bit.

Yeah that seems like a great starting point 👍

@dannymcclain

Copy link
Copy Markdown
Contributor

The build is looking good to me too

@JmillsExpensify

Copy link
Copy Markdown
Contributor

@truph01 are you good with the PR as well?

@luacmartins luacmartins left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM @truph01 please priority this review

@luacmartins

Copy link
Copy Markdown
Contributor

I'm gonna merge this given the checklist here

@luacmartins
luacmartins merged commit b2de2d6 into Expensify:main Oct 19, 2026
39 of 42 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

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

@OSBotify

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/luacmartins in version: 9.5.15-1 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/grgia in version: 9.5.15-3 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

@ZhenjaHorbach

ZhenjaHorbach commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Just noticed a small issue from this PR for Android native

Sometimes we have this error in the console

✖ [11:24:33.264Z][Console] Encountered two children with the same key, %s. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version. bar-primary-No merchant

To fix this, we can update the key for Bar
So you can add this in your next PR 😁

diff --git a/src/components/Charts/BarChart/VerticalBarChartContent.tsx b/src/components/Charts/BarChart/VerticalBarChartContent.tsx
index 7272de0a4d90..b664fcae6aa3 100644
--- a/src/components/Charts/BarChart/VerticalBarChartContent.tsx
+++ b/src/components/Charts/BarChart/VerticalBarChartContent.tsx
@@ -159,7 +159,7 @@ function VerticalBarChartCanvas({data, series, yAxisUnit, yAxisUnitPosition = 'l
 
         return (
             <Bar
-                key={`bar-${seriesItem.key}-${dataPoint.label}`}
+                key={`bar-${seriesItem.key}-${point.xValue}`}
                 points={[{...point, x: point.x + offset}]}
                 chartBounds={chartBounds}
                 color={color}

@mhawryluk

Copy link
Copy Markdown
Member Author

Just noticed a small issue from this PR for Android native

Sometimes we have this error in the console

✖ [11:24:33.264Z][Console] Encountered two children with the same key, %s. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version. bar-primary-No merchant

To fix this, we can update the key for Bar So you can add this in your next PR 😁

diff --git a/src/components/Charts/BarChart/VerticalBarChartContent.tsx b/src/components/Charts/BarChart/VerticalBarChartContent.tsx
index 7272de0a4d90..b664fcae6aa3 100644
--- a/src/components/Charts/BarChart/VerticalBarChartContent.tsx
+++ b/src/components/Charts/BarChart/VerticalBarChartContent.tsx
@@ -159,7 +159,7 @@ function VerticalBarChartCanvas({data, series, yAxisUnit, yAxisUnitPosition = 'l
 
         return (
             <Bar
-                key={`bar-${seriesItem.key}-${dataPoint.label}`}
+                key={`bar-${seriesItem.key}-${point.xValue}`}
                 points={[{...point, x: point.x + offset}]}
                 chartBounds={chartBounds}
                 color={color}

thanks! we'll fix it

@mhawryluk

Copy link
Copy Markdown
Member Author

included the fix here: #104578

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.

10 participants