Optimistic report name computation#65862
Conversation
Perfrormance tracking
neil-marcellini
left a comment
There was a problem hiding this comment.
Here is a partial review. I will do more later.
neil-marcellini
left a comment
There was a problem hiding this comment.
Here's another partial review
Status
Next steps:
|
Here is a spreadsheet of the date formats that are relatively useful. I'm still ensuring all of these are supported by the new backend system, but let's plan to support all these on the frontend. We can create a separate PR to support all the date formats, for now we can keep it more simple. |
neil-marcellini
left a comment
There was a problem hiding this comment.
Here's another partial review. I will continue to review the rest.
neil-marcellini
left a comment
There was a problem hiding this comment.
I have reviewed all the code now. Lots of tweaks needed. Let's really try to break this down into manageable chunks and create issues to track other pieces that we want to add in subsequent PRs.
Thanks for the hard work so far!
neil-marcellini
left a comment
There was a problem hiding this comment.
Thanks for the updates
Reviewer Checklist
Screenshots/VideosMacOS: Chrome / Safari65862-web.mp4 |
|
@sosek108 In offline mode, the Save button gets stuck loading after I click on it, so I am unable to change the formula afterwards (see end of video). Is this expected behaviour? Screen.Recording.2025-08-14.at.19.34.34.mp4 |
|
@sosek108 bump on #65862 (comment) icymi. |
I personally did not touch that button and this behaviour comes from @neil-marcellini @akinwale I suggest that we create another issue to handle that and do that in follow up PR |
neil-marcellini
left a comment
There was a problem hiding this comment.
Sweet, let's do this. Thanks for the hard work guys.
|
🚀 Deployed to staging by https://github.com/neil-marcellini in version: 9.1.97-0 🚀
|
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 9.1.97-5 🚀
|
This PR combines the functionality from three previously reverted PRs: - Expensify#65862: Initial optimistic Custom Report Names implementation - Expensify#68726: Fix for reassure performance tests - Expensify#68737: Extended transaction support for report name computation ### Key Features: - Real-time, formula-based report titles that update as expense data changes - Support for report fields: type, startdate, total, currency, policyname, created - Functions: frontpart, substr, domain for string manipulation - Optimistic updates work offline and provide visible changes without network - Transaction updates trigger report name recalculation - Performance optimized with caching and targeted updates - Beta flag controlled: authAutoReportTitle ### Implementation Details: - Formula.ts: Formula parsing and computation engine - OptimisticReportNames.ts: Main logic for report name updates - OptimisticReportNamesConnectionManager.ts: Onyx data context manager - Enhanced API middleware to process optimistic data - Performance and unit tests included 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>






Explanation of Change
This PR introduces optimistic Custom Report Names for New Expensify, enabling real-time, formula-based report titles that update as expense data changes. When a formula part can’t be computed due to missing data, the system falls back to the original formula definition to show which parts weren’t evaluated. The implementation remains compatible with Classic Expensify formulas while leveraging New Expensify’s real-time architecture and Onyx optimistic updates, providing expected visible changes even without network. This PR lays the groundwork for full computation of report formulas, to be delivered step by step in follow-up PRs.
Fixed Issues
$ #59689
PROPOSAL:
Tests
Follow QA Steps fields below
Offline tests
Before running tests ensure your account has access to BETA functionality
useCustomReportNamesNewExpensify.Force offline modeand do same steps as in QA Steps section.Report titles should be properly formated
QA Steps
Before running tests ensure your account has access to BETA functionality
useCustomReportNamesNewExpensify.The report titles should not flicker in any case. By flicker I mean that you can see the report title change value 2 times on any of described action.
Test Case 1 – All Report Fields Combined
{report:type} - {report:total} from {report:policyname} on {report:startdate}
Custom Expense Report - USD$X.XX from [WorkspaceName] on [StartDate]
Test Case 2 – Date Fields Comparison
Created {report:created} vs Started {report:startdate}
Test Case 3 – Currency and Total Display
{report:currency} {report:total} report
Test Case 4 – Substring Function
ID: {report:type|substr:0:3}-{report:total|substr:1:4}
Test Case 5 – Transaction Addition Impact
Total: {report:total} Start: {report:startdate}
Test Case 6 – Policy Name Change Impact
Report from {report:policyname}
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))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
Nagranie.z.ekranu.2025-08-11.o.15.24.45.mov
iOS: mWeb Safari
MacOS: Chrome / Safari
Nagranie.z.ekranu.2025-08-11.o.15.08.40.mov
MacOS: Desktop
Nagranie.z.ekranu.2025-08-11.o.15.19.39.mov