Repository navigation
[NoQA] [Insights] Draw Average mode baseline on Spend over time - #103989
luacmartins merged 17 commits into
Conversation
|
@MelvinBot review |
|
I found no blocking issues. The series wiring, snapshot hash, loading and offline gating, and the dashed in-progress segment all look correct. Two small fixes and one product question:
|
okay, changed
it's like that in multiple places in the app and the French translations don't even put the space before the colon, so I'm not sure about this
good question, I'll ask |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
done!
@dannymcclain @JmillsExpensify I have a few questions about some design details: what should we display for the last row in the tooltip showing the change when the amount and the average are equal? for now I made it so that we skip that row:
and what about that last row for an in-progress bucket. should we skip it, so that we don't show a positive change which may be due to the bucket having just started?
and what's the expected behavior for when we have data for the chart, but we don't have the average or previous-period snapshot (like when we only fetched it through Search and GetInsights hasn't arrived yet). I made it so that we show loading/offline/error instead of showing the chart without the second line, is that okay? Nagranie.z.ekranu.2026-10-14.o.15.28.25.mov |
I think it makes sense to just display nothing like you're doing, since there's no change to call out.
I'm not sure we should skip this one, since it might make sense to want to see "how am I doing compared to the average so far". Since the label already includes "so far", I'm inclined to just show it exactly as you have it. But if we feel like we need something extra to call out that this is in progress, maybe we could just also add "so far" to the change (i.e.
Not sure about this one... It doesn't feel great to make the data we have disappear, but obviously we can't exactly do what the user is asking here. Curious for @JmillsExpensify's take on this (and the rest above too haha) |
Agree—nothing wrong with them being on top of each other in this case, but lets always keep the main line on top 👍 |
|
Second that. |
|
Thanks! I changed the order of the series, so that the Average line sits below the main one. |
|
🚧 JmillsExpensify has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
JmillsExpensify
left a comment
There was a problem hiding this comment.
Latest PR is looking really great. Product approved.
|
@truph01 let's prioritize this when you're back online. We need to get R2 released next week. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-10-16.at.18.32.21.movAndroid: mWeb ChromeScreen.Recording.2026-10-16.at.18.34.15.moviOS: HybridAppiOS: mWeb SafariMacOS: Chrome / SafariScreen.Recording.2026-10-16.at.18.23.28.mov |
|
🚧 luacmartins has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/luacmartins in version: 9.5.14-0 🚀
|
|
🚀 Deployed to production by https://github.com/grgia in version: 9.5.14-3 🚀
Bundle Size Analysis (Sentry): |





Explanation of Change
Adds the Average compare mode to the Spend over time chart, behind the
insightsComparebeta. When Compare is set to Average, the chart draws the backend-sent average as a second line on the chart. The tooltip shows both amounts and how far the hovered bucket is above or below the average.useInsightsChartDatareads the chart's own snapshot and the one stored underaverageSnapshotHash. If the average snapshot is loading, failed or offline, the chart shows that state instead of drawing one line and adding the second later.buildChartSeriestakes an optional comparison and pairs each compared row with the plotted group that has the samekeyForListLineChartContentdraws one line per series. The area gradient and the dashed in-progress segment stay on the primary line only.VictoryTheme.colors.getComparisonColor.ChartTooltipnow takes its body as children.ChartTooltipSummarykeeps the existing amount, share and expense count.ChartTooltipComparisonshows a row for each series with a colored dot, then the change with an arrow: red for an increase, green for a decrease. The comparison text is built byformatTooltipComparison.Fixed Issues
$ #103767
PROPOSAL: N/A
Tests
insightsPageandinsightsComparebeta.Offline tests
QA Steps
No tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Nagranie.z.ekranu.2026-10-14.o.15.29.24.mov