Skip to content

[Insights] Add summaries to the headline charts - #107750

Merged
aldo-expensify merged 14 commits into
mainfrom
cmartins-insights-headline-summary
Dec 1, 2026
Merged

aldo-expensify merged 14 commits into
mainfrom
cmartins-insights-headline-summary

Conversation

@luacmartins

@luacmartins luacmartins commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

Add summaries to the Spend, Compliance, and Efficiency headline charts. They use range totals from Auth #27101 and compare the same number of days when the current range is still in progress. The Efficiency headline and chart pill use the same report-weighted average. Older cached charts still render without a summary.

Large VND totals can still be truncated in the Spend chart. The separate Auth fix has not shipped yet.

Fixed Issues

$ #107477

Tests

  1. Open Insights → Spend and choose This month and Previous period. Verify the total and expense count cover the month so far and the percentage compares the same days last month.
  2. Open Compliance and switch Violations by between Submitters and Approvers. Verify the violation count and the number of distinct flagged expenses both follow the selection.
  3. Open Efficiency, select Average, and change Group by. Verify the headline number and pill match, the number stays the same, and the legend sits just below the breakdown.
  4. Resize to a narrow screen. Verify the breakdown wraps, a new date range shows a skeleton while loading, and an empty chart has no summary.
  5. Export each dashboard as a PNG. Verify the summary is in the exported card and the browser console has no new errors.

Offline tests

  1. Load a dashboard with a summary, go offline, and reopen it. Verify the cached chart and summary still appear together.
  2. Open a cached chart from before Auth returned headline summaries. Verify that the chart still renders without a misleading comparison.
  3. In Spend, select a workspace with at least two tag levels. Load level 1, change spend in the selected date range, then load level 2. Go offline and switch back to level 1. Verify the chart stays visible without the stale headline summary.

QA Steps

  1. Follow the Tests steps on staging with Insights enabled. Verify the chart summaries and PNG exports match the selected date range and filters.

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

@OSBotify

This comment has been minimized.

@codecov

codecov Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Codecov Report

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

Files with missing lines Coverage Δ
...mponents/Charts/BarChart/StackedBarChartLegend.tsx 100.00% <100.00%> (ø)
src/components/Search/buildStackedSeries.ts 100.00% <100.00%> (ø)
src/libs/Middleware/StampInsightsResponse.ts 100.00% <100.00%> (ø)
src/libs/Middleware/register.ts 100.00% <100.00%> (ø)
src/pages/Insights/charts/InsightsChartWidget.tsx 90.79% <100.00%> (+0.60%) ⬆️
src/pages/Insights/resolveDashboardState.ts 100.00% <ø> (ø)
src/pages/Insights/useInsightsChartData.ts 73.68% <ø> (ø)
src/styles/layoutSpacing.ts 100.00% <ø> (ø)
src/pages/Insights/InsightsDashboard.tsx 91.38% <96.66%> (+2.58%) ⬆️
...rc/pages/Insights/charts/insightsHeadlineValues.ts 62.50% <62.50%> (ø)
... and 2 more
... and 7378 files with indirect coverage changes

@luacmartins luacmartins changed the title [Insights] Add summaries to the headline charts [HOLD Auth 27101] [Insights] Add summaries to the headline charts Nov 23, 2026
@luacmartins
luacmartins marked this pull request as ready for review November 23, 2026 18:33
@luacmartins
luacmartins requested review from a team as code owners November 23, 2026 18:33
@expensify-chore-bot
expensify-chore-bot Bot requested review from truph01 and removed request for a team November 23, 2026 18:34
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T18:38:50.128282Z a21f55e 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.

@expensify-chore-bot

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]

@expensify-chore-bot
expensify-chore-bot Bot requested review from JmillsExpensify and removed request for a team November 23, 2026 18:34
@luacmartins

Copy link
Copy Markdown
Contributor Author

Updated

@luacmartins luacmartins changed the title [HOLD Auth 27101] [Insights] Add summaries to the headline charts [Insights] Add summaries to the headline charts Nov 24, 2026
@luacmartins

Copy link
Copy Markdown
Contributor Author

@truph01 @aldo-expensify this should be ready for review

@github-actions

Copy link
Copy Markdown
Contributor

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

…dline-summary

# Conflicts:
#	src/pages/Insights/charts/InsightsChartWidget.tsx
@truph01

This comment was marked as resolved.

@OSBotify

This comment has been minimized.

@github-actions

This comment has been minimized.

@JmillsExpensify

Copy link
Copy Markdown
Contributor

Looking great! @dannymcclain please make sure you review for design. Then two additional comments from me:

  • Are we going to keep the Average processing time graph now that the same information is included in the headline for Workflow efficiency?
  • I wonder if we should remove all. It reads a little awkward for this case: "100% of all expenses"
CleanShot 2026-11-24 at 17 34 37@2x

@truph01

truph01 commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

@luacmartins Spend total doesn't match the chart

On Insights > Spend (This month, Previous period, VND), the headline shows ₫51,546,492,508,923 ↑ 1,703,115%. The chart below only reaches ₫7,332,923, and its tooltip says ↓ 99.8% (screenshot below):

image

@OSBotify

This comment has been minimized.

@luacmartins

Copy link
Copy Markdown
Contributor Author

Updated

@@ -106,7 +108,7 @@ function buildStackedSeries({
dateFnsLocale,
}: BuildStackedSeriesParams): SearchChartModel {

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.

❌ CONSISTENCY-18 (docs)

This line now prefers comparison[CONST.SEARCH.CHART_METRIC.DURATION] over the locally computed getStackedAverage(data, stages), but nothing explains why the backend-supplied duration should win. A future reader can't tell that this is the report-weighted range average (matching the headline summary) and that the bucket average is only a fallback for older cached responses. Add a short comment stating the reason, e.g.:

// Prefer the backend's report-weighted range average so the line matches the headline summary; older cached charts without it fall back to the bucket average.
const averageValue = isChartAverage(comparison) ? (comparison[CONST.SEARCH.CHART_METRIC.DURATION] ?? getStackedAverage(data, stages)) : undefined;

Reviewed at: 76c8f3d | Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.

@aldo-expensify

Copy link
Copy Markdown
Contributor

@luacmartins conflicts

Keep tag-level loading and reusable chart averages while matching headline summaries to their snapshots. Use one request effect for dashboard changes and Search snapshot replacements.
Reuse the chart tooltip colors for headline comparisons. Explain why the report-weighted Efficiency average takes precedence over the bucket average.
@OSBotify

This comment has been minimized.

@luacmartins

Copy link
Copy Markdown
Contributor Author

@aldo-expensify resolved

@truph01

truph01 commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

@luacmartins We have conflicts again

@JmillsExpensify

Copy link
Copy Markdown
Contributor

Let's try to get this PR merged today.

@aldo-expensify

Copy link
Copy Markdown
Contributor

@truph01 the conflicts are only in a test file, I think you can still do your full review and leave that ready

@truph01

truph01 commented Dec 1, 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
Screen.Recording.2026-12-01.at.23.44.06.mov
Screen.Recording.2026-12-01.at.23.44.25.mov
iOS: mWeb Safari
MacOS: Chrome / Safari
Screen.Recording.2026-12-01.at.23.37.48.mov

@OSBotify

OSBotify commented Dec 1, 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 3e36acfd..ad0f26c3 100644
--- a/src/languages/de.ts
+++ b/src/languages/de.ts
@@ -1269,13 +1269,13 @@ const translations: TranslationDeepObject<typeof en> = {
     },
     insightsPage: {
         headline: {
-            averageExpense: (amount) => `Ø ${amount}`,
-            flaggedExpenses: ({formattedCount}) => ({one: `Bei ${formattedCount} Ausgabe`, other: `Bei ${formattedCount} Ausgaben`}),
-            violationCount: ({formattedCount}) => ({one: `${formattedCount} Verstoß`, other: `${formattedCount} Verstöße`}),
-            timeToSubmit: (time) => `${time} bis zur Einreichung`,
-            timeToApprove: (time) => `${time} bis zur Genehmigung`,
-            timeToPay: (time) => `${time} bis zur Zahlung`,
-            vsPreviousPeriod: (change) => `${change} gegenüber dem vorherigen Zeitraum`,
+            averageExpense: (amount: string) => `${amount} Durchschnitt`,
+            flaggedExpenses: ({formattedCount}: {count: number; formattedCount: string}) => ({one: `Auf ${formattedCount} Ausgabe`, other: `Auf ${formattedCount} Ausgaben`}),
+            violationCount: ({formattedCount}: {count: number; formattedCount: string}) => ({one: `${formattedCount} Verstoß`, other: `${formattedCount} Verstöße`}),
+            timeToSubmit: (time: string) => `${time} bis zur Einreichung`,
+            timeToApprove: (time: string) => `${time} bis zur Genehmigung`,
+            timeToPay: (time: string) => `${time} bis zur Zahlung`,
+            vsPreviousPeriod: (change: string) => `${change} vs vorheriger Zeitraum`,
         },
         tagLevel: (level: string) => `Tag-Stufe ${level}`,
         noTaggedExpenses: 'Keine Ausgaben mit Tags',
diff --git a/src/languages/el.ts b/src/languages/el.ts
index fc095847..4ad3ed9d 100644
--- a/src/languages/el.ts
+++ b/src/languages/el.ts
@@ -1315,13 +1315,13 @@ const translations: TranslationDeepObject<typeof en> = {
     },
     insightsPage: {
         headline: {
-            averageExpense: (amount) => `${amount} κατά μέσο όρο`,
-            flaggedExpenses: ({formattedCount}) => ({one: `Σε ${formattedCount} έξοδο`, other: `Σε ${formattedCount} έξοδα`}),
-            violationCount: ({formattedCount}) => ({one: `${formattedCount} παράβαση`, other: `${formattedCount} παραβάσεις`}),
-            timeToSubmit: (time) => `${time} μέχρι την υποβολή`,
-            timeToApprove: (time) => `${time} μέχρι την έγκριση`,
-            timeToPay: (time) => `${time} μέχρι την πληρωμή`,
-            vsPreviousPeriod: (change) => `${change} σε σχέση με την προηγούμενη περίοδο`,
+            averageExpense: (amount: string) => `μέσος όρος ${amount}`,
+            flaggedExpenses: ({formattedCount}: {count: number; formattedCount: string}) => ({one: `Σε ${formattedCount} δαπάνη`, other: `Σε ${formattedCount} δαπάνες`}),
+            violationCount: ({formattedCount}: {count: number; formattedCount: string}) => ({one: `${formattedCount} παράβαση`, other: `${formattedCount} παραβάσεις`}),
+            timeToSubmit: (time: string) => `${time} για αποστολή`,
+            timeToApprove: (time: string) => `${time} για έγκριση`,
+            timeToPay: (time: string) => `${time} μέχρι την πληρωμή`,
+            vsPreviousPeriod: (change: string) => `${change} έναντι προηγούμενης περιόδου`,
         },
         tagLevel: (level: string) => `Επίπεδο ετικέτας ${level}`,
         noTaggedExpenses: 'Δεν υπάρχουν δαπάνες με ετικέτες',
diff --git a/src/languages/es.ts b/src/languages/es.ts
index fd274722..cb1e52fc 100644
--- a/src/languages/es.ts
+++ b/src/languages/es.ts
@@ -1263,13 +1263,13 @@ const translations: TranslationDeepObject<typeof en> = {
     },
     insightsPage: {
         headline: {
-            averageExpense: (amount) => `${amount} de media`,
-            flaggedExpenses: ({formattedCount}) => ({one: `En ${formattedCount} gasto`, other: `En ${formattedCount} gastos`}),
-            violationCount: ({formattedCount}) => ({one: `${formattedCount} infracción`, other: `${formattedCount} infracciones`}),
-            timeToSubmit: (time) => `${time} para enviar`,
-            timeToApprove: (time) => `${time} para aprobar`,
-            timeToPay: (time) => `${time} para pagar`,
-            vsPreviousPeriod: (change) => `${change} respecto al periodo anterior`,
+            averageExpense: (amount: string) => `${amount} de media`,
+            flaggedExpenses: ({formattedCount}: {count: number; formattedCount: string}) => ({one: `En ${formattedCount} gasto`, other: `En ${formattedCount} gastos`}),
+            violationCount: ({formattedCount}: {count: number; formattedCount: string}) => ({one: `${formattedCount} infracción`, other: `${formattedCount} infracciones`}),
+            timeToSubmit: (time: string) => `${time} para enviar`,
+            timeToApprove: (time: string) => `${time} para aprobar`,
+            timeToPay: (time: string) => `${time} para pagar`,
+            vsPreviousPeriod: (change: string) => `${change} vs periodo anterior`,
         },
         tagLevel: (level: string) => `Nivel de etiqueta ${level}`,
         noTaggedExpenses: 'No hay gastos con etiquetas',
diff --git a/src/languages/fr.ts b/src/languages/fr.ts
index 81f854c4..b9454c8d 100644
--- a/src/languages/fr.ts
+++ b/src/languages/fr.ts
@@ -1273,13 +1273,13 @@ const translations: TranslationDeepObject<typeof en> = {
     },
     insightsPage: {
         headline: {
-            averageExpense: (amount) => `${amount} en moyenne`,
-            flaggedExpenses: ({formattedCount}) => ({one: `Sur ${formattedCount} dépense`, other: `Sur ${formattedCount} dépenses`}),
-            violationCount: ({formattedCount}) => ({one: `${formattedCount} infraction`, other: `${formattedCount} infractions`}),
-            timeToSubmit: (time) => `${time} pour soumettre`,
-            timeToApprove: (time) => `${time} pour approuver`,
-            timeToPay: (time) => `${time} pour payer`,
-            vsPreviousPeriod: (change) => `${change} par rapport à la période précédente`,
+            averageExpense: (amount: string) => `${amount} en moyenne`,
+            flaggedExpenses: ({formattedCount}: {count: number; formattedCount: string}) => ({one: `Sur ${formattedCount} dépense`, other: `Sur ${formattedCount} dépenses`}),
+            violationCount: ({formattedCount}: {count: number; formattedCount: string}) => ({one: `${formattedCount} infraction`, other: `${formattedCount} infractions`}),
+            timeToSubmit: (time: string) => `${time} pour soumettre`,
+            timeToApprove: (time: string) => `${time} pour approuver`,
+            timeToPay: (time: string) => `${time} pour payer`,
+            vsPreviousPeriod: (change: string) => `${change} vs période précédente`,
         },
         tagLevel: (level: string) => `Niveau de tag ${level}`,
         noTaggedExpenses: 'Aucune dépense avec un tag',
diff --git a/src/languages/it.ts b/src/languages/it.ts
index 5a5ade2a..151decad 100644
--- a/src/languages/it.ts
+++ b/src/languages/it.ts
@@ -1272,13 +1272,13 @@ const translations: TranslationDeepObject<typeof en> = {
     },
     insightsPage: {
         headline: {
-            averageExpense: (amount) => `${amount} in media`,
-            flaggedExpenses: ({formattedCount}) => ({one: `Su ${formattedCount} spesa`, other: `Su ${formattedCount} spese`}),
-            violationCount: ({formattedCount}) => ({one: `${formattedCount} violazione`, other: `${formattedCount} violazioni`}),
-            timeToSubmit: (time) => `${time} per inviare`,
-            timeToApprove: (time) => `${time} per approvare`,
-            timeToPay: (time) => `${time} per pagare`,
-            vsPreviousPeriod: (change) => `${change} rispetto al periodo precedente`,
+            averageExpense: (amount: string) => `${amount} in media`,
+            flaggedExpenses: ({formattedCount}: {count: number; formattedCount: string}) => ({one: `Su ${formattedCount} spesa`, other: `Su ${formattedCount} spese`}),
+            violationCount: ({formattedCount}: {count: number; formattedCount: string}) => ({one: `${formattedCount} violazione`, other: `${formattedCount} violazioni`}),
+            timeToSubmit: (time: string) => `${time} per inviare`,
+            timeToApprove: (time: string) => `${time} per approvare`,
+            timeToPay: (time: string) => `${time} per pagare`,
+            vsPreviousPeriod: (change: string) => `${change} rispetto al periodo precedente`,
         },
         tagLevel: (level: string) => `Livello tag ${level}`,
         noTaggedExpenses: 'Nessuna spesa con tag',
diff --git a/src/languages/ja.ts b/src/languages/ja.ts
index 784a6ed3..9e29ee05 100644
--- a/src/languages/ja.ts
+++ b/src/languages/ja.ts
@@ -1257,13 +1257,13 @@ const translations: TranslationDeepObject<typeof en> = {
     },
     insightsPage: {
         headline: {
-            averageExpense: (amount) => `平均${amount}`,
-            flaggedExpenses: ({formattedCount}) => ({one: `${formattedCount}件の経費`, other: `${formattedCount}件の経費`}),
-            violationCount: ({formattedCount}) => ({one: `${formattedCount}件の違反事項`, other: `${formattedCount}件の違反事項`}),
-            timeToSubmit: (time) => `提出まで${time}`,
-            timeToApprove: (time) => `承認まで${time}`,
-            timeToPay: (time) => `支払いまで${time}`,
-            vsPreviousPeriod: (change) => `前期間比 ${change}`,
+            averageExpense: (amount: string) => `平均 ${amount}`,
+            flaggedExpenses: ({formattedCount}: {count: number; formattedCount: string}) => ({one: `${formattedCount}件の経費で`, other: `${formattedCount}件の経費で`}),
+            violationCount: ({formattedCount}: {count: number; formattedCount: string}) => ({one: `${formattedCount} 件の違反`, other: `${formattedCount} 件の違反`}),
+            timeToSubmit: (time: string) => `提出まであと ${time}`,
+            timeToApprove: (time: string) => `承認まで${time}`,
+            timeToPay: (time: string) => `支払期日 ${time}`,
+            vsPreviousPeriod: (change: string) => `前期比 ${change}`,
         },
         tagLevel: (level: string) => `タグレベル ${level}`,
         noTaggedExpenses: 'タグが付いた経費がありません',
diff --git a/src/languages/nl.ts b/src/languages/nl.ts
index d09b9a17..0aad5c01 100644
--- a/src/languages/nl.ts
+++ b/src/languages/nl.ts
@@ -1268,13 +1268,13 @@ const translations: TranslationDeepObject<typeof en> = {
     },
     insightsPage: {
         headline: {
-            averageExpense: (amount) => `Gemiddeld ${amount}`,
-            flaggedExpenses: ({formattedCount}) => ({one: `Bij ${formattedCount} uitgave`, other: `Bij ${formattedCount} uitgaven`}),
-            violationCount: ({formattedCount}) => ({one: `${formattedCount} overtreding`, other: `${formattedCount} overtredingen`}),
-            timeToSubmit: (time) => `${time} tot indiening`,
-            timeToApprove: (time) => `${time} tot goedkeuring`,
-            timeToPay: (time) => `${time} tot betaling`,
-            vsPreviousPeriod: (change) => `${change} ten opzichte van de vorige periode`,
+            averageExpense: (amount: string) => `${amount} gemiddeld`,
+            flaggedExpenses: ({formattedCount}: {count: number; formattedCount: string}) => ({one: `Op ${formattedCount} uitgave`, other: `Op ${formattedCount} uitgaven`}),
+            violationCount: ({formattedCount}: {count: number; formattedCount: string}) => ({one: `${formattedCount} overtreding`, other: `${formattedCount} overtredingen`}),
+            timeToSubmit: (time: string) => `${time} om in te dienen`,
+            timeToApprove: (time: string) => `${time} om goed te keuren`,
+            timeToPay: (time: string) => `${time} om te betalen`,
+            vsPreviousPeriod: (change: string) => `${change} t.o.v. vorige periode`,
         },
         tagLevel: (level: string) => `Tagniveau ${level}`,
         noTaggedExpenses: 'Geen uitgaven met tags',
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index 466b0533..edea33b8 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -1300,23 +1300,13 @@ const translations: TranslationDeepObject<typeof en> = {
     },
     insightsPage: {
         headline: {
-            averageExpense: (amount) => `Średnio ${amount}`,
-            flaggedExpenses: ({formattedCount}) => ({
-                one: `W ${formattedCount} wydatku`,
-                few: `W ${formattedCount} wydatkach`,
-                many: `W ${formattedCount} wydatkach`,
-                other: `W ${formattedCount} wydatku`,
-            }),
-            violationCount: ({formattedCount}) => ({
-                one: `${formattedCount} naruszenie`,
-                few: `${formattedCount} naruszenia`,
-                many: `${formattedCount} naruszeń`,
-                other: `${formattedCount} naruszenia`,
-            }),
-            timeToSubmit: (time) => `${time} do przesłania`,
-            timeToApprove: (time) => `${time} do zatwierdzenia`,
-            timeToPay: (time) => `${time} do zapłaty`,
-            vsPreviousPeriod: (change) => `${change} względem poprzedniego okresu`,
+            averageExpense: (amount: string) => `średnio ${amount}`,
+            flaggedExpenses: ({formattedCount}: {count: number; formattedCount: string}) => ({one: `Na ${formattedCount} wydatku`, other: `Na ${formattedCount} wydatkach`}),
+            violationCount: ({formattedCount}: {count: number; formattedCount: string}) => ({one: `${formattedCount} naruszenie`, other: `${formattedCount} naruszenia`}),
+            timeToSubmit: (time: string) => `${time} na przesłanie`,
+            timeToApprove: (time: string) => `${time} do zatwierdzenia`,
+            timeToPay: (time: string) => `${time} do zapłaty`,
+            vsPreviousPeriod: (change: string) => `${change} vs poprzedni okres`,
         },
         tagLevel: (level: string) => `Poziom tagu ${level}`,
         noTaggedExpenses: 'Brak wydatków z tagami',
diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts
index 7983a9f5..649e14ba 100644
--- a/src/languages/pt-BR.ts
+++ b/src/languages/pt-BR.ts
@@ -1271,13 +1271,13 @@ const translations: TranslationDeepObject<typeof en> = {
     },
     insightsPage: {
         headline: {
-            averageExpense: (amount) => `Média de ${amount}`,
-            flaggedExpenses: ({formattedCount}) => ({one: `Em ${formattedCount} despesa`, other: `Em ${formattedCount} despesas`}),
-            violationCount: ({formattedCount}) => ({one: `${formattedCount} violação`, other: `${formattedCount} violações`}),
-            timeToSubmit: (time) => `${time} para enviar`,
-            timeToApprove: (time) => `${time} para aprovar`,
-            timeToPay: (time) => `${time} para pagar`,
-            vsPreviousPeriod: (change) => `${change} em relação ao período anterior`,
+            averageExpense: (amount: string) => `${amount} em média`,
+            flaggedExpenses: ({formattedCount}: {count: number; formattedCount: string}) => ({one: `Em ${formattedCount} despesa`, other: `Em ${formattedCount} despesas`}),
+            violationCount: ({formattedCount}: {count: number; formattedCount: string}) => ({one: `${formattedCount} violação`, other: `${formattedCount} violações`}),
+            timeToSubmit: (time: string) => `${time} para enviar`,
+            timeToApprove: (time: string) => `${time} para aprovar`,
+            timeToPay: (time: string) => `${time} para pagar`,
+            vsPreviousPeriod: (change: string) => `${change} vs período anterior`,
         },
         tagLevel: (level: string) => `Nível de tag ${level}`,
         noTaggedExpenses: 'Nenhuma despesa com tags',
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index 4d472487..1ecb7e1f 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -1227,13 +1227,13 @@ const translations: TranslationDeepObject<typeof en> = {
     },
     insightsPage: {
         headline: {
-            averageExpense: (amount) => `平均 ${amount}`,
-            flaggedExpenses: ({formattedCount}) => ({one: `涉及 ${formattedCount} 笔费用`, other: `涉及 ${formattedCount} 笔费用`}),
-            violationCount: ({formattedCount}) => ({one: `${formattedCount} 项违规`, other: `${formattedCount} 项违规`}),
-            timeToSubmit: (time) => `提交用时 ${time}`,
-            timeToApprove: (time) => `审批用时 ${time}`,
-            timeToPay: (time) => `付款用时 ${time}`,
-            vsPreviousPeriod: (change) => `较上一周期 ${change}`,
+            averageExpense: (amount: string) => `平均 ${amount}`,
+            flaggedExpenses: ({formattedCount}: {count: number; formattedCount: string}) => ({one: `在 ${formattedCount} 笔报销上`, other: `在 ${formattedCount} 笔报销中`}),
+            violationCount: ({formattedCount}: {count: number; formattedCount: string}) => ({one: `${formattedCount} 次违规`, other: `${formattedCount} 条违规记录`}),
+            timeToSubmit: (time: string) => `剩余 ${time} 可提交`,
+            timeToApprove: (time: string) => `${time} 内完成审批`,
+            timeToPay: (time: string) => `${time} 去支付`,
+            vsPreviousPeriod: (change: string) => `${change} 与上一期间对比`,
         },
         tagLevel: (level: string) => `标签级别 ${level}`,
         noTaggedExpenses: '没有带标签的费用',

Note

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

View workflow run

@luacmartins

Copy link
Copy Markdown
Contributor Author

@aldo-expensify all yours

@aldo-expensify
aldo-expensify merged commit 5a963db into main Dec 1, 2026
54 of 56 checks passed
@aldo-expensify
aldo-expensify deleted the cmartins-insights-headline-summary branch December 1, 2026 19:46
@OSBotify

OSBotify commented Dec 1, 2026

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.

@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

@OSBotify

OSBotify commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/aldo-expensify in version: 9.5.57-0 🚀

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

@MelvinBot

Copy link
Copy Markdown
Contributor

No help site update needed — the changes add summary figures to existing Insights charts without changing a documented workflow or making an existing article sentence incorrect.


view run

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