Skip to content

[Due for payment 2026-10-28] [$175] Web - Chat - Unsaved inline edit is discarded when closing the Concierge side panel #103036

Closed

Description

@applause-bot

If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.


Version Number: v9.5.1-9
Issue reported by: mkhutornyi (rescoped from Applause Bug ID 7276806)
App Component: Chat Report View

Precondition:

Web, with the browser window wider than 1300px. At 1300px or narrower the side panel is a modal, so you can't use the central chat while it's open.

Action Performed:

  1. Open any chat other than Concierge. The Help button is hidden in the Concierge chat.
  2. Send a message, for example hello.
  3. Click Help in the chat header. The Concierge side panel opens docked on the right, and the central chat stays usable.
  4. In the central chat, hover over hello, open the context menu and choose Edit comment.
  5. Change the text to hello world, and don't save.
  6. Click Close (the X) in the side panel header.

Expected Result:

The inline editor stays open with hello world.

Actual Result:

The editor closes and the message shows hello again, so the unsaved edit is lost.

Workaround:

Save or cancel the edit before closing the side panel.

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari

Screenshots/Videos

bug.mov
Original Applause report (intended behavior on native)

Reproducible in staging?: Yes
Reproducible in production?: Yes
Regression test: https://test-management.browserstack.com/projects/2219752/test-runs/76795563/folder/13177078/41237914/1820739544?sort=%2Bidentifier
Email or phone of affected tester (no customers): leungbratt6@gmail.com
Device used: Pixel 7 Pro/Android 17

  1. Open the Hybrid app
  2. Navigate to any chat and send a message
  3. Press the Edit button in the newly added message
  4. Empty the draft message input
  5. Navigate to a different report
  6. Return to the first report
  7. Verify that the composer is focused and edit mode is dismissed

Actual: The composer is not focused. This is intended on native: the composer only auto-focuses on return when it has text.

Bug7276806_1791081283557.focus.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Mita Rachim
Bug ID: 7276806

Upwork Automation - Do Not Edit
Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Oct 5, 2026
  2. applause-bot commented on Oct 5, 2026

    @applause-bot
    Author

    While Applause doesn't embed attachments for this bug, here are the links for quick view:
    https://platform.applause.com/services/links/v1/external/f8512b09554b9f94556affe6f4aa72a78cb4bc87b9f635de0ee334d736049f30

  3. MelvinBot commented on Oct 5, 2026

    @MelvinBot
    Contributor

    Proposal

    TL;DR: On native, this looks like intended behavior, not a regression. Native apps only auto-focus the composer on return when it has text, so the keyboard doesn't pop up. Here the composer is empty, so it isn't focused. I recommend updating the test case's expected result instead of changing code.

    What is the root cause of that problem?

    1. Opening another report clears all edit drafts in useClearReportActionDraftsOnReportChange.ts:7-13. This ends edit mode, and the composer goes back to the normal draft. That draft is empty because the message was already sent.
    2. When the report is shown again, focus requires shouldAutoFocus (ComposerWithSuggestions.tsx:366) or willBlurTextInputOnTapOutside (ComposerWithSuggestions.tsx:922-927). On native, both are false unless the composer has text, because canFocusInputOnScreenFocus/index.native.ts returns false. The code comment at line 923 says native skips this on purpose.
    3. The "edit ended" focus call in useEditComposerToggle.ts:97-100 runs while the first report is hidden. That screen's input was just blurred at ComposerWithSuggestions.tsx:893-895, so the focus call has no effect when you return.

    Emptying the draft doesn't matter. The result should be the same on native if you leave text in the edit input.

    What changes do you think we should make in order to solve the problem?

    Update the test case's expected result: "Edit mode is dismissed. The composer is focused on web and desktop, but not on native." This matches fix:67029: allow focus composer on mobile when there is a draft message, whose test steps say an empty composer is "not focused on mobile devices".

    What alternative solutions did you explore? (Optional)

    If product wants focus on native here:

    1. In useEditComposerToggle, check whether the screen is focused when editing ends. If it isn't, set a "pending focus" ref instead of calling onFocus.
    2. Add that ref to the focus condition at ComposerWithSuggestions.tsx:925, so the composer focuses when the screen is shown again.

    This fix only works if the first report stays mounted. If the report remounts, the pending focus would also need to survive the remount.

    Investigation details

    Next Steps for Contributor+ team:
    To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/103036) to create a draft PR.
    To refine: @MelvinBot <your feedback>
    To reject: Explain why you are rejecting Melvin's proposal.


    view run

  4. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Oct 5, 2026
  5. melvin-bot commented on Oct 5, 2026

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @mkhutornyi (External)

  6. changed the title [-]Threads -Composer isn't focused after empty the message navigate to another report and return[/-] [+][$175] Threads -Composer isn't focused after empty the message navigate to another report and return[/+] on Oct 5, 2026
  7. melvin-bot commented on Oct 5, 2026

    @melvin-bot
  8. melvin-bot commented on Oct 7, 2026

    @melvin-bot

    ✅ Contributor details stored successfully. Thank you for contributing to Expensify!

  9. melvin-bot commented on Oct 8, 2026

    @melvin-bot

    @mkhutornyi Whoops! This issue is 2 days overdue. Let's get this updated quick!

  10. melvin-bot commented on Oct 12, 2026

    @melvin-bot

    @mkhutornyi 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

  11. mkhutornyi commented on Oct 13, 2026

    @mkhutornyi
    Contributor

    Agree with Melvin. It's intentional composer isn't focused on mobile.

    While testing this flow, I found related bug on web.

    Precondition: web, with the browser window wider than 1300px. At 1300px or narrower the side panel is a modal, so you can't use the central chat while it's open.

    1. Open any chat other than Concierge. The Help button is hidden in the Concierge chat.
    2. Send a message, for example hello.
    3. Click Help in the chat header. The Concierge side panel opens docked on the right, and the central chat stays usable.
    4. In the central chat, hover over hello, open the context menu and choose Edit comment.
    5. Change the text to hello world, and don't save.
    6. Click Close (the X) in the side panel header.

    Expected: the inline editor stays open with hello world.
    Actual: the editor closes and the message shows hello again, so the unsaved edit is lost.

    bug.mov

    @MelvinBot update PR title and description, and propose solution

  12. 16 remaining items

  13. mkhutornyi commented on Oct 26, 2026

    @mkhutornyi
    Contributor

    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.

      Link to the comment on the PR:
      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:

    • [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:

    Web, with the browser window wider than 1300px. At 1300px or narrower the side panel is a modal, so you can't use the central chat while it's open.

    Test:

    1. Open any chat other than Concierge. The Help button is hidden in the Concierge chat.
    2. Send a message, for example hello.
    3. Click Help in the chat header. The Concierge side panel opens docked on the right, and the central chat stays usable.
    4. In the central chat, hover over hello, open the context menu and choose Edit comment.
    5. Change the text to hello world, and don't save.
    6. Click Close (the X) in the side panel header.
    7. Verify the inline editor stays open with hello world.

    Do we agree 👍 or 👎

  14. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Oct 26, 2026
  15. melvin-bot commented on Oct 27, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  16. melvin-bot commented on Oct 27, 2026

    @melvin-bot

    Payment Summary

    Resolving PRs:

    BugZero Checklist (@mallenexpensify)

    • I have confirmed assignees, roles, and Upwork contracts look correct
    • I have paid out Upwork contracts / manual NewDot requests
    • [BugZero Assignee] I have created a GH issue for creating/updating the regression test once above steps have been agreed upon
  17. mallenexpensify commented on Oct 30, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @mkhutornyi due $175 via NewDot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions