You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2026-06-17] [$250] Chat - Cursor focuses at the beginning of the text after removing expense from report #90844
Version Number: 9.3.74-7 Reproducible in staging?: Yes Reproducible in production?: No If this was caught during regression testing, add the test name, ID and link from BrowserStack:#90516 Email or phone of affected tester (no customers):sdsdjoijdoisnjodis@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Mac 26.2 / Chrome App Component: Money Requests
Action Performed:
Go to staging.new.expensify.com
Go to workspace chat.
Create an empty report.
Open the report.
Send a message.
Right click on the message > Edit comment.
Click Add expense > Create expense.
Create a manual expense.
Click on the end of the message in the composer to focus it.
Click Report field.
Click Remove from report.
Expected Result:
The cursor will focus at the end of the text.
Actual Result:
The cursor focuses at the beginning of the text after removing expense from report.
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
Identify the pull request that introduced this issue and revert it.
Classification: Frontend bug Causing PR: #90516 - "Allow editing messages in Composer on narrow screens V2" by @chrispader (High confidence) Related Issues: None
Recommendation: REVERT
PR #90516 significantly rewrote the message editing flow in ReportActionItemMessageEdit.tsx and introduced new context/focus management code. The cursor-at-beginning regression is a side effect of how the refactored code handles re-focus when the "Remove from report" modal closes.
Assigned: @chrispader (PR author), @mountiny, @hungvu193 (approving reviewers) Labels: DeployBlockerCash kept (frontend App PR is the cause). No label changes made.
Detailed Analysis
Evidence
The bug is staging-only (not reproducible in production), meaning a recently merged staging PR introduced it.
The PR rewrote ReportActionItemMessageEdit.tsx extensively (110 additions / 248 deletions) and introduced new files: ReportActionEditMessageContext.tsx, useEditComposerToggle.ts, useEditMessage.ts, useActiveDraftReportAction.ts, and related context/selection management.
The bug is reproducible on MacOS: Chrome (wide layout), which is the path through ReportActionItemMessageEdit (inline editing), which is exactly what this PR touched.
Also affects: src/pages/inbox/report/ReportActionEditMessageContext.tsx (new file, 199 additions) and src/pages/inbox/report/ContextMenu/PopoverReportActionContextMenu.tsx.
Root Cause
When the user clicks "Remove from report" inside the IOURequestStepReport modal:
The context menu/modal closes.
PopoverReportActionContextMenu.performHide() calls refocusComposerAfterPreventFirstResponder('edit'), which invokes focusComposerWithDelay(editComposerRef)(true).
After a delay, input.focus() is called on the edit composer without a forcedSelectionRange. On web, a bare focus() call resets the cursor to position 0 (beginning of text).
The onSelectionChange callback fires with {start: 0, end: 0}, updating currentEditMessageSelection in ReportActionEditMessageContext to position 0.
A useEffect in ReportActionItemMessageEdit (lines 123–127) re-runs when currentEditMessageSelection changes, calling setSelectionState({start: 0, end: 0}) — placing the cursor at the beginning.
In the pre-PR version of ReportActionItemMessageEdit, the inline editing composer used a different selection management approach that did not propagate the transient focus() cursor reset back into persistent context state. The new ReportActionEditMessageContext and setCurrentEditMessageSelection mechanism introduced by PR #90516 causes the bare focus() reset to be persisted and re-applied via the useEffect.
[Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to the comment on the PR: NA
Link to the comment on the Issue:
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: NA
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
Test:
Go to staging.new.expensify.com
Go to workspace chat.
Create an empty report.
Open the report.
Send a message.
Right click on the message > Edit comment.
Click Add expense > Create expense.
Create a manual expense.
Click on the end of the message in the composer to focus it.
Click Report field.
Click Remove from report.
Verify that the cursor will focus at the end of the text.
@lorretheboy can you please accept the job below? Please reply here and tag me once you have.
If you're not sent an offer in Upwork when you're assigned to an issue, please tag me. If an Upwork job exists, please submit a proposal. https://www.upwork.com/jobs/~022061730775210142925
Activity
melvin-bot commentedon May 15, 2026
@mountiny recently merged #90516, but they are OOO right now, so I'll auto-assign someone else.
melvin-bot commentedon May 15, 2026
Triggered auto assignment to @yuwenmemon (
DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.github-actions commentedon May 15, 2026
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
melvin-bot commentedon May 15, 2026
💬 A slack conversation has been started in #expensify-open-source
OSBotify commentedon May 15, 2026
Investigation Summary
Classification: Frontend bug
Causing PR: #90516 - "Allow editing messages in Composer on narrow screens V2" by @chrispader (High confidence)
Related Issues: None
Recommendation: REVERT
PR #90516 significantly rewrote the message editing flow in
ReportActionItemMessageEdit.tsxand introduced new context/focus management code. The cursor-at-beginning regression is a side effect of how the refactored code handles re-focus when the "Remove from report" modal closes.Assigned: @chrispader (PR author), @mountiny, @hungvu193 (approving reviewers)
Labels:
DeployBlockerCashkept (frontend App PR is the cause). No label changes made.Detailed Analysis
Evidence
StagingDeployCashchecklist (item Allow editing messages in Composer on narrow screens V2 #90516).ReportActionItemMessageEdit.tsxextensively (110 additions / 248 deletions) and introduced new files:ReportActionEditMessageContext.tsx,useEditComposerToggle.ts,useEditMessage.ts,useActiveDraftReportAction.ts, and related context/selection management.ReportActionItemMessageEdit(inline editing), which is exactly what this PR touched.Verification
src/pages/inbox/report/ReportActionItemMessageEdit.tsxsrc/pages/inbox/report/ReportActionEditMessageContext.tsx(new file, 199 additions) andsrc/pages/inbox/report/ContextMenu/PopoverReportActionContextMenu.tsx.Root Cause
When the user clicks "Remove from report" inside the IOURequestStepReport modal:
PopoverReportActionContextMenu.performHide()callsrefocusComposerAfterPreventFirstResponder('edit'), which invokesfocusComposerWithDelay(editComposerRef)(true).input.focus()is called on the edit composer without aforcedSelectionRange. On web, a barefocus()call resets the cursor to position 0 (beginning of text).onSelectionChangecallback fires with{start: 0, end: 0}, updatingcurrentEditMessageSelectioninReportActionEditMessageContextto position 0.useEffectinReportActionItemMessageEdit(lines 123–127) re-runs whencurrentEditMessageSelectionchanges, callingsetSelectionState({start: 0, end: 0})— placing the cursor at the beginning.In the pre-PR version of
ReportActionItemMessageEdit, the inline editing composer used a different selection management approach that did not propagate the transientfocus()cursor reset back into persistent context state. The newReportActionEditMessageContextandsetCurrentEditMessageSelectionmechanism introduced by PR #90516 causes the barefocus()reset to be persisted and re-applied via theuseEffect.69 remaining items
melvin-bot commentedon Jun 10, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Jun 15, 2026
@mallenexpensify Huh... This is 4 days overdue. Who can take care of this?
thelullabyy commentedon Jun 15, 2026
BugZero Checklist:
[Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to the comment on the PR: NA
Link to the comment on the Issue:
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion: NA
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
Test:
Do we agree 👍 or 👎
Zapier Logs
Run ID: 00040eee-fa63-a815-90c1-bbb84bc25f14mallenexpensify commentedon Jun 17, 2026
Payment Summary
Contributor: @lorretheboy paid $250 via Upwork
Contributor+: @thelullabyy paid $250 via Upwork
@lorretheboy can you please accept the job below? Please reply here and tag me once you have.
If you're not sent an offer in Upwork when you're assigned to an issue, please tag me. If an Upwork job exists, please submit a proposal.
https://www.upwork.com/jobs/~022061730775210142925
^ Test case created. Thx
lorretheboy commentedon Jun 17, 2026
@mallenexpensify approved the offer
mallenexpensify commentedon Jun 18, 2026
@lorretheboy paid, summary updated above. Thx.