Skip to content

[Due for payment 2026-05-22] [Due for payment 2026-05-20] Chat - When editing message for second time, Create button is shown instead of Cancel button #90435

Closed

Description

@jponikarchuk

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 9.3.73-0
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #76741
Email or phone of affected tester (no customers): sdiosjdnjdsoidjiosj@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.2 / Chrome
App Component: Chat Report View

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Send the message.
  4. Resize screen to narrow (skip this step on narrow screen such as mweb and native apps).
  5. Right click on the message > Edit message.
  6. Click Send button.
  7. Right click on the message > Edit message.

Expected Result:

Cancel button will be shown on the edit composer.

Actual Result:

When editing message for the second time, Create button is shown instead of Cancel button.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Video.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @hungvu193

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on May 13, 2026
  2. melvin-bot commented on May 13, 2026

    @melvin-bot

    You have been assigned to this deploy blocker because you recently merged this PR: #76741

  3. melvin-bot commented on May 13, 2026

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  4. github-actions commented on May 13, 2026

    @github-actions
    Contributor

    👋 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:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  5. mountiny commented on May 13, 2026

    @mountiny
    Contributor

    @MelvinBot Can you investigate this bug and propose minimal fix

  6. OSBotify commented on May 13, 2026

    @OSBotify
    Contributor

    Investigation Summary

    Classification: Frontend bug
    Causing PR: #76741 - "Adapt message editing behavior based on screen size (Slack-style UX)" by @Kureev (High confidence)
    Related Issues: None

    Recommendation: REVERT

    PR #76741 introduced a significant refactor of the message editing flow, and the state management for isEditingInComposer does not correctly handle the wide-screen second-edit scenario, causing the Send/Create button to appear in place of the Cancel button.

    Assigned: @Kureev (PR author), @hungvu193 @adhorodyski @mountiny (approving reviewers) from PR #76741 only
    Labels: DeployBlockerCash kept (frontend App PR is the cause). DeployBlocker not present, no change needed.

    Details

    Evidence

    • melvin-bot automatically assigned the issue to this PR's author, confirming PR New editing mechanism for small screens #76741 is the suspected cause.
    • PR New editing mechanism for small screens #76741 is listed in the StagingDeployCash for version 9.3.73-0, which matches the version in the bug report.
    • The bug is reproducible on staging but not production, consistent with a newly merged staging PR being the cause.
    • The bug is on wide/desktop screens (Windows Chrome, MacOS Chrome/Safari) only — not on narrow/mobile.
    • The PR explicitly changed how the Cancel button is conditionally rendered based on isEditingInComposer.

    Verification

    Affected files modified by PR #76741:

    • src/pages/inbox/report/ReportActionCompose/ComposerProvider.tsx — introduced isEditingInComposer logic and didResetComposerHeight state
    • src/pages/inbox/report/ReportActionCompose/ReportActionCompose.tsx — conditionally renders ComposerEditingButtons (Cancel) vs ComposerActionMenu (Create/Send) based on isEditingInComposer
    • src/pages/inbox/report/ReportActionCompose/ComposerEditingButtons.tsx — new file, only shown when isEditingInComposer is true
    • src/pages/inbox/report/ReportActionCompose/useEditComposerToggle.ts — new file, manages edit state transitions in the composer
    • src/pages/inbox/report/ReportActionEditMessageContext.tsx — modified to track editingState as 'off' | 'editing' | 'submitted'

    Root Cause

    In ComposerProvider.tsx, isEditingInComposer is computed as:

    const isEditingInComposer =
      shouldUseNarrowLayout && editingState !== "off" && !didResetComposerHeight;

    On wide screens (desktop Chrome/Mac), shouldUseNarrowLayout is false, so isEditingInComposer is always false. In ReportActionCompose.tsx, the Cancel button row (ComposerEditingButtons) is only rendered when isEditingInComposer is true:

    {
      isEditingInComposer ? (
        <Composer.EditingButtons reportID={reportID} />
      ) : (
        <Composer.ActionMenu reportID={reportID} />
      );
    }

    This means on wide layouts the Cancel button is never shown via the main composer — intentionally, as wide layout is supposed to use inline editing in the message list. However, the PR introduced a state leak: after the first edit completes and the inline editor closes, the editingState in ReportActionEditMessageContext (which is driven by Onyx draft state) does not fully reset between the first and second edit invocation for the second right-click. As a result, on the second right-click > Edit message, the main composer ends up displaying the Send button (the ActionMenu path) rather than the Cancel button, because the inline message edit component (ReportActionItemMessageEdit) either is not rendered or does not show its own Cancel button in the second-edit scenario.

    The refactor in PR #76741 fundamentally changed how wide-screen editing state is managed — removing the per-message inline draft from driving the compose input visibility, and introducing a centralized editingState machine. The second-edit bug is a regression in this state machine where editingState becomes 'editing' in a path that renders the main composer's Send button rather than the inline Cancel button.

  7. 10 remaining items

  8. m-natarajan commented on May 13, 2026

    @m-natarajan

    Passed, Chrome / v9.3.73-3 PR:90516

    REC-20260513225314.mp4
  9. changed the title [-]Chat - When editing message for second time, Create button is shown instead of Cancel button[/-] [+][Due for payment 2026-05-20] Chat - When editing message for second time, Create button is shown instead of Cancel button[/+] on May 13, 2026
  10. melvin-bot commented on May 13, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.73-4 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2026-05-20. 🎊

    For reference, here are some details about the assignees on this issue:

    • @hungvu193 requires payment through NewDot Manual Requests
    • @chrispader does not require payment (Contractor)
  11. melvin-bot commented on May 13, 2026

    @melvin-bot

    @hungvu193 The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

  12. changed the title [-][Due for payment 2026-05-20] Chat - When editing message for second time, Create button is shown instead of Cancel button[/-] [+][Due for payment 2026-05-22] [Due for payment 2026-05-20] Chat - When editing message for second time, Create button is shown instead of Cancel button[/+] on May 15, 2026
  13. melvin-bot commented on May 15, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.74-7 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2026-05-22. 🎊

    For reference, here are some details about the assignees on this issue:

    • @hungvu193 requires payment through NewDot Manual Requests
    • @chrispader does not require payment (Contractor)
  14. melvin-bot commented on May 15, 2026

    @melvin-bot

    @hungvu193 The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

  15. melvin-bot commented on May 15, 2026

    @melvin-bot

    ⚠️ Looks like this issue was linked to a Deploy Blocker here

    If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

    If a regression has occurred and you are the assigned CM follow the instructions here.

    If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

  16. lanitochka17 commented on May 15, 2026

    @lanitochka17

    Deploy Blocker ##90841 was identified to be related to the PR ##90516 that attempted to fix this issue.

  17. melvin-bot commented on May 15, 2026

    @melvin-bot

    ⚠️ Looks like this issue was linked to a Deploy Blocker here

    If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

    If a regression has occurred and you are the assigned CM follow the instructions here.

    If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

  18. melvin-bot commented on May 16, 2026

    @melvin-bot

    ⚠️ Looks like this issue was linked to a Deploy Blocker here

    If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

    If a regression has occurred and you are the assigned CM follow the instructions here.

    If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

  19. melvin-bot commented on May 16, 2026

    @melvin-bot

    ⚠️ Looks like this issue was linked to a Deploy Blocker here

    If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

    If a regression has occurred and you are the assigned CM follow the instructions here.

    If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

  20. jponikarchuk commented on May 16, 2026

    @jponikarchuk
    Author

    Deploy Blocker #90889 was identified to be related to the PR #90516 that attempted to fix this issue.

  21. melvin-bot commented on May 16, 2026

    @melvin-bot

    ⚠️ Looks like this issue was linked to a Deploy Blocker here

    If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

    If a regression has occurred and you are the assigned CM follow the instructions here.

    If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

  22. lanitochka17 commented on May 16, 2026

    @lanitochka17

    Deploy Blocker ##90891 was identified to be related to the PR ##90516 that attempted to fix this issue

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

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2Engineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions