Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HOLD for payment 2025-01-22] Forcing re-layout on hook useViewportOffsetTop #55071

Closed
rinej opened this issue Jan 10, 2025 · 11 comments
Closed
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2

Comments

@rinej
Copy link
Contributor

rinej commented Jan 10, 2025

Background
We use useViewportOffsetTop to properly display keyboard on small device on the mobile browsers

Problem
We noticed that window.scrollTo is being called frequently in useViewportOffsetTop, even when the target scroll position has already been reached. This logic is primarily necessary for small screens when using the app in a browser, but it is triggered unnecessarily on all devices.
Calling window.scrollTo causes redundant style recalculations, which can take up to 13ms.

scrollTo

Solution
We can add an additional check to prevent window.scrollTo from being triggered when the scroll position is already at the target. This optimization will eliminate unnecessary style recalculations and improve overall performance.

Issue OwnerCurrent Issue Owner: @maddylewis
@rinej
Copy link
Contributor Author

rinej commented Jan 10, 2025

I am Tomek from Callstack, I'd like to work on that issue.
Link to the slack conversation and proposal -> https://callstack-hq.slack.com/archives/C05LX9D6E07/p1736336258693379

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 labels Jan 10, 2025
@mountiny mountiny added the Bug Something is broken. Auto assigns a BugZero manager. label Jan 10, 2025
Copy link

melvin-bot bot commented Jan 10, 2025

Triggered auto assignment to @maddylewis (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

@melvin-bot melvin-bot bot added Daily KSv2 Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 Daily KSv2 labels Jan 10, 2025
@melvin-bot melvin-bot bot changed the title Forcing re-layout on hook useViewportOffsetTop [HOLD for payment 2025-01-22] Forcing re-layout on hook useViewportOffsetTop Jan 15, 2025
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jan 15, 2025
Copy link

melvin-bot bot commented Jan 15, 2025

Reviewing label has been removed, please complete the "BugZero Checklist".

Copy link

melvin-bot bot commented Jan 15, 2025

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.85-4 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2025-01-22. 🎊

For reference, here are some details about the assignees on this issue:

  • @rinej does not require payment (Contractor)
  • @ahmedGaber93 requires payment through NewDot Manual Requests

Copy link

melvin-bot bot commented Jan 15, 2025

@ahmedGaber93 @maddylewis @ahmedGaber93 The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

@ahmedGaber93
Copy link
Contributor

ahmedGaber93 commented Jan 20, 2025

BugZero Checklist:

  • [Contributor] Classify the bug:
Bug classification

Source of bug:

  • 1a. Result of the original design (eg. a case wasn't considered)
  • 1b. Mistake during implementation
  • 1c. Backend bug
  • 1z. Other:

Where bug was reported:

  • 2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
  • 2b. Reported on staging (eg. found during regression or PR testing)
  • 2d. Reported on a PR
  • 2z. Other:

Who reported the bug:

  • 3a. Expensify user
  • 3b. Expensify employee
  • 3c. Contributor
  • 3d. QA
  • 3z. Other: callstack expert
  • [Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

    Link to comment: https://github.com/Expensify/App/pull/38755/files#r1922351096

  • [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: N/A.

  • [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.

  • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

    Link to issue:

Regression Test Proposal

Precondition:

Test:

  1. Open the app on iOS mWeb Safari
  2. Open any chat
  3. Focus on the composer to open the keyboard
  4. Open the native keyboard emoji picker
  5. Verify that the native keyboard emoji picker does not overlap the composer

Do we agree 👍 or 👎

@mountiny
Copy link
Contributor

I dont think we will need a regression test for this specific case

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jan 22, 2025
Copy link

melvin-bot bot commented Jan 22, 2025

Payment Summary

Upwork Job

  • Contributor: @rinej is from an agency-contributor and not due payment
  • Reviewer: @ahmedGaber93 owed $250 via NewDot

BugZero Checklist (@maddylewis)

  • I have verified the correct assignees and roles are listed above and updated the neccesary 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 paid out the Upwork contracts or cancelled the ones that are incorrect
  • I have verified the payment summary above is correct

@maddylewis
Copy link
Contributor

Payment summary is correct 👍

@maddylewis
Copy link
Contributor

Payment processed via NewDot / payment summary correct / closing this out as completed 👍

@JmillsExpensify
Copy link

$250 approved for @ahmedGaber93

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2
Projects
None yet
Development

No branches or pull requests

5 participants