Skip to content

[Due for payment 2026-10-12] [$175] Scroll forward immediately upon click (web and mobile), without waiting for the animation #98824

Closed

Description

@MelvinBot

Problem

Following up on #96427 and PR #98515: when approving a report in the workspace chat, the view should scroll forward the moment the user clicks, rather than waiting for the animation to complete. The initial PR added a delay because the native app scrolls without animation, which felt confusing, but the desired behavior is to scroll immediately on click on both web and mobile.

Expected behavior

  • On web and mobile, scroll forward immediately upon click — done, deployed to staging (pending test/feedback).
  • Do not wait for the animation to finish before scrolling — done, deployed to staging (pending test/feedback).
  • Native gets an animated scroll to match web's behavior — remaining work.

Status

Per aimane-chnaif: immediate scroll-on-click for web and mobile is implemented and deployed to staging (please test and provide feedback). The only remaining item is giving native an animated scroll to match web's behavior.

Context

Reported in Slack.

Upwork Automation - Do Not Edit
Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. aimane-chnaif commented on Sep 24, 2026

    @aimane-chnaif
    Contributor

    @MelvinBot implement this

  2. MelvinBot commented on Sep 24, 2026

    @MelvinBot
    ContributorAuthor

    🤖 Draft PR created: Animate the action-badge forward-scroll on native to match web

    Please mark it as "Ready for review" when it is ready.

    What was left, and what I changed

    The remaining item on this issue was "native gets an animated scroll to match web's behavior." The cause is a platform-default mismatch in useReportScrollManager:

    scrollToActionBadgeTarget never passed the option, so it inherited whichever default the platform had. The instant jump was tolerable while the scroll waited on the approve/pay/submit button animation — that delay gave the user a beat to follow along. Now that #98515 fires the scroll on the very next frame after the click, native snaps to the next actionable preview with no visual continuity.

    The fix passes {animated: true} explicitly at that single call site. Web is unchanged by construction (it already defaulted to true); only native changes. Every other scrollToIndex caller keeps its existing per-platform default — in particular ReportActionItemMessageEdit's Android Chrome keyboard hack still passes {animated: false} deliberately.

    Files changed and checks run

    Files changed

    • src/hooks/useReportActionsScroll.ts — pass animated: true when scrolling to the action-badge target, with a comment on why the platform default can't be relied on here.
    • src/hooks/useReportScrollManager/types.ts — doc comment now records the follow-scroll as the second deliberate explicit-animated caller.
    • tests/unit/useReportActionsScrollTest.tsx — updated the existing assertion and added a case pinning the animated-scroll intent.

    Checks run locally

    Check Result
    npm test (6 scroll-related suites) ✅ 88 passed
    npm run typecheck ✅ passed
    npm run lint-changed ✅ passed
    npm run spell-changed ✅ passed
    npm run react-compiler-compliance-check ✅ passed
    Full npm test / npm run lint / storybook smoke ⏭️ left to CI

    One thing to confirm on device

    I did not verify this on a real device. The behavior change is native-only, and the test device available for this run was web — where the behavior is unchanged by construction, so a web run could not have validated the fix. The animation itself needs a native check: with an inverted FlashList, an animated scrollToIndex to a target that is several screens away can feel slow or land imprecisely on native in a way it does not on web. If it does, the follow-up is to cap the distance (jump instantly when the target is far off-screen, animate when it is near) rather than to revert the animation.


    Next Steps: Reply with @MelvinBot <your feedback> if you want the approach adjusted.


    view run

  3. changed the title [-]Scroll forward immediately upon click (web and mobile), without waiting for the animation[/-] [+][$175] Scroll forward immediately upon click (web and mobile), without waiting for the animation[/+] on Oct 2, 2026
  4. melvin-bot commented on Oct 2, 2026

    @melvin-bot
  5. melvin-bot commented on Oct 2, 2026

    @melvin-bot

    Triggered auto assignment to @arosiclair, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

  6. aimane-chnaif commented on Oct 2, 2026

    @aimane-chnaif
    Contributor

    @arosiclair for context: this issue was created from https://expensify.slack.com/archives/C090P2M6DBL/p1787020588645039?thread_ts=1785906243.251709&cid=C090P2M6DBL
    Can you please mark PR "ready for review" (Melvin couldn't do that) and review?

  7. jponikarchuk commented on Oct 5, 2026

    @jponikarchuk

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

  8. 8 remaining items

  9. aimane-chnaif commented on Oct 11, 2026

    @aimane-chnaif
    Contributor

    Contributor+ Checklist:

    • [Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

      Link to the comment on the PR:
      Link to the comment on the Issue:

    • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.

      Link to discussion:

    • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

    Regression Test Proposal

    Precondition:

    • Workspace A has Approvals turned on, with User B as submitter and User A as approver.
    • As User B, submit 2 separate expense reports in the workspace chat. Send a few messages after each one so only one report preview fits on screen at a time.

    Test:

    1. Log in as User A and open the workspace chat with User B.
    2. Scroll up until the oldest report preview with an Approve button is fully visible.
    3. Tap Approve on it.
    4. The chat starts scrolling right after the tap, without waiting for the approve button animation to finish. It scrolls down smoothly until the next preview with Approve is near the top of the chat.
    5. Verify that the scroll is animated and does not jump straight to the preview.

    Do we agree 👍 or 👎

  10. aimane-chnaif commented on Oct 11, 2026

    @aimane-chnaif
    Contributor

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

    This was closed as not bug - #102959 (comment)

  11. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Oct 11, 2026
  12. melvin-bot commented on Oct 11, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  13. melvin-bot commented on Oct 11, 2026

    @melvin-bot

    Payment Summary

    Resolving PRs:

    BugZero Checklist (@mallenexpensify)

    • I have confirmed assignees, roles, and Upwork contracts look correct
    • I have paid out Upwork contracts / manual NewDot requests
    • [BugZero Assignee] I have created a GH issue for creating/updating the regression test once above steps have been agreed upon
  14. mallenexpensify commented on Oct 14, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @aimane-chnaif due $250 via NewDot

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