Skip to content

[Due for payment 2026-06-02] Expense - Amount field is not focused after selecting participant when account has no workspace #90666

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.74-0
Reproducible in staging?: Yes
Reproducible in production?: N/A - new feature, doesn't exist in prod
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #87920
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:

Precondition:

  • Run Onyx.merge('betas', ['newManualExpenseFlow']); in console.
  • Account has no workspace.
  1. Go to staging.new.expensify.com
  2. Open FAB > Create expense > Manual.
  3. Select a participant.

Expected Result:

After selecting participant, Amount field will be focused.

Actual Result:

After selecting participant, Amount field is not focused.

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: @mallenexpensify

Activity

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

    @melvin-bot

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

  3. melvin-bot commented on May 14, 2026

    @melvin-bot

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

  4. github-actions commented on May 14, 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. OSBotify commented on May 14, 2026

    @OSBotify
    Contributor

    Investigation Summary

    Classification: Frontend bug
    Causing PR: #87920 - "Feat: Manual expense flow UI refactor - r3" by @ChavdaSachin (High confidence)
    Related Issues: #82586 (the issue this PR fixed)

    Recommendation: REVERT

    The PR introduced the new manual expense flow UI refactor (newManualExpenseFlow beta) and directly owns the focus logic for the Amount field. Reverting it is the cleanest path to unblock staging.

    Assigned: @ChavdaSachin (PR author), @ShridharGoel and @puneetlath (approving reviewers)
    Labels: DeployBlockerCash kept (frontend App PR is the cause). No label changes made.

    Detailed Analysis

    Evidence

    • The issue is staging-only ("new feature, doesn't exist in prod"), triggered under the newManualExpenseFlow beta.
    • melvin-bot already assigned this issue to PR Feat: Manual expense flow UI refactor - r3 #87920, which introduced the new manual expense flow UI including the ParticipantPicker inline flow and the AmountField auto-focus logic.
    • The bug reproduces on web (MacOS Chrome/Safari) only, consistent with the !canUseTouchScreen() guard that gates shouldAutoFocusAmountField in TransactionDetailsFields.tsx.

    Verification

    • PR Feat: Manual expense flow UI refactor - r3 #87920 modifies src/components/MoneyRequestConfirmationList/sections/AmountField.tsx, which is exactly the file containing the focus logic.
    • It also modifies src/pages/iou/request/step/IOURequestStepConfirmation.tsx to embed the new ParticipantPicker component inline (rather than navigating away to a separate screen).
    • The PR adds shouldAutoFocusAmountField = !canUseTouchScreen() in TransactionDetailsFields.tsx and passes it to AmountField as autoFocus.

    Root Cause

    The AmountField focus useEffect fires when didScreenTransitionEnd first becomes true on the initial RHP open. When the user selects a participant, the ParticipantPicker component is rendered inline in the same ScreenWrapper (not as a separate navigation screen). Closing the picker does not trigger a new screen transition, so didScreenTransitionEnd remains true and does not change. Because the useEffect dependency array includes didScreenTransitionEnd as a stable true value, the effect does not re-execute after the picker closes. As a result, amountInputRef.current?.focus() is never called after participant selection, leaving the Amount field unfocused.

    In the prior flow (before this PR), selecting a participant navigated to a separate screen and returning to the confirmation page would trigger a fresh screen transition — causing didScreenTransitionEnd to cycle from false back to true and re-fire the focus effect.

  6. MelvinBot commented on May 14, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    In the new manual expense flow (PR #87920), IOURequestStepConfirmation is rendered inline in the Manual tab. For users with no workspace, the ParticipantPicker auto-opens as a right-docked modal on the same page. When a participant is selected, handleParticipantsAdded closes the picker but never focuses the amount field.

    The AmountField has a focus useEffect that depends on didScreenTransitionEnd, which fires once at screen mount. Since the participant picker is a modal overlay (not a navigation event), closing it does not re-trigger the screen transition, so the focus effect never re-fires after participant selection.

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

    Add a mechanism to focus the AmountField after the participant picker closes. Specifically:

    1. In IOURequestStepConfirmation, track when a participant was just added (e.g., a state flag or ref set in handleParticipantsAdded).
    2. Pass this signal down through MoneyRequestConfirmationList → TransactionDetailsFields → AmountField.
    3. In the AmountField's focus useEffect, add this signal as a dependency so focus is triggered when the picker closes and the amount hasn't been set yet.

    The existing !canUseTouchScreen() guard at TransactionDetailsFields.tsx:161 should be respected — focus should only be applied on non-touch devices (web desktop) to avoid unwanted keyboard pop-ups on mobile.

    What alternative solutions did you explore? (Optional)

    An alternative would be to use InteractionManager.runAfterInteractions inside handleParticipantsAdded with a direct ref to the amount input. However, threading a ref from AmountField all the way up to IOURequestStepConfirmation adds coupling. Using a boolean prop/signal is cleaner and keeps the focus logic co-located in AmountField.


    Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.

  7. ChavdaSachin commented on May 14, 2026

    @ChavdaSachin
    Contributor

    NAB: only happens on beta accounts

  8. puneetlath commented on May 14, 2026

    @puneetlath
    Contributor

    Demoting.

  9. 23 remaining items

  10. melvin-bot commented on Jun 1, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  11. melvin-bot commented on Jun 1, 2026

    @melvin-bot

    Payment Summary

    Upwork Job

    BugZero Checklist (@mallenexpensify)

    • I have verified the correct assignees and roles are listed above and updated the necessary manual offers
    • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants//hired)
    • I have verified the PR was not reverted
    • I have applied any discounts due to bugs/regressions introduced by this PR
    • I have paid out the Upwork contracts or cancelled the ones that are incorrect
    • I have verified the payment summary above is correct
  12. ChavdaSachin commented on Jun 3, 2026

    @ChavdaSachin
    Contributor

    This was a regression from my own PR - #91004
    I am not due payment here.
    My payment would be handled at #82586 at the end

  13. mallenexpensify commented on Jun 4, 2026

    @mallenexpensify
    Contributor

    Payment summary deleted

  14. dukenv0307 commented on Jun 7, 2026

    @dukenv0307
    Contributor

    @mallenexpensify can you please reopen the issue to handle my payment? Thanks

  15. mallenexpensify commented on Jun 8, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @dukenv0307 due $250 via NewDot

  16. quinthar commented on Jun 13, 2026

    @quinthar
    Contributor

    Approved $250 to @dukenv0307

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.DailyKSv2Engineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions