Skip to content

[Payment due @ahmedGaber93] Draw every period that hasn't ended with a dashed line - #104075

Merged
JS00001 merged 7 commits into
Expensify:mainfrom
c3024:chaitanya/690021-dash-open-periods
Oct 21, 2026
Merged

JS00001 merged 7 commits into
Expensify:mainfrom
c3024:chaitanya/690021-dash-open-periods

Conversation

@c3024

@c3024 c3024 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

We are deprecating the year-to-date filter and replacing it with this-year, which runs through December. Unlike ytd, which always displays only one month as a dashed line, this-year can display multiple months as dashed lines.

Line charts only dashed the last segment, and only when the last point was the period in progress. Once This year runs to December 31, a future-dated expense adds a later month after the current one, which turned the whole line solid and hid that the current month is partial.

Every period that hasn't ended, the current one and any later ones, is now marked as in progress and drawn dashed, starting from the segment that leads into the first of them. Only periods that have ended get the solid line and the area fill. The current period keeps its "so far" label, later periods keep their own labels, and the hovered dot is hollow on any period that hasn't ended. Charts with no future periods look the same as before.

Fixed Issues

$ https://github.com/Expensify/Expensify/issues/690021
PROPOSAL: N/A

Tests

  1. Create an expense dated in a later month of this year.
  2. Press Cmd+D, open Beta overrides, and turn on insightsPage.
  3. Open the Insights tab and set Date to a custom range from January 1 to December 31 and Group by to Month.
  4. Verify Spend over time draws a solid line up to last month, then a dashed line through the current month and every later month.
  5. Hover the current month and verify the tooltip says "so far" and the dot is hollow.
  6. Hover the later month and verify the tooltip shows its month name and the dot is hollow.
  7. Set Date to a custom range from January 1 to the last day of last month and verify the line is fully solid.
  • Verify that no errors appear in the JS console

Offline tests

  1. Go offline.
  2. Open the Insights tab and verify Spend over time still draws the periods that haven't ended dashed.

QA Steps

Same as tests.

  • Verify that no errors appear in the JS console

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 690021-insights-offline 690021-insights-ended 690021-insights-hover-nov 690021-insights-hover-oct 690021-insights-year

Line charts now dash the current period and any later ones, such as months holding future-dated expenses, instead of only a last point that is in progress.
@codecov

codecov Bot commented Oct 15, 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/utils/getLineRuns.ts 100.00% <100.00%> (ø)
src/components/Charts/utils/index.ts 79.69% <ø> (ø)
src/components/Search/buildChartSeries.ts 100.00% <100.00%> (ø)
src/libs/SearchQueryUtils.ts 90.95% <100.00%> (-0.07%) ⬇️
src/components/Search/SearchChartView.tsx 73.91% <16.66%> (-9.02%) ⬇️
...c/components/Charts/LineChart/LineChartContent.tsx 8.19% <0.00%> (-0.28%) ⬇️
... and 8 files with indirect coverage changes

…-open-periods

# Conflicts:
#	src/components/Charts/LineChart/LineChartContent.tsx
#	src/components/Search/SearchChartView.tsx
#	src/components/Search/buildChartSeries.ts
@c3024
c3024 marked this pull request as ready for review October 20, 2026 07:39
@c3024
c3024 requested review from a team as code owners October 20, 2026 07:39
@melvin-bot
melvin-bot Bot requested review from ahmedGaber93 and removed request for a team October 20, 2026 07:39
@melvin-bot

melvin-bot Bot commented Oct 20, 2026

Copy link
Copy Markdown

@ahmedGaber93 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 a review from JmillsExpensify October 20, 2026 07:39
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 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-21T08:24:51.506510Z 551fd2c New commits
ℹ️ 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.

@melvin-bot
melvin-bot Bot removed the request for review from a team October 20, 2026 07:39

@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: f423ed567a

ℹ️ 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".

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

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@JmillsExpensify

Copy link
Copy Markdown
Contributor

Let's make sure we get involvement from the Insights team. cc @mhawryluk @OlGierd03 @luacmartins @aldo-expensify

Charts follow the query's sort order, so the line now splits wherever it switches between finished and open periods instead of dashing everything after the first open one. A group that the date filter starts partway through also counts as not started until the filter's start date.

@mhawryluk mhawryluk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

looks great!

const color = seriesItem.color ?? VictoryTheme.colors.default;
const seriesPoints = args.points[seriesItem.key] ?? [];

// A compared period has already ended, so its whole line is solid

@mhawryluk mhawryluk Oct 20, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this comment won't hold once Previous period compare mode is implemented for line charts (my PR, not merged yet). before, we only dashed the current period, so the compared period before it had always ended. with later periods dashed too, a date range entirely in the future compares against a period that can include today or be in the future as well. I think it's fine to keep the compared line solid here for now, but could you reword the comment so it doesn't say the compared period has ended? something like "Only the primary series is dashed".

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated the comment to "Only the primary series is dashed" in 35d598a. Thanks.

@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.

Tests well.

CleanShot 2026-10-20 at 11.48.48@2x.png

@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.

LGTM 🚀

point.shortLabel = shortLabel ?? label;
point.isInProgress = true;
} else if (isLaterPeriod?.(item)) {
point.isInProgress = true;

@truph01 truph01 Oct 21, 2026 •

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.

@mhawryluk

With Jan 1 → Dec 31 and Compare set to Average, hovering a later dashed month still shows the change against the average (e.g. "−95%"), even though the month only has future-dated expenses so far.

Could formatTooltipComparison skip change when dataPoint.isInProgress?

Current behavior:

Image

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

yeah, I raised this issue under the average baseline PR and we decided it's fine to show the change for in-progress buckets: #103989 (comment) cc: @dannymcclain

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.

Yeah we can get @JmillsExpensify's take here too, but my thinking was that for in-progress period, I might want to be able to see how that period is progressing against the average while it's happening. I think it could still be a useful comparison 🤷

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.

Same, I think it's fine and don't feel too strongly.

@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: e0a05ff095

ℹ️ 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".

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

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Search accepts dates without leading zeros, like 2026-1-5, and the chart compares these boundaries with padded dates as strings.
@c3024

c3024 commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

@ahmedGaber93 could you review this?

@ahmedGaber93

ahmedGaber93 commented Oct 21, 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 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 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
    • 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
    • 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 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).
  • 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-21.at.2.43.08.PM.mov
Android: mWeb Chrome
iOS: HybridApp
Screen.Recording.2026-10-21.at.2.37.31.PM.mov
iOS: mWeb Safari
Screen.Recording.2026-10-21.at.2.39.02.PM.mov
MacOS: Chrome / Safari
Screen.Recording.2026-10-21.at.1.57.51.PM.mov

@ahmedGaber93

Copy link
Copy Markdown
Contributor

It looks like there's an issue displaying the chart on Android mWeb, and I've reproduced it on staging as well. I skipped Android mWeb testing because this feature is still in beta and this PR shouldn't affect platform-specific behavior.

Screen.Recording.2026-10-21.at.2.55.19.PM.mov

@ahmedGaber93 ahmedGaber93 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!

@melvin-bot
melvin-bot Bot requested a review from JS00001 October 21, 2026 12:32
@melvin-bot melvin-bot Bot changed the title Draw every period that hasn't ended with a dashed line [Payment due @ahmedGaber93] Draw every period that hasn't ended with a dashed line Oct 21, 2026
@melvin-bot

melvin-bot Bot commented Oct 21, 2026

Copy link
Copy Markdown

🎯 @ahmedGaber93, thanks for reviewing and testing this PR! 🎉

A payment issue will be created for your review once this PR is deployed to production.
E/E issue linked to the PR - https://www.github.com/Expensify/Expensify/issues/690021.

If payment is not needed (e.g., regression PR review fix etc), react with 👎 to this comment to prevent the payment issue from being created.

@mhawryluk

Copy link
Copy Markdown
Member

It looks like there's an issue displaying the chart on Android mWeb, and I've reproduced it on staging as well. I skipped Android mWeb testing because this feature is still in beta and this PR shouldn't affect platform-specific behavior.

Screen.Recording.2026-10-21.at.2.55.19.PM.mov

I'll look into this

@mhawryluk

Copy link
Copy Markdown
Member

It looks like there's an issue displaying the chart on Android mWeb, and I've reproduced it on staging as well. I skipped Android mWeb testing because this feature is still in beta and this PR shouldn't affect platform-specific behavior.
Screen.Recording.2026-10-21.at.2.55.19.PM.mov

I'll look into this

@ahmedGaber93 I think it's an issue on some old emulators, I ran it on a newer one and it works fine

@JS00001
JS00001 merged commit 02fcdc8 into Expensify:main Oct 21, 2026
38 of 43 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🚧 JS00001 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/JS00001 in version: 9.5.16-0 🚀

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

@MelvinBot

Copy link
Copy Markdown
Contributor

No help site update needed. This PR only changes how line charts draw periods that haven't ended (dashed instead of solid), and no article under docs/articles describes line styles. The year-to-date filter that the help site documents is unchanged.


view run

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/JS00001 in version: 9.5.18-0 🚀

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

@MelvinBot

Copy link
Copy Markdown
Contributor

No help site update needed: this PR only changes how line charts draw periods that haven't ended (dashed line, hollow dot), and no article under docs/articles describes that styling, so no existing sentence is now wrong.


view run

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/grgia in version: 9.5.18-1 🚀

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

Bundle Size Analysis (Sentry):

@melvin-bot

melvin-bot Bot commented Oct 23, 2026

Copy link
Copy Markdown

🤖 Payment issue created: #104875

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