App icon indicating copy to clipboard operation
App copied to clipboard

[Due for payment 2026-11-25] [Insights polish] [R2] Stop plotting future periods and future-dated expenses on the Spend dashboard

Open JmillsExpensify opened this issue 4 weeks ago • 12 comments

Background

When the Date range ends after today, e.g. This month, This quarter, or This year, the Spend dashboard plots every period through the end of the range. Periods that haven't happened yet are drawn as $0, expenses dated in the future are plotted on their dates, and the Compare: Average line divides spend by every period, future ones included.

On Nov 3 with This month by Week:

  • Spend over time drops from $251,313.62 to $0.00 for Nov 8–14, then plots a future-dated $381.90 for Nov 15–21. The line reads as spend collapsing.
  • The $50k avg line is $251,695.52 ÷ 5 weeks, three of which haven't started.
  • An AI insight card reads Spend was 399% above average in Nov 1–7, because it compares against that same average.

This issue counts only what has happened: the Spend dashboard stops at today and shows the total of future-dated expenses in a note on Spend over time. Date ranges that end before today don't change. The average fix, and comparing the in-progress period against an average to date, are in #.

Product and design details

This year by Month, desktop, with the note on Spend over time

Image

[The same, on mobile]

Image

What counts

  • The Spend dashboard counts expenses dated through today, using the same day the Date filter uses for This month.
  • This applies to everything on the dashboard: every graph, tooltip, Share of total, both Compare options, the AI insight cards, Explain, and the Details panel opened from a graph.
  • Expenses dated after today are left out, even when the Date range includes their date.
  • Ranges that already end today or earlier, like Last 30 days or Last month, aren't affected.

Spend over time

  • The x-axis ends at the period that contains today. Later periods in the Date range aren't drawn or labeled.
  • The period containing today keeps its in-progress styling from #103089.
  • When that leaves one period, the graph draws it as a single bar.
  • Running total ends at today too.
  • With Compare: Previous period: the x-axis spans the full Date range, so the previous period's line runs through every period, e.g. Oct 1–31 with This month by Day. The current line stops at today, and nothing is drawn for it after today, not even $0.
  • The current-period Date options offer fewer Group by options, since the larger groupings leave one or two points, mostly partial, for much of the period:
Date Group by options
This week Day, Running total (no change)
This month Day, Running total (Week removed)
This quarter Week, Running total (Month removed)
This year Week, Month, Running total (Quarter removed)
  • A saved option that's no longer offered switches to the nearest one and is saved, the same way #103450 handles an option that no longer fits, e.g. Week on This month becomes Day.
  • The Last and rolling options, e.g. Last month or Last 90 days, keep the options #103450 gives them.

Average

  • Compare: Average on Spend over time counts complete periods only, per #, so periods after today never count.
  • The ranking graphs' all-item averages (#104931) don't otherwise change. They follow What counts, so each item's total stops at today.

Future-dated expenses

  • When the Date range includes expenses dated after today, Spend over time shows a note below its header and above the plot, left-aligned, in the small secondary text style: Not shown: $1,204.50 in future expenses. View.
  • The note only appears on Spend over time, but every graph on the dashboard leaves these expenses out, per What counts.
  • The amount is in the Group currency. Only expenses the person can already see on the Spend page count.
  • View opens the Spend page filtered to expenses dated after today through the end of the Date range, with the dashboard's Workspace filter, e.g. type:expense date>2026-11-03 date<2026-12-01.
  • Desktop and mobile show the note in the same place, wrapping on mobile as needed.
  • The note is hidden when there are no future-dated expenses in the range.
  • The Home Spend over time widget leaves future-dated expenses out the same way, but doesn't show the note.
Issue OwnerCurrent Issue Owner: @mallenexpensify

JmillsExpensify avatar Nov 03 '26 16:11 JmillsExpensify

With Compare: Previous period: the x-axis spans the full Date range, so the previous period's line runs through every period, e.g. Oct 1–31 with This month by Day. The current line stops at today, and nothing is drawn for it after today, not even $0.

just to confirm: previous-period line runs the whole period even if there are no expenses? we no longer want this (the previous period line goes as far as there are expenses) condition?

mhawryluk avatar Nov 04 '26 12:11 mhawryluk

Yeah, I think we should undo that too after spending more time with the data. Example to illustrate my thinking:

  • User has this month selected and previous period
  • All the filters are sticky and they come and check the graph several times a week

In this case, they'll see the data fill in as time goes on, all compared against the previous period, and then they end in the same place at the end of the month.

JmillsExpensify avatar Nov 04 '26 12:11 JmillsExpensify

makes sense, thanks

mhawryluk avatar Nov 04 '26 12:11 mhawryluk

@OlGierd03 BE PR is deployed

luacmartins avatar Nov 12 '26 15:11 luacmartins

Great! I'll open the PR for review today

OlGierd03 avatar Nov 12 '26 15:11 OlGierd03

@truph01

The solution for this issue has been :rocket: deployed to production :rocket: in version 9.5.41-2 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

  • https://github.com/Expensify/App/pull/106514

If no regressions arise, payment will be issued on 2026-11-25. :confetti_ball:

The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]

melvin-bot[bot] avatar Nov 18 '26 22:11 melvin-bot[bot]

Triggered auto assignment to @mallenexpensify (Awaiting Payment)

Payment Summary

Resolving PRs:

  • https://github.com/Expensify/App/pull/106514

  • Contributor: @mhawryluk does not require payment (Contractor)

  • Reviewer: @truph01 owed $175 via NewDot

BugZero Checklist (@mallenexpensify)

  • [ ] I have confirmed assignees, roles, and Upwork contracts look correct
  • [ ] I have paid out Upwork contracts / manual NewDot requests
  • [ ] [BugZero Assignee] I have created a GH issue for creating/updating the regression test once above steps have been agreed upon

@mallenexpensify Whoops! This issue is 2 days overdue. Let's get this updated quick!

Contributor+ Checklist:

  • [x] [Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

    Link to the comment on the PR: N/A Link to the comment on the Issue:

  • [ ] [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.

    Link to discussion:

  • [ ] [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

Regression Test Proposal

Precondition:

Test:

  1. Open Insights > Spend, set Date to This month and Group by to Day. Verify Spend over time ends at today and draws nothing, not even $0, for later days.
  2. Verify Not shown: <amount> in future expenses. View shows below the chart. Press View and verify Spend opens with expenses dated after today through the end of the month, in the dashboard's workspaces.
  3. Set Compare to Previous period and verify the previous month's line runs through the whole month while the current line stops at today.
  4. Open Group by and verify This month offers only Day, This quarter only Week and This year Week and Month. Verify Last month still offers Week.
  5. With Week selected on Last month, switch Date to This month and verify the pill shows Running total. Switch Date back to Last month and verify the pill shows Week again.
  6. Open the details of today's point and verify Top expenses leaves out expenses dated after today.
  7. Download the Spend over time CSV and verify it has no rows after today.
  8. Switch to Compliance, set Date to This year and Group by to Month. Verify Violations over time starts at the month tracking started and Violations are tracked from <date>. shows below the chart.
  9. Set Compare to Previous period and verify no compared line is drawn and the note still shows.
  10. Set Date to Last 30 days with Compare off and verify the note is hidden.
  11. Repeat steps 2 and 8 on a narrow layout and verify the notes wrap.

Do we agree 👍 or 👎

truph01 avatar Nov 30 '26 04:11 truph01

Matt's AI agent:

Prep notes for the CM. This is not a payment approval. Do not request payment until the CM posts the final amount.

Ready.

Job price: $250.

  • truph01 (C+): 100%, via NewDot

Price basis: project started before 2026-09-19 (645498): bernhardoj assigned, 2026-09-10.

Next: press Caps+Y, then pay.

Evidence
  • C+ checklist by truph01, 11 steps: comment
  • No TestRail case yet.
  • Resolving PR 106514: OlGierd03, merged 2026-11-17, approved by aldo-expensify, luacmartins, truph01. Videos: author 1/5, C+ 2/5.

PAYPREP v1

mallenexpensify avatar Nov 30 '26 04:11 mallenexpensify

Payment Summary

Contributor+: @truph01 due $250 via NewDot

mallenexpensify avatar Nov 30 '26 23:11 mallenexpensify