Skip to content

[Payment due @marufsharifi] Deprecate Year to date in favor of This year - #104074

Merged
JS00001 merged 19 commits into
Expensify:mainfrom
c3024:chaitanya/690021-deprecate-year-to-date
Nov 2, 2026
Merged

JS00001 merged 19 commits into
Expensify:mainfrom
c3024:chaitanya/690021-deprecate-year-to-date

Conversation

@c3024

@c3024 c3024 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

Year to date is deprecated in favor of This year, which covers the whole year including future-dated expenses. This removes Year to date from the date picker and switches the Insights default to this-year. year-to-date stays a valid search value, so saved searches, saved Insights filters, and links keep working. It now resolves to the whole year and is labeled This year, matching the Auth alias.

Fixed Issues

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

Tests

  1. Open Spend, then open the Date filter.
  2. Verify Year to date is no longer listed and This year is.
  3. Open Insights and verify the Date control defaults to This year and Spend over time covers January through December.
  4. Open a search with date:year-to-date and verify the chip reads This year and the results cover the whole year.
104074-pr-ytd-nov-tooltip 104074-pr-ytd-nov2025 104074-date-picker
  • Verify that no errors appear in the JS console

Offline tests

  1. Go offline.
  2. Open Insights and verify the Date control still shows This year.

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 104074-pr-ytd-nov-tooltip 104074-pr-ytd-nov2025 104074-date-picker

Removes Year to date from the date picker, switches the Insights default to this-year, and resolves and labels saved year-to-date values as This year.
@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

@c3024 c3024 changed the title [HOLD Auth 25513, App 104071] Deprecate Year to date in favor of This year [HOLD Auth 25513, App 104071, App 104075] Deprecate Year to date in favor of This year Oct 15, 2026
c3024 added 3 commits October 25, 2026 16:46
Insights comparisons compare Year to date month for month like This year, so its separate same-days-last-year comparison is removed. The anyApproval getDatePresets test no longer expects Year to date.
@JmillsExpensify

Copy link
Copy Markdown
Contributor

Given that all mentioned PRs are now merged, can we take this out of draft now and put it up for review?

@JmillsExpensify

Copy link
Copy Markdown
Contributor

Asking because we are currently seeing this in product, and we think this PR might solve this issue of plotting future periods that have no data (and thus, shouldn't be graphed). cc @mhawryluk

CleanShot_2026-10-27_at_13 10 59_2x-2026-10-27 13_36_09 917

@mhawryluk

Copy link
Copy Markdown
Member

Asking because we are currently seeing this in product, and we think this PR might solve this issue of plotting future periods that have no data (and thus, shouldn't be graphed). cc @mhawryluk

to be precise, it's the other issue that this PR fixes - the previous and current period buckets not being correctly paired up at the end (2 Novembers, 2 Decembers)

# Conflicts:
#	src/pages/Insights/insightsCompare.ts
#	tests/unit/Search/SearchUIUtilsTest.ts
@c3024 c3024 changed the title [HOLD Auth 25513, App 104071, App 104075] Deprecate Year to date in favor of This year Deprecate Year to date in favor of This year Oct 28, 2026
@c3024
c3024 marked this pull request as ready for review October 28, 2026 03:44
@c3024
c3024 requested review from a team as code owners October 28, 2026 03:44
@melvin-bot
melvin-bot Bot requested review from FitseTLT and removed request for a team October 28, 2026 03:44
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 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-31T03:25:38.557381Z f83ff47 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 commented Oct 28, 2026

Copy link
Copy Markdown

@FitseTLT 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 JmillsExpensify and removed request for a team October 28, 2026 03:44

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

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

Comment thread src/libs/SearchUIUtils.ts Resolved

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

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

Comment thread tests/unit/insightsFilterParsingTest.ts Resolved
@FitseTLT

Copy link
Copy Markdown
Contributor

Is this ready for my review?

@c3024

c3024 commented Oct 28, 2026

Copy link
Copy Markdown
Contributor Author

@FitseTLT yes, the failing check is unrelated. I merged main branch and pushed. It might succeed now.

@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: 0bc6e02b80

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

Comment thread src/libs/SearchQueryUtils.ts Resolved
@c3024

c3024 commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

@FitseTLT could you review this PR?

@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: 01973f75cd

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

Comment thread src/libs/actions/Search.ts Resolved
@c3024

c3024 commented Oct 31, 2026

Copy link
Copy Markdown
Contributor Author

@marufsharifi

Thanks, fixed both. Saved Year to date searches now open and save as This year, and a typed year-to-date query becomes this-year too. Applying the unchanged date filter keeps the selection and the loaded results, even offline.

@JmillsExpensify

Copy link
Copy Markdown
Contributor

Awesome, looks like we are ready for another review.

@JmillsExpensify

Copy link
Copy Markdown
Contributor

@marufsharifi please jump in for that review today!

@marufsharifi

Copy link
Copy Markdown
Contributor

BUG. Applying an unchanged date filter from a legacy link clears selected expenses

Steps:

  1. In the address bar, retain your local app’s origin and open:/search?q=type%3Aexpense%20date%3Ayear-to-date
  2. Wait for expenses to load.
  3. Select one expense using its checkbox.
  4. Open Date: This year.
  5. Confirm This year is checked.
  6. Without changing it, click Apply.
  7. Check the selected expense and bulk-action toolbar.

Expected result: The expense remains checked and the bulk-action toolbar remains available.

Actual Result: The checkbox clears and the bulk-action toolbar disappears.

Video_2026-11-02_15-22-46.mp4

@marufsharifi

Copy link
Copy Markdown
Contributor

@c3024, back to you. thanks.

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

Still good on my end. Just working through C+ review.

@c3024

c3024 commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor Author

@marufsharifi

Thanks. This only happens when an old year-to-date URL is opened directly, which the app no longer creates. Saved Searches already work well. When ytd url is manually typed or opened with a stale bookmark, only the first Apply clears the selection. It moves the URL to this-year, and later Applies keep the selection. IMO this edge case is not worth rewriting the URL on page load for this.

@c3024

c3024 commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

@marufsharifi, if you find anything else please raise them so I can fix them quickly and we can move this PR forward.

@marufsharifi marufsharifi 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 November 2, 2026 16:17
@melvin-bot melvin-bot Bot changed the title Deprecate Year to date in favor of This year [Payment due @marufsharifi] Deprecate Year to date in favor of This year Nov 2, 2026
@melvin-bot

melvin-bot Bot commented Nov 2, 2026

Copy link
Copy Markdown

🎯 @marufsharifi, 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.

Copy link
Copy Markdown
Contributor

@JS00001 when you're ready. Let's try to get this one merged

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

@c3024 do we want to use this as a temp fix, but work on running a migration for saved searches?

@JS00001
JS00001 merged commit a4032aa into Expensify:main Nov 2, 2026
43 of 47 checks passed
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

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

@OSBotify

OSBotify commented Nov 2, 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 Nov 2, 2026

Copy link
Copy Markdown
Contributor

@OSBotify OSBotify mentioned this pull request Nov 2, 2026
75 tasks done
@OSBotify

OSBotify commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/JS00001 in version: 9.5.28-4 🚀

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

@MelvinBot

Copy link
Copy Markdown
Contributor

Help site update needed. This PR replaced the Year to date preset with This year, but an example query in Use Search Operators to Filter and Analyze still uses it:

Spend over time (line chart)
type:expense group-by:month date:year-to-date view:line

[No QA] Docs updates for E/A#104074 Use this-year in Spend over time search example changes date:year-to-date to date:this-year in that example. It's a one-line edit.

@c3024, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR Ready for review


view run

@c3024

c3024 commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

@JS00001

Users can't save year-to-date searches anymore, and old saved year-to-date searches now open as this-year. There should be very few of these, so I think this is enough as the final fix without a separate migration. If we still want to migrate, there are two options:

  1. Client side: when an old year-to-date saved search is clicked, resave it as this-year in the background.
  2. Backend: rewrite all stored saved searches.

@OSBotify

OSBotify commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

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

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

@OSBotify

OSBotify commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/blimpich in version: 9.5.30-0 🚀

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

Bundle Size Analysis (Sentry):

@melvin-bot

melvin-bot Bot commented Nov 3, 2026

Copy link
Copy Markdown

🤖 Payment issue created: #105800

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.

8 participants