Repository navigation
Show inline Explain link on integration sync failure messages - #96424
Conversation
Co-authored-by: Marc Glasser <marcaaron@users.noreply.github.com>
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.
|
|
All of the code checks are now green — no code fix was needed, so I didn't push anything. When you filed this request, the JS checks (ESLint, typecheck, tests, perf) were still queued/pending rather than failed. They've since all completed and passed:
The only remaining ❌ is |
|
@mkhutornyi 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] |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppandroid.movAndroid: mWeb ChromeiOS: HybridAppios.moviOS: mWeb SafariMacOS: Chrome / Safaribefore.movweb.movTest data: |
ReviewLooks good. The change faithfully mirrors the export-success path ( Details I verified
Two small things worth confirming before merge:
No blocking concerns on the code itself. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 972b02d80c
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (hasReasoning(action)) { | ||
| return ( | ||
| <ReportActionItemMessageWithExplain | ||
| message={message} |
There was a problem hiding this comment.
Strip the sync failure period before appending Explain
When an INTEGRATION_SYNC_FAILED action includes reasoning, this passes the sync-failure HTML directly into ReportActionItemMessageWithExplain. That translation already ends with a period (...workspace settings</a>., and recurrence adds another sentence), while iou.AskToExplain begins with . , so the rendered message becomes settings.. Explain or (Repeated 2 times.). Explain; strip the trailing period in this branch before appending the Explain link, as the receipt-scan-failed path does.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Good catch — done in 5a57f32.
The integrationSyncFailed translation ends with workspace settings</a>. and iou.AskToExplain begins with . , so the combined string rendered settings.. Explain. I now strip the trailing period in the hasReasoning branch, mirroring the receipt-scan-failed path:
message={message.replace(/\.\s*$/, '')}See IntegrationSyncFailedMessage.tsx:34-41.
typecheck, lint-changed, and the React Compiler compliance check all pass.
|
The only failing checks are PR Author Checklist and PR Reviewer Checklist — there's no code fix to push here. Every real CI check (tests, typecheck, ESLint, Oxfmt, build, perf, storybook, etc.) is passing. Both checklist checks fail simply because their checkboxes aren't completed yet:
Nothing to commit — these clear once the checklists are filled out. |
|
Still nothing to push here — the only two failing checks are the PR Author Checklist and PR Reviewer Checklist. All real CI checks (tests, typecheck, ESLint, Oxfmt, builds, perf, storybook, etc.) are green. These two aren't code failures, so there's no fix I can commit:
No code change is required to clear these. |
…ain link
Co-authored-by: {"message":"Not Found","documentation_url":"https://docs.github.com/rest/issues/comments#get-an-issue-comment","status":"404"} <{"message":"Not Found","documentation_url":"https://docs.github.com/rest/issues/comments#get-an-issue-comment","status":"404"}@users.noreply.github.com>
|
@thelullabyy @marcaaron One of you needs to 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] |
Regression checkOne concrete cosmetic regression, plus one interaction change worth verifying on device. No functional/navigation regressions found. 🐞 Double period before the inline "Explain" link
That suffix was designed for the export messages, which do not end in a period (e.g. So a reasoning-bearing sync-failure now renders:
i.e. a doubled period. The export path doesn't have this because its strings are period-less. This is new — before the PR these messages had no Fix options
The recurrence variant (
|
@MelvinBot Looks like you reviewd stale branch. Isn't this fixed in 5a57f32 already? |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5a57f32c98
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| // from the sync-failure message so the rendered string reads "…settings. Explain" not "…settings.. Explain". | ||
| return ( | ||
| <ReportActionItemMessageWithExplain | ||
| message={message.replace(/\.\s*$/, '')} |
There was a problem hiding this comment.
Strip punctuation after repeated sync failures
When an integration sync failure has both reasoning and recurrenceCount > 1, getIntegrationSyncFailedMessage() appends the recurrence suffix, e.g. (Repeated 2 times.), so the string ends with ) and this regex leaves the period inside the suffix intact. ReportActionItemMessageWithExplain then appends AskToExplain, whose translations start with sentence punctuation, yielding user-visible copy like ...(Repeated 2 times.). Explain; handle the recurrence suffix or append the Explain link before it so repeated failures do not render the extra terminator.
Useful? React with 👍 / 👎.
|
You're right, and thanks for the catch — the double period is already fixed in The fix at One small leftover, only for the recurrence variant (separate from the double period, and the same thing the automated reviewer flagged on the new commit): when |
|
@marcaaron please help complete author checklist with QA Steps. I don't have permission to request Melvin. |
|
@MelvinBot Please un-assign me from this PR |
|
Done — I removed you from this PR. You were listed as a requested reviewer (not an assignee), so I removed your review request. |
|
I'm not sure this can easily be QA'd we need a failing export which is not so easy to produce. |
|
@mkhutornyi 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] |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 yuwenmemon has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/yuwenmemon in version: 9.4.41-0 🚀
|
|
🤖 Help site review: no changes required I reviewed the changes in this PR against Expensify's help site files under Why: This is an internal UI-parity bug fix. It makes the inline Explain link appear on hover for integration sync‑failure messages (NetSuite/QBO), matching the behavior already present on the export‑success path — the right‑click "Explain" entry was already available for these messages. It does not add a new user-facing feature or change any documented workflow, setting, integration behavior, pricing, or label. What I checked
@marcaaron, no help site PR was created since no documentation changes are needed here. If you believe the Explain affordance itself should be documented as a standalone help article (separate from this fix), let me know and I can draft one. |
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.4.41-4 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
Export/sync failure system messages (e.g.
failed to export this report to NetSuite ("NS0196 Sync Error: …")) exposed the right-click "Explain" option but not the inline "Explain" link on hover. The right-click entry is gated onhasReasoning(reportAction), while the inline link only renders when the action's render component wraps its message inReportActionItemMessageWithExplain. TheINTEGRATION_SYNC_FAILEDfailure path routed throughIntegrationSyncFailedMessage.tsx, which rendered plain muted text viaReportActionItemBasicMessage+RenderHTMLand was never wired up for the inline affordance (only the success pathExportIntegrationwas, in commit281da4f7).This change makes
IntegrationSyncFailedMessagemirrorExportIntegration: whenhasReasoning(action)is true it wraps the message inReportActionItemMessageWithExplain(which appends the inline "Explain" link and wires up theexplainhandler), and otherwise falls back to the existingReportActionItemBasicMessage/RenderHTMLrendering.ActionContentRouternow passesoriginalReportthrough so the explain handler has the report context it needs. Net effect: NetSuite/QBO sync-failure messages that carry a reasoning payload now show the inline "Explain" link on hover as a first-class action, matching the export success path.Fixed Issues
$ #96422
PROPOSAL:
Tests
Offline tests
QA Steps
No QA
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, 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.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