feat: [ORTF] Auto reporting frequency#70615
Conversation
|
@Beamanator 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] |
311fca5 to
0c2c70e
Compare
|
Code looks good to me, but i believe @allroundexperts you're the C+ assigned here & @Valforte you're the internal engineer assigned here |
|
waiting on the review from @allroundexperts . Meanwhile can you merge main to fix the conflicts @TaduJR ? |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2025-10-27.at.2.16.34.AM.movAndroid: mWeb ChromeScreen.Recording.2025-10-27.at.2.05.59.AM.moviOS: HybridAppiOS: mWeb SafariScreen.Recording.2025-10-27.at.2.03.24.AM.movMacOS: Chrome / SafariScreen.Recording.2025-10-27.at.1.50.22.AM.movMacOS: DesktopScreen.Recording.2025-10-27.at.1.54.25.AM.mov |
5eb9c62 to
9c911f8
Compare
|
@Beamanator @Valforte @allroundexperts I migrated from populateOptimisticReportFormula ReportUtils to Formula according to this comment |
|
@neil-marcellini I think we should increase the Report Title input character limit. For example if I want to set Week of {report:autoreporting:start} to {report:autoreporting:end}, I can't because of the character limit. We should increase it or use TextArea for better UI experience because I can't view all the formulas in one time other than going to the end.
|
|
We would need input from @Expensify/design , can you take a look at @TaduJR last comment? |
|
Yeah. The backend has a character limit of 500. Using a text area sounds like a good idea to me too. |
|
Interesting. Not against using a text area here. I think generally a regular input is good because it lets the user know that a shorter one is better, but given we have formulas it gets very hard to use. I'm up for the change, but curious to hear what the other designers think |
|
I think I might lean towards the textarea, because:
|
|
Thanks everyone for the input here! @TaduJR please update it to a textarea then |
|
Glad we are all on the same page.
On it |
0b7c3e4 to
2ebaa3f
Compare
Done. |
|
@allroundexperts can you review and work on the checklist please? |
Codecov Report❌ Patch coverage is
... and 8 files with indirect coverage changes 🚀 New features to boost your workflow:
|
|
|
FYI the auto reporting frequency backend was working but its not working since yesterday/before yesterday. I found this when I was about to record the demo today. |
|
@TaduJR Please complete the checklist. You're missing the screen recordings. |
ed65c57 to
bac7a58
Compare
Hi, what do you mean? Can you please describe the test steps, actual and expected result? If there's a true backend problem I'll create an issue and get it fixed. |
|
@allroundexperts Merged with main. Thank you. |
|
@TaduJR Can you please complete the checklist? |
|
@TaduJR Is this expected to work in offline mode as well? Because it does not work when offline. Screen.Recording.2025-10-27.at.2.46.06.AM.mov |
@allroundexperts Yes it is expected. Did you forget to do the prerequisites that I wrote on the PR test preconditions? |
@allroundexperts Of course, Please checkout this comment |
I did those steps. It works fine when online. |
Seems fine to me. @neil-marcellini can you do a buddy check here? |
|
@allroundexperts Just to double check. You did enable the beta by returning true just after line 18 right? Lines 18 to 29 in bceff96 |
|
Hm... I did. That's why it worked in the online mode. Can you record a video of it working when offline? |
Here https://www.loom.com/share/3e8c5707a06042c182874545624ae5ec |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/Valforte in version: 9.2.44-0 🚀
|
|
🚀 Deployed to production by https://github.com/luacmartins in version: 9.2.44-5 🚀
|

Explanation of Change
This PR adds support for auto-reporting frequency formula components {report:autoreporting:start} and {report:autoreporting:end} in dynamic report titles.
Changes:
- Added getAutoReportingDates() function in Formula.ts that calculates reporting period start/end dates based on policy auto-reporting frequency configuration
- Supports all auto-reporting frequencies: Weekly, Semi-monthly (Twice a month), Monthly, and By trip
- Handles monthly offset configurations including last business day of month
- Supports custom date formatting (e.g., {report:autoreporting:start:MMMM dd, yyyy})
- Converted single-line input to auto-growing multiline TextArea for better visibility of long formulas
- Added support for viewing full formula text without horizontal scrolling
- Improved autofocus and input initialization
- Updated computeReportPart() to use ...additionalPath pattern for handling multi-level formula paths (e.g., report:autoreporting:start:format)
- Ensures consistency with other formula components like submission info
Technical Details:
Fixed Issues
$ #68961
PROPOSAL: #68961 (comment)
Tests
Prerequisites:
- Sign in to staging.expensify.com/inbox
- Open JS console and run: SSetNameValuePair('useCustomReportNamesNewExpensify', 'true');
- Reload and verify: g_account.nameValuePairs.useCustomReportNamesNewExpensify; returns 'true'
Test Case 1: Weekly Auto-reporting
Test Case 2: Semi-monthly (Twice a month) Auto-reporting
Test Case 3: Monthly Auto-reporting with Day Offset
Test Case 4: Monthly with Last Business Day
Test Case 5: Trip-based Auto-reporting
Test Case 6: Report Title Input UX
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))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.ScrollViewcomponent to make it scrollable when more elements are added to the page.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
MacOS: Desktop