-
Notifications
You must be signed in to change notification settings - Fork 3.5k
feat: Implement "Explain" button for report actions with Concierge reasoning #78487
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Hey, I noticed you changed If you want to automatically generate translations for other locales, an Expensify employee will have to:
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 ts-node ./scripts/generateTranslations.ts --helpTypically, you'd want to translate only what you changed by running |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements an "Explain" button in the context menu for report actions with Concierge reasoning. When users right-click or long-press on specific Concierge messages (MODIFIED_EXPENSE or AUTO_SUBMITTED actions), they can select "Explain" to create a thread with an automated user message asking for clarification.
Key Changes:
- Added
reasoningfield toOriginalMessageModifiedExpensetype to store Concierge's explanation - Created new context menu action with "Explain" button that triggers thread creation
- Implemented
explainfunction to create/navigate to thread and post localized message
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/types/onyx/OriginalMessage.ts | Adds optional reasoning field to store Concierge's explanation for expense modifications |
| src/pages/home/report/ContextMenu/ContextMenuActions.tsx | Implements new "Explain" context menu action with validation logic and unused imports |
| src/pages/home/report/ContextMenu/BaseReportActionContextMenu.tsx | Adds QuestionMark icon support for the explain action |
| src/libs/actions/Report.ts | Implements explain function and modifies navigateToAndOpenChildReport to return report ID |
| src/languages/*.ts | Adds localized translations for "explain" and "explainMessage" across 9 languages |
| src/CONST/index.ts | Adds AUTO_SUBMITTED action type constant and EXPLAIN sentry label |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
|
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
|
@samranahm is the ts check failure related to this PR? |
|
@samranahm I'm not able to test the feature following the test steps, am I missing something? Screen.Recording.2025-12-27.at.9.41.09.PM.mov |
| const isExplainableAction = [CONST.REPORT.ACTIONS.TYPE.MODIFIED_EXPENSE, CONST.REPORT.ACTIONS.TYPE.AUTO_SUBMITTED].some((actionType) => reportAction.actionName === actionType); | ||
| if (!isExplainableAction) { | ||
| return false; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is correct according to #78464 (comment)
- For this feature we need to implement an "Explain" button in the frontend for any report action that has a
reasoningfield.- This button will exist in the right-click menu for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one actually need more clarification but currently I implement this
To start it will be visible on the following report actions:
- Concierge auto-categorized something using AI
- Concierge auto-submitted a report
| // eslint-disable-next-line @typescript-eslint/no-deprecated | ||
| InteractionManager.runAfterInteractions(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we avoid wrapping with runAfterInteractions as it's deprecated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This causes the issue because the comment is posted immediately, before the thread is created and we navigates to it and it return an error.
@eh2077 We are waiting for BE PR to deployed. #78464 (comment) |
|
@eh2077 Please take a look. |
Explanation of Change
Fixed Issues
$ #78464
PROPOSAL: #78464 (comment)
Tests
Offline tests
Same as test
QA Steps
Same as test
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodhttps://expensify.enterprise.slack.com/archives/C01GTK53T8Q/p1766796781987199
STYLE.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.Uploaded videos of Android Native and MacOs Chrome, will upload remaining platform videos once BE changes deployed.
Screenshots/Videos
Android: Native
Android.Native.mp4
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS.Chrome.mp4