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 2024-12-11] [$250] mWeb - Search - Top part (buttons and status) is blank when scrolling up after deleting expense #52497

Closed
3 of 8 tasks
IuliiaHerets opened this issue Nov 13, 2024 · 19 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Nov 13, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 9.0.61-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Y
Email or phone of affected tester (no customers): applausetester [email protected]
Issue reported by: Applause Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Log in with a new account.
  3. Submit 8 expenses to any user.
  4. Go to Search.
  5. Scroll to the bottom.
  6. Long tap on the expense at the bottom > Select.
  7. Tap on the dropdown > Delete expense > Delete the expense.
  8. Tap app back button to exit selection mode.
  9. Scroll up and scroll down.
  10. Long tap on another expense at the bottom > Select.
  11. Tap on the dropdown > Delete expense > Delete the expense.
  12. Tap app back button to exit selection mode.
  13. Scroll up.

Expected Result:

The top part (dropdown button, filter button, status) will be revealed when scrolling up.

Actual Result:

The top part (dropdown button, filter button, status) is blank when scrolling up after deleting expense.

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6664218_1731521926557.1731516246787_Screen_Recording_20241114_004335_Chrome.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021859209078080301034
  • Upwork Job ID: 1859209078080301034
  • Last Price Increase: 2024-11-20
  • Automatic offers:
    • mkzie2 | Contributor | 105027142
Issue OwnerCurrent Issue Owner: @mkzie2
@IuliiaHerets IuliiaHerets added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Nov 13, 2024
Copy link

melvin-bot bot commented Nov 13, 2024

Triggered auto assignment to @muttmuure (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.

@jacobkim9881
Copy link
Contributor

Proposal

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

After off select mode on mWeb at Search page with some reports(under 6 but different to screen Y size), Search type menu and status bar is hidden.

What is the root cause of that problem?

Because it has no left screen to scroll, Search menu's top stays at -26(it stays above screen) on mWeb. The reason the menu gets hidden is scrollHandler which decide menus top position. This method is added because this red part takes much space so when scroll down a user can see more report then before:

선택 영역_001

However scrollHandler doesn't act since there is no left screen to scroll. So Search menu's top keeps -26.

<Search
isSearchScreenFocused={isActiveCentralPaneRoute}
queryJSON={queryJSON}
onSearchListScroll={scrollHandler}
contentContainerStyle={!selectionMode?.isEnabled ? [styles.searchListContentContainerStyles] : undefined}
/>

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

We can make Search menu's top: 80 when it is hidden while selection mode. We can get if it's selection mode by selectionMode. While on selection mode, set it's top behind. We can get Search menu's top by topBarOffset.value.:

const [selectionMode] = useOnyx(ONYXKEYS.MOBILE_SELECTION_MODE);
const scrollOffset = useSharedValue(0);
const topBarOffset = useSharedValue<number>(variables.searchHeaderHeight);

If both condition is matched then make Search menu's top: 80. So we add this code:

         if(selectionMode && topBarOffset.value < 80) {
           topBarOffset.value = variables.searchHeaderHeight
         }          

So after off selectionMode and if the menu's top hides a bit, then the menu shows.

What alternative solutions did you explore? (Optional)

N/A

@melvin-bot melvin-bot bot added the Overdue label Nov 18, 2024
Copy link

melvin-bot bot commented Nov 19, 2024

@muttmuure Huh... This is 4 days overdue. Who can take care of this?

@muttmuure muttmuure added the External Added to denote the issue can be worked on by a contributor label Nov 20, 2024
@melvin-bot melvin-bot bot changed the title mWeb - Search - Top part (buttons and status) is blank when scrolling up after deleting expense [$250] mWeb - Search - Top part (buttons and status) is blank when scrolling up after deleting expense Nov 20, 2024
Copy link

melvin-bot bot commented Nov 20, 2024

Job added to Upwork: https://www.upwork.com/jobs/~021859209078080301034

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Nov 20, 2024
Copy link

melvin-bot bot commented Nov 20, 2024

Triggered auto assignment to Contributor-plus team member for initial proposal review - @dukenv0307 (External)

@melvin-bot melvin-bot bot removed the Overdue label Nov 20, 2024
@mkzie2
Copy link
Contributor

mkzie2 commented Nov 20, 2024

Proposal

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

The top part (dropdown button, filter button, status) is blank when scrolling up after deleting expense.

What is the root cause of that problem?

We control the topBarOffset of the top bar based on the scroll event.

const scrollHandler = useAnimatedScrollHandler({
onScroll: (event) => {
const {contentOffset, layoutMeasurement, contentSize} = event;
if (windowHeight > contentSize.height) {
return;
}
const currentOffset = contentOffset.y;
const isScrollingDown = currentOffset > scrollOffset.value;
const distanceScrolled = currentOffset - scrollOffset.value;
if (isScrollingDown && contentOffset.y > TOO_CLOSE_TO_TOP_DISTANCE) {
// eslint-disable-next-line react-compiler/react-compiler
topBarOffset.value = clamp(topBarOffset.value - distanceScrolled, variables.minimalTopBarOffset, variables.searchHeaderHeight);
} else if (!isScrollingDown && distanceScrolled < 0 && contentOffset.y layoutMeasurement.height < contentSize.height - TOO_CLOSE_TO_BOTTOM_DISTANCE) {
topBarOffset.value = withTiming(variables.searchHeaderHeight, {duration: ANIMATION_DURATION_IN_MS});

This bug happens if the top bar is hidden and the content is reduced to less than the window height after we delete the expense. In this case, the scroll event isn't triggered and the topBarOffset is still the value when the top bar is hidden.

That is how the bug happens

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

We should check if the content size is reduced to a non-scrollable, we need to update topBarOffset to variables.searchHeaderHeight. We can capture the content size is changed from onContentSizeChange event of SelectionList

  1. Introduce a new prop onContentSizeChange in BaseSelectionList and Search. Pass this event here and here

  2. Add onContentSizeChange here and update topBarOffset if the content size height is less than the window height

onContentSizeChange={(w, h) => {
    if (windowHeight <= h) {
        return;
    }
    topBarOffset.value = withTiming(variables.searchHeaderHeight, {duration: ANIMATION_DURATION_IN_MS});
}}

What alternative solutions did you explore? (Optional)

@dukenv0307
Copy link
Contributor

dukenv0307 commented Nov 22, 2024

@mkzie2's proposal LGTM

🎀👀🎀 C reviewed

Copy link

melvin-bot bot commented Nov 22, 2024

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

@dangrous
Copy link
Contributor

LGTM!

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Nov 22, 2024
Copy link

melvin-bot bot commented Nov 22, 2024

📣 @mkzie2 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Nov 25, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Dec 4, 2024
@melvin-bot melvin-bot bot changed the title [$250] mWeb - Search - Top part (buttons and status) is blank when scrolling up after deleting expense [HOLD for payment 2024-12-11] [$250] mWeb - Search - Top part (buttons and status) is blank when scrolling up after deleting expense Dec 4, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Dec 4, 2024
Copy link

melvin-bot bot commented Dec 4, 2024

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

Copy link

melvin-bot bot commented Dec 4, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.70-9 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 2024-12-11. 🎊

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

Copy link

melvin-bot bot commented Dec 4, 2024

@dukenv0307 @muttmuure @dukenv0307 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]

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Dec 10, 2024
@muttmuure
Copy link
Contributor

@dukenv0307 - $250 C
@mkzie2 - $250 C

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Dec 12, 2024
Copy link

melvin-bot bot commented Dec 16, 2024

@dangrous, @muttmuure, @dukenv0307, @mkzie2 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@JmillsExpensify
Copy link

$250 approved for @dukenv0307

@melvin-bot melvin-bot bot removed the Overdue label Dec 17, 2024
@muttmuure muttmuure reopened this Dec 17, 2024
@muttmuure
Copy link
Contributor

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

  • [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 Template
  • [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:

Do we agree 👍 or 👎

@muttmuure
Copy link
Contributor

@dukenv0307/ @mkzie2 can you complete the checklist to clear this out?

@melvin-bot melvin-bot bot added the Overdue label Dec 20, 2024
Copy link

melvin-bot bot commented Dec 23, 2024

@dangrous, @muttmuure, @dukenv0307, @mkzie2 Huh... This is 4 days overdue. Who can take care of this?

@melvin-bot melvin-bot bot removed the Overdue label Dec 23, 2024
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 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

7 participants