Skip to content

[Due for payment 2026-07-21] [Refactor] Decompose IOURequestStepAmount and narrow its Onyx subscriptions #92411

Closed

Description

@cristipaval

Problem

IOURequestStepAmount (~586 lines) opens roughly 40 Onyx subscriptions on mount, including 6–7 full-collection subscriptions (e.g. PERSONAL_DETAILS_LIST, RECENTLY_USED_CURRENCIES, TRANSACTION_DRAFT, TRANSACTION_VIOLATIONS, BETAS). This is the first interactive screen in the manual create-expense flow, so its mount cost directly impacts the ManualOpenCreateExpense metric — which has recently regressed.

Around ~21 of those subscribed values are submit-only — they're read exclusively inside navigateToNextPage / saveAmountAndCurrency (i.e. when the user taps Next), not during render. Holding them as lifetime component subscriptions means every background mutation to those keys (across all workspaces/reports) can trigger re-renders of the amount screen while the user is just typing, even though the values aren't needed until submit.

Solution

Follow the same decomposition pattern applied to MoneyRequestConfirmationList / IOURequestStepConfirmation:

  • Move submit-only subscriptions out of the render path. Extract the ~21 values used only in navigateToNextPage / saveAmountAndCurrency into a dedicated submission hook (e.g. useAmountSubmission) that owns those subscriptions, so they no longer re-render the amount input on unrelated background activity.
  • Narrow full-collection subscriptions to per-key or selector-scoped slices where possible (e.g. TRANSACTION_VIOLATIONS, TRANSACTION_DRAFT).
  • Decompose the component into focused pieces (amount input view + submission logic), reducing the 586-line monolith and shrinking the mount-time subscription surface.

Goal

Reduce the mount-time subscription count and re-render frequency of IOURequestStepAmount to improve the ManualOpenCreateExpense metric and eliminate avoidable re-renders during amount entry.

PRs

Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. changed the title [-]Decompose IOURequestStepAmount and narrow its Onyx subscriptions[/-] [+][Refactor] Decompose IOURequestStepAmount and narrow its Onyx subscriptions[/+] on Jun 2, 2026
  2. Julesssss commented on Jun 2, 2026

    @Julesssss
    Contributor

    Oh thanks for suggesting this improvement and creating the issue. Last Friday I captured a video of this page due to how slow the number input is if you edit the amount immidiately after taking the scan. I would LOVE to see improvements here!

    I edited out the part that showed my reciept upload, but this is the flow:

    • Scan a reciept
    • Immidiately edit the amount
    • Press the numbers and delete buttons
    • Feels very laggy
    SlowInput.mp4
  3. OlimpiaZurek commented on Jun 3, 2026

    @OlimpiaZurek
    Contributor

    Update:
    Prepared one big draft PR with all changes. I’m going to split it into smaller ones that are easier to review.
    Performance measurements so far (web dev) look promising:

    • Duration Diff: −285.1 ms (~22%)
    • Commit Count Diff: −11

    Just a heads up, I’ll be OOO tomorrow due to the bank holiday in Poland. I’ll continue preparing the PRs for this on Friday.

  4. OlimpiaZurek commented on Jun 5, 2026

    @OlimpiaZurek
    Contributor

    Update:

  5. 85 remaining items

  6. melvin-bot commented on Jul 16, 2026

    @melvin-bot

    @Pujan92 Still overdue 6 days?! Let's take care of this!

  7. melvin-bot commented on Jul 20, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  8. melvin-bot commented on Jul 20, 2026

    @melvin-bot

    Payment Summary

    Upwork Job

    • Reviewer: @Pujan92 owed $250 via NewDot
    • Contributor: @OlimpiaZurek does not require payment (Contractor)

    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
  9. Pujan92 commented on Jul 22, 2026

    @Pujan92
    Contributor

    @cristipaval can you plz help here with the payment amount

  10. cristipaval commented on Jul 23, 2026

    @cristipaval
    ContributorAuthor

    it looks like we have 7 PRs:

    • 2 NO QAs
    • 4 regular PRs
    • 1 closed PR

    So the total should be 2 * 125 + 4 * 250 = $1250

    Do you agree, @Pujan92?

  11. melvin-bot commented on Jul 23, 2026

    @melvin-bot

    @mallenexpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  12. mallenexpensify commented on Jul 23, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @Pujan92 due $1250 via NewDot

    Think we're good to close, comment or reopen if you disagree.

  13. twisterdotcom commented on Aug 4, 2026

    @twisterdotcom
    Contributor

    $1250 approved for @Pujan92 in Report ID: R00KnehTMFam.

    • Amount requested: $2250.00 (Amount is 1000 different from payment summary of [$1250].) I will double check this.
    • I, @twisterdotcom am not already the BZ assignee. I have approved this payment.
    Zapier Logs Run ID: 00040eee-bd01-a78e-b060-720eba979e84

    SO: https://stackoverflowteams.com/c/expensify/questions/7582

  14. twisterdotcom commented on Aug 4, 2026

    @twisterdotcom
    Contributor

    $1250 approved for @Pujan92 in Report ID: R00KnehTMFam.

    Zapier Logs Run ID: 00040eee-bbe3-acb8-97c3-528970c62b44

    SO: https://stackoverflowteams.com/c/expensify/questions/7582

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 productionDailyKSv2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions