Skip to content

[Due for payment 2025-09-23] [HOLD #58479][$250] Animate the Submit button, for consistency with animations for Approve and Pay #55064

Closed

Description

@JmillsExpensify

Problem

We have an confusing inconsistency, in that if you Submit a report, there is no feedback and the report action button disappears on submission. Meanwhile we have animations (and feedback) for the Approve and Pay report action buttons.

Solution

Simple! Let's animate the Submit button for consistency with other report actions. More specifically, we will:

  • Animate the Submit button in the report preview
  • Animate the Submit button in the report header
  • Animate the Submit button in the search/reports page row

Again, the button animation will be consistent and apply anywhere we show the Submit button. Said animation works like in this practice.

CleanShot 2025-01-09 at 13 51 44
image (40)

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021877717460312182126
  • Upwork Job ID: 1877717460312182126
  • Last Price Increase: 2025-01-10
  • Automatic offers:
    • shubham1206agra | Reviewer | 105644638
    • allgandalf | Contributor | 105644639
Issue OwnerCurrent Issue Owner: @JmillsExpensify

Activity

  1. added
    Daily
    NewFeature
    on Jan 10, 2025
  2. melvin-bot commented on Jan 10, 2025

    @melvin-bot

    Current assignee @JmillsExpensify is eligible for the NewFeature assigner, not assigning anyone new.

  3. added
    Weekly
    Daily
    and removed
    Daily
    Weekly
    on Jan 10, 2025
  4. shubham1206agra commented on Jan 10, 2025

    @shubham1206agra
    Contributor

    Edited by proposal-police: This proposal was edited at 2025-01-10 12:45:58 UTC.

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    Animate the Submit button

    What is the root cause of that problem?

    Feature Request

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

    Note

    I am not wall-posting the entire code since it is trivial enough to be figured out.

    Animate button similar to AnimatedSettlementButton here

    Add a new state called isSubmitAnimationRunning that tracks if the animation is running or not.

    Add new function

    const startApprovedAnimation = useCallback(() => {
            setIsSubmitAnimationRunning(true);
            HapticFeedback.longPress(); // <- Not sure about this
        }, []);
    

    And modify the stopAnimation function to

    const stopAnimation = useCallback(() => {
            setIsPaidAnimationRunning(false);
            setIsApprovedAnimationRunning(false);
            setIsSubmitAnimationRunning(false);
        }, []);
    

    And modify these conditions

    const shouldShowSettlementButton = (shouldShowPayButton || shouldShowApproveButton) && !showRTERViolationMessage && !shouldShowBrokenConnectionViolation;

    to

    const shouldShowSettlementButton = (shouldShowPayButton || shouldShowApproveButton) && !showRTERViolationMessage && !shouldShowBrokenConnectionViolation && !isSubmitAnimationRunning;
    

    and

    const shouldShowSubmitButton =
    isOpenExpenseReport &&
    reimbursableSpend !== 0 &&
    !showRTERViolationMessage &&
    !shouldShowBrokenConnectionViolation &&
    (iouReport?.ownerAccountID === currentUserAccountID || isAdmin || iouReport?.managerID === currentUserAccountID);

    to

    const shouldShowSubmitButton =
            (isOpenExpenseReport &&
            reimbursableSpend !== 0 &&
            !showRTERViolationMessage &&
            !shouldShowBrokenConnectionViolation &&
            (iouReport?.ownerAccountID === currentUserAccountID || isAdmin || iouReport?.managerID === currentUserAccountID)) || isSubmitAnimationRunning;
    

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    What alternative solutions did you explore? (Optional)

  5. added
    External
    on Jan 10, 2025
  6. changed the title [-]Animate the `Submit` button, for consistency with animations for `Approve` and `Pay`[/-] [+][$250] Animate the `Submit` button, for consistency with animations for `Approve` and `Pay`[/+] on Jan 10, 2025
  7. melvin-bot commented on Jan 10, 2025

    @melvin-bot
  8. added
    Help Wanted
    on Jan 10, 2025
  9. 78 remaining items

  10. luacmartins commented on Sep 25, 2025

    @luacmartins
    Contributor

    @allgandalf did you raise a fix?

  11. melvin-bot commented on Sep 25, 2025

    @melvin-bot

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

  12. allgandalf commented on Sep 29, 2025

    @allgandalf
    Contributor

    @allgandalf did you raise a fix?

    I was out sick last week, working on this week

  13. melvin-bot commented on Sep 29, 2025

    @melvin-bot

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

  14. JmillsExpensify commented on Sep 30, 2025

    @JmillsExpensify
    ContributorAuthor

    Payment summary:

  15. JmillsExpensify commented on Sep 30, 2025

    @JmillsExpensify
    ContributorAuthor

    I don't think we need a regression test for animations, so @hoangzinh please submit via New Expensify and we're all set.

  16. moved this from Bugs and Follow Up Issues to Done in #expensify-bugson Sep 30, 2025
  17. hoangzinh commented on Oct 1, 2025

    @hoangzinh
    Contributor

    @JmillsExpensify, this issue is not ready for payment yet. We still have another follow-up issue here #70630

  18. hoangzinh commented on Oct 17, 2025

    @hoangzinh
    Contributor

    The last PR is deployed to Prod. I requested payment in ND.

  19. JmillsExpensify commented on Oct 20, 2025

    @JmillsExpensify
    ContributorAuthor

    Thanks, though don't forget the suggested regression steps.

  20. hoangzinh commented on Oct 20, 2025

    @hoangzinh
    Contributor

    Regression Test Proposal

    Precondition:

    • Go to workspace => Workflows => update "Submission frequency" to "Manually"

    Test:

    1. Submit an expense to workspace above
    2. Open expense
    3. Tap on "Submit" button
    4. Verify that the Submit button shows an animation transitioning from loading icon to "Submitted" text, then display next pending action (like approve/pay)

    Do we agree 👍 or 👎

  21. twisterdotcom commented on Oct 27, 2025

    @twisterdotcom
    Contributor

    @hoangzinh has submitted payment for this report on ND here.

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

    Zapier Logs Run ID: 00040eee-1d0f-a929-879b-bab3e9905e71
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentDailyExternalNewFeature

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions