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-10-20] [$175] Pressing the Arrow Up key while viewing consecutive report previews causes a message located below the previews to enter edit mode, but the page does not automatically scroll to or focus the message being edited. #99760
Version Number: Reproducible in staging?: Needs Reproduction (Unable to reproduce) Reproducible in production?: Needs Reproductuion If this was caught during regression testing, add the test name, ID and link from BrowserStack: Email or phone of affected tester (no customers): Logs:https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by:@FitseTLT Slack conversation (hyperlinked to channel name): #Expensify bugs
Action Performed:
Preconditions
Have a workspace chat with multiple consecutive report previews.
Have a text message below the report previews.
Steps to Reproduce:
Navigate to the workspace chat.
Scroll to the area containing the consecutive report previews.
Press the Arrow Up key.
Observe the message below the report previews.
Expected Result:
The message that enters edit mode should automatically scroll into view and receive focus.
Actual Result:
A message located below the report previews enters edit mode, but the page does not auto-scroll to the message or automatically focus it.
Workaround:
Unknown
Platforms:
Select the officially supported platforms where the issue was reproduced:
Please re-state the problem that we are trying to solve in this issue.
Pressing ArrowUp in an empty composer correctly puts the newest editable text message into edit mode even when several consecutive report previews sit above it — but on desktop web the list does not auto-scroll to that message and the edit input does not get focus.
The real problem is that on desktop web there is no code that scrolls the list to a message when it enters edit mode. The scroll-into-view + focus rely entirely on the inline editor mounting:
Focus (and the browser's native scroll-into-view) fires only when ReportActionItemMessageEdit mounts (autoFocus + focusComposerWithDelay on mount).
The report actions list is a virtualizing FlashList with a finite drawDistance={1500}. When the user has scrolled up past several tall consecutive report previews, the newest text message (bottom of the list) is far outside the render window and is not mounted, so its editor never renders → no focus, no scroll.
The one edit-start scroll that would fix this is gated to mobile Chrome only, so desktop web (the affected platform) is excluded — ReportActionItemMessageEdit.tsx:445-447.
Multiple consecutive report previews matter because they are tall, which is what pushes the target message outside the render window.
What changes do you think we should make in order to solve the problem?
When a persisted action enters edit mode, trigger a scroll to that action on desktop web too, not just mobile Chrome. The narrowest change is to broaden the existing gate at ReportActionItemMessageEdit.tsx:445-447 so it also runs on web — but because the target row can be virtualized out (unmounted), the onFocus path can't be relied on. The more robust fix is to call reportScrollManager.scrollToIndex(index) right after saveReportActionDraft in ComposerWithSuggestions.tsx, with an onScrollToIndexFailed fallback (the item is unmeasured while off-screen), so the row mounts, focus lands, and the message scrolls into view.
Investigation details & evidence
Data flow of the bug
User scrolls up so tall consecutive report previews fill the viewport; the newest text message (FlashList index 0) is virtualized out (beyond drawDistance 1500).
ArrowUp in the empty composer → saveReportActionDraft for the newest editable action (correctly skipping report previews). No scroll call follows.
The message is "editing" in Onyx, but its ReportActionItem / ReportActionItemMessageEdit is not mounted.
autoFocus and the mount-time focus effect never run → no focus, and no browser-native scroll-into-view.
No desktop-web scroll-on-edit-start exists (the only one is isMobileChrome-gated) → no auto-scroll.
Why not the other scroll paths
The Concierge streamed-draft autoscroll (useReportActionsScroll.ts) only fires for useConciergeDraft, not regular edits.
The row index handed to FlashList is the true data index, so scrollToIndex(index) targets the correct row — the issue is that no scroll is called and the cell isn't mounted, not a wrong offset.
One thing to confirm during implementation: whether the target row is genuinely unmounted (virtualized out) versus mounted-but-just-below-the-fold at the scroll position in the issue video. Either way the fix is the same — issue a scroll on edit-start for web — but it determines whether onScrollToIndexFailed handling is required.
Confidence: Medium-High — strong, consistent code evidence across two independent traces; a live in-app reproduction was attempted but blocked by an unrelated dev-environment issue (the test browser rendered a blank page), so this is not yet confirmed by runtime observation.
Next Steps for Contributor+ team: To accept:@MelvinBot implement [this](https://github.com/Expensify/App/issues/99760) to create a draft PR. To refine:@MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.
Proposed amount: $500 (2x the $250 job price — assigned 2026-08-28/31, before the Sep 19 price change, so $250 applies rather than the $175 currently shown on the label)
Why the work exceeded the issue: The issue only asked for the Arrow-Up scroll/focus bug, fixed in #100432. During that PR's review I flagged a second, distinct bug — editing a message inside an expense report (or any report opened in a non-narrow RHP) incorrectly copies the text into the main composer instead of editing it inline. Design confirmed this was legit bug to be fixed (internal confirmation: #100432 (comment)) and asked for it to be fixed as a separate PR, which I did in #103350.
Regressions caused by this PR: None — the 7-day regression period for #103350 ended 2026-10-20 with no regressions reported.
[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.
Not applicable — this wasn't a regression traced to a specific prior PR. The root cause (per the accepted proposal) was a long-standing gap: desktop web never had a "scroll to message on edit-start" path (only mobile Chrome did), not something an identifiable PR broke.
Link to the comment on the PR: N/A
Link to the comment on the Issue: N/A
[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.
Not applicable — not a regression, so no Slack discussion needed.
Link to discussion: N/A
[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.
Regression Test Proposal
Precondition:
Have a workspace chat where there's a pending action awaiting the current user (e.g. a report waiting on Submit or Approve), positioned far enough up the chat history that opening the chat from the LHN scrolls/opens it to that pending action in the middle of the chat, not to the bottom.
Have 30+ more report actions after that pending-action preview, followed by an editable text message from the current user, so that message sits far enough below the render window to be virtualized out (unmounted) when the chat first opens.
Test:
On Desktop Web, open the chat from the LHN — it should load scrolled to the pending action in the middle of the chat history, with the editable message below not yet mounted.
With the composer empty, press the Up Arrow key.
Verify the app scrolls down to the editable message, the message enters edit mode, and the edit input is automatically focused.
Open an expense report (or any report shown in the RHP on a wide/desktop screen) and edit one of your own messages.
Verify the message is edited inline (in place) and its text is not copied into the main composer.
changed the title [-][$175] Pressing the Arrow Up key while viewing consecutive report previews causes a message located below the previews to enter edit mode, but the page does not automatically scroll to or focus the message being edited.[/-][+][Due for payment 2026-10-20] [$175] Pressing the Arrow Up key while viewing consecutive report previews causes a message located below the previews to enter edit mode, but the page does not automatically scroll to or focus the message being edited.[/+]on Oct 20, 2026
Activity
exfy-zapier commentedon Aug 28, 2026
This has been labelled "Needs Reproduction". Follow the steps here: https://stackoverflowteams.com/c/expensify/questions/16989
MelvinBot commentedon Aug 28, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
Pressing ArrowUp in an empty composer correctly puts the newest editable text message into edit mode even when several consecutive report previews sit above it — but on desktop web the list does not auto-scroll to that message and the edit input does not get focus.
What is the root cause of that problem?
The action selection is correct:
useLastEditableAction.ts:31skips report previews (they failcanEditReportAction) and lands on the newest text message — matching the repro.The real problem is that on desktop web there is no code that scrolls the list to a message when it enters edit mode. The scroll-into-view + focus rely entirely on the inline editor mounting:
ComposerWithSuggestions.tsx:644-649.ReportActionItemMessageEditmounts (autoFocus+focusComposerWithDelayon mount).drawDistance={1500}. When the user has scrolled up past several tall consecutive report previews, the newest text message (bottom of the list) is far outside the render window and is not mounted, so its editor never renders → no focus, no scroll.ReportActionItemMessageEdit.tsx:445-447.Multiple consecutive report previews matter because they are tall, which is what pushes the target message outside the render window.
What changes do you think we should make in order to solve the problem?
When a persisted action enters edit mode, trigger a scroll to that action on desktop web too, not just mobile Chrome. The narrowest change is to broaden the existing gate at
ReportActionItemMessageEdit.tsx:445-447so it also runs on web — but because the target row can be virtualized out (unmounted), theonFocuspath can't be relied on. The more robust fix is to callreportScrollManager.scrollToIndex(index)right aftersaveReportActionDraftinComposerWithSuggestions.tsx, with anonScrollToIndexFailedfallback (the item is unmeasured while off-screen), so the row mounts, focus lands, and the message scrolls into view.Investigation details & evidence
Data flow of the bug
drawDistance1500).saveReportActionDraftfor the newest editable action (correctly skipping report previews). No scroll call follows.ReportActionItem/ReportActionItemMessageEditis not mounted.autoFocusand the mount-time focus effect never run → no focus, and no browser-native scroll-into-view.isMobileChrome-gated) → no auto-scroll.Why not the other scroll paths
useReportActionsScroll.ts) only fires foruseConciergeDraft, not regular edits.useEditMessage.ts:58-62scrolls to index 0 only when leaving an edit, not entering.indexhanded to FlashList is the true data index, soscrollToIndex(index)targets the correct row — the issue is that no scroll is called and the cell isn't mounted, not a wrong offset.One thing to confirm during implementation: whether the target row is genuinely unmounted (virtualized out) versus mounted-but-just-below-the-fold at the scroll position in the issue video. Either way the fix is the same — issue a scroll on edit-start for web — but it determines whether
onScrollToIndexFailedhandling is required.Confidence: Medium-High — strong, consistent code evidence across two independent traces; a live in-app reproduction was attempted but blocked by an unrelated dev-environment issue (the test browser rendered a blank page), so this is not yet confirmed by runtime observation.
Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/99760)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
view run
melvin-bot commentedon Aug 28, 2026
Triggered auto assignment to Contributor-plus team member for initial proposal review - @ChavdaSachin (
External)melvin-bot commentedon Aug 28, 2026
Unable to auto-create job on Upwork. The BZ team member should create it manually for this issue.
FitseTLT commentedon Aug 28, 2026
@ChavdaSachin If u cannot reproduce it as a reporter I can take over 👍
ChavdaSachin commentedon Aug 30, 2026
Sure @FitseTLT.
Please take over.
Thanks.
FitseTLT commentedon Aug 31, 2026
@mallenexpensify U can assign me here
melvin-bot commentedon Sep 2, 2026
@ChavdaSachin Whoops! This issue is 2 days overdue. Let's get this updated quick!
32 remaining items
melvin-bot commentedon Oct 13, 2026
@FitseTLT Huh... This is 4 days overdue. Who can take care of this?
melvin-bot commentedon Oct 15, 2026
@FitseTLT 6 days overdue. This is scarier than being forced to listen to Vogon poetry!
stitesExpensify commentedon Oct 19, 2026
@FitseTLT is there anything left here?
FitseTLT commentedon Oct 19, 2026
will apply payment label tomorrow
FitseTLT commentedon Oct 20, 2026
Proposed amount: $500 (2x the $250 job price — assigned 2026-08-28/31, before the Sep 19 price change, so $250 applies rather than the $175 currently shown on the label)
Why the work exceeded the issue: The issue only asked for the Arrow-Up scroll/focus bug, fixed in #100432. During that PR's review I flagged a second, distinct bug — editing a message inside an expense report (or any report opened in a non-narrow RHP) incorrectly copies the text into the main composer instead of editing it inline. Design confirmed this was legit bug to be fixed (internal confirmation: #100432 (comment)) and asked for it to be fixed as a separate PR, which I did in #103350.
Regressions caused by this PR: None — the 7-day regression period for #103350 ended 2026-10-20 with no regressions reported.
FitseTLT commentedon Oct 20, 2026
Contributor+ 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.
Not applicable — this wasn't a regression traced to a specific prior PR. The root cause (per the accepted proposal) was a long-standing gap: desktop web never had a "scroll to message on edit-start" path (only mobile Chrome did), not something an identifiable PR broke.
Link to the comment on the PR: N/A
Link to the comment on the Issue: N/A
[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.
Not applicable — not a regression, so no Slack discussion needed.
Link to discussion: N/A
[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.
Regression Test Proposal
Precondition:
Test:
Do we agree 👍 or 👎
[-][$175] Pressing the Arrow Up key while viewing consecutive report previews causes a message located below the previews to enter edit mode, but the page does not automatically scroll to or focus the message being edited.[/-][+][Due for payment 2026-10-20] [$175] Pressing the Arrow Up key while viewing consecutive report previews causes a message located below the previews to enter edit mode, but the page does not automatically scroll to or focus the message being edited.[/+]melvin-bot commentedon Oct 20, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)mallenexpensify commentedon Oct 20, 2026
Payment Summary
Contributor+: @FitseTLT due $500 via NewDot
@stitesExpensify increasing price based on @FitseTLT 's reasoning above, comment if you disagree.
flaviadefaria commentedon Oct 23, 2026
Approved: @FitseTLT due $500 via NewDot