Skip to content

Message - Edited compose box is not kept in Big screens #90842

Closed

Description

@lanitochka17

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.75
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): testpayment935@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Critical User Impact
Device used: Windows 11 pro /Chrome
App Component: Chat Report View

Action Performed:

  1. Navigate to staging.new.expensify.com
  2. Open Edit message composer
  3. Navigate to another chat and come back

Expected Result:

Edit message composer box persisted

Actual Result:

Edit message composer box is discarded

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7155295_1778865776604.bandicam_2026-05-15_20-18-39-796.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @chrispader

Activity

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

    @melvin-bot

    @mountiny recently merged #76741, but they are OOO right now, so I'll auto-assign someone else.

  3. melvin-bot commented on May 15, 2026

    @melvin-bot

    Triggered auto assignment to @arosiclair (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

  4. github-actions commented on May 15, 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. melvin-bot commented on May 15, 2026

    @melvin-bot

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

  6. OSBotify commented on May 15, 2026

    @OSBotify
    Contributor

    Investigation Summary

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

    Recommendation: REVERT

    PR #76741 introduced a hook (useClearReportActionDraftsOnReportChange) that clears all report action edit drafts on mount and cleanup whenever reportIDFromRoute changes. This directly causes the edit message composer box to be discarded when navigating to another chat and returning, because the effect fires on remount/route change and wipes the draft state that powers the edit composer.

    Assigned: @Kureev (PR author), @hungvu193, @adhorodyski, @mountiny (approving reviewers)
    Labels: DeployBlockerCash kept (Frontend bug — App PR caused the issue). DeployBlocker not present, no change needed.

    Detailed Analysis

    Evidence

    • The melvin-bot comment on the issue directly links PR New editing mechanism for small screens #76741 as the recently merged PR in this area.
    • PR New editing mechanism for small screens #76741 was merged on 2026-05-12 and is in the current StagingDeployCash (9.3.75-1) checklist.
    • The bug is reproducible on staging but NOT production, consistent with a regression introduced in this staging release.
    • The PR description explicitly changes how message editing works: it adapts the behavior to use the bottom composer for editing on narrow layouts.

    Verification

    • Affected files: src/pages/inbox/report/useClearReportActionDraftsOnReportChange.ts and src/pages/inbox/ReportScreen.tsx
    • PR New editing mechanism for small screens #76741 introduces useClearReportActionDraftsOnReportChange (a new hook file created by this PR) and calls it in ReportScreen.tsx at line 104.
    • The hook calls clearAllReportActionDrafts() on mount and on cleanup whenever reportIDFromRoute changes, which runs when navigating away and back to a report.
    • PR New editing mechanism for small screens #76741 modifies both src/pages/inbox/ReportScreen.tsx and src/pages/inbox/report/ReportActionItemMessageEdit.tsx — the core files governing edit message composer behavior.

    Root Cause

    useClearReportActionDraftsOnReportChange runs clearAllReportActionDrafts() (an Onyx setCollection call that sets REPORT_ACTIONS_DRAFTS to {}) both when the effect mounts and in its cleanup function. The edit message composer state is stored as a report action draft in Onyx (COLLECTION.REPORT_ACTIONS_DRAFTS). When a user opens the edit composer, navigates to another chat, and returns, the ReportScreen remounts or reportIDFromRoute changes, triggering the effect and wiping all edit drafts — including the one for the open edit composer — before the user has a chance to submit or cancel their edit.

  7. 4 remaining items

  8. added and removed
    DeployBlockerCashThis issue or pull request should block deployment
    on May 16, 2026
  9. mountiny commented on May 16, 2026

    @mountiny
    Contributor

    Yeah I believe this is expected now, I dont really see benefit of keeping it in the edit mode for the added complexity of such solution, I would love final double check from @Expensify/design before closing

  10. chrispader commented on May 16, 2026

    @chrispader
    Contributor

    Yes, this was intentional. The current composer editing solution would be quite a lot more complex, it we want to keep the edited message open when navigating away from the report because of the following reasons:

    • We would have to scroll to the edited message when navigating to the report again
      • Potentially, when re-opening the report, we are opening a different report actions page, so this would need additional logic for pagination
      • Editing messages in threads and IOU reports would get more complex, since right now the report doesn't distinguish between a thread message being edited in the original report or in the thread

    Let's see what Design team says 🙌🏼

  11. dubielzyk-expensify commented on May 18, 2026

    @dubielzyk-expensify
    Contributor

    Agree. Yeah I seem to remember we did this by choice. Don't think it makes sense to have a bunch of potential edit composers so I think this is expected 👍

  12. shawnborton commented on May 18, 2026

    @shawnborton
    Contributor

    Yup, agree with all of that.

  13. chrispader commented on May 18, 2026

    @chrispader
    Contributor

    Awesome. @mountiny i think we can close this out then 👍🏼

  14. mountiny commented on May 18, 2026

    @mountiny
    Contributor

    🙌

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