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-11-18] [$250] [Search v2.2] - Chats - Selected chat is hidden when navigating via keyboard #48902

Closed
2 of 6 tasks
IuliiaHerets opened this issue Sep 10, 2024 · 76 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 Engineering External Added to denote the issue can be worked on by a contributor

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Sep 10, 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.31-14
Reproducible in staging?: Y
Reproducible in production?: N/A
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team

Action Performed:

Precondition:

  • Account has many chats.
  1. Go to staging.new.expensify.com
  2. Go to Search > Chats.
  3. Navigate to the bottom of the list via keyboard up button.

Expected Result:

The selected chat will be not hidden when navigating via keyboard.

Actual Result:

The selected chat is hidden when navigating via keyboard.
This issue happens with the chat at the bottom of the list.

Workaround:

Unknown

Platforms:

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6598844_1725981162147.20240910_230910.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021833559992291211111
  • Upwork Job ID: 1833559992291211111
  • Last Price Increase: 2024-10-22
  • Automatic offers:
    • rayane-djouah | Reviewer | 104633457
Issue OwnerCurrent Issue Owner: @isabelastisser
@IuliiaHerets IuliiaHerets added DeployBlockerCash This issue or pull request should block deployment Bug Something is broken. Auto assigns a BugZero manager. labels Sep 10, 2024
Copy link

melvin-bot bot commented Sep 10, 2024

Triggered auto assignment to @marcochavezf (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

Copy link

melvin-bot bot commented Sep 10, 2024

Triggered auto assignment to @isabelastisser (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 the Daily KSv2 label Sep 10, 2024
@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Sep 10, 2024
Copy link
Contributor

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

@marcochavezf
Copy link
Contributor

I don't see the Chats section in Search tab in production:

Screenshot 2024-09-10 at 11 32 05 a m

Seems this is a new feature and I don't think it should block the deploy

@marcochavezf marcochavezf added External Added to denote the issue can be worked on by a contributor Daily KSv2 and removed DeployBlockerCash This issue or pull request should block deployment Hourly KSv2 labels Sep 10, 2024
Copy link

melvin-bot bot commented Sep 10, 2024

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

@melvin-bot melvin-bot bot changed the title Search - Chats - Selected chat is hidden when navigating via keyboard [$250] Search - Chats - Selected chat is hidden when navigating via keyboard Sep 10, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 10, 2024
Copy link

melvin-bot bot commented Sep 10, 2024

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

@Nodebrute
Copy link
Contributor

@marcochavezf I am unable to reproduce this issue on latest main

Screen.Recording.2024-09-10.at.10.59.35.PM.mov

@Amoralchik
Copy link
Contributor

Amoralchik commented Sep 10, 2024

Edited by proposal-police: This proposal was edited at 2024-09-10 21:07:46 UTC.

Proposal

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

The element selected using the keyboard is outside the visible area.

What is the root cause of that problem?

In useArrowKeyFocusManager, for the up and down arrows, we call the scrollToIndex function within onFocusedIndexChange, which scrolls to the selected element.

const [focusedIndex, setFocusedIndex] = useArrowKeyFocusManager({
initialFocusedIndex: flattenedSections.allOptions.findIndex((option) => option.keyForList === initiallyFocusedOptionKey),
maxIndex: Math.min(flattenedSections.allOptions.length - 1, CONST.MAX_SELECTION_LIST_PAGE_LENGTH * currentPage - 1),
disabledIndexes: disabledArrowKeyIndexes,
isActive: isFocused,
onFocusedIndexChange: (index: number) => {
scrollToIndex(index, true);
},
isFocused,
});

scrollToLocation isn't functioning correctly due to variations in element sizes, caused by the offset in getItemLayout not accurately reflecting the distance between elements. This is due to the offset being set here:

if (SearchUtils.isTransactionListItemType(item) || SearchUtils.isReportActionListItemType(item)) {
return isLargeScreenWidth ? variables.optionRowHeight + listItemPadding : transactionItemMobileHeight + listItemPadding;
}

to be the same as for Transactions.

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

First, I would remove scrollToIndex from onFocusedIndexChange since I don’t see the point in keeping it (see optional).

We can set a fixed height for all elements or somehow determine the height of the component and store this data in reportAction. Then, we can retrieve it in getItemHeight.

proof of concept:

2024-09-11.18-55-07.mp4

What alternative solutions did you explore? (Optional)

I propose removing scrollToIndex from onFocusedIndexChange, as it only handles scrolling, and without it, I noticed everything works correctly.

code after:

    const [focusedIndex, setFocusedIndex] = useArrowKeyFocusManager({
        initialFocusedIndex: flattenedSections.allOptions.findIndex((option) => option.keyForList === initiallyFocusedOptionKey),
        maxIndex: Math.min(flattenedSections.allOptions.length - 1, CONST.MAX_SELECTION_LIST_PAGE_LENGTH * currentPage - 1),
        disabledIndexes: disabledArrowKeyIndexes,
        isActive: isFocused,
        onFocusedIndexChange: () => {},
        isFocused,
    });

proof of concept:

2024-09-10.22-55-20.mp4

@1subodhpathak
Copy link
Contributor

I am able to reproduce this problem!

Recording.2024-09-11.195526.mp4

But observed one thing, it only happens when the chat size greater than initialy defined is selected
image
See this

@Amoralchik
Copy link
Contributor

Update Proposal

@isabelastisser
Copy link
Contributor

isabelastisser commented Sep 11, 2024

@rayane-djouah, are you still able to reproduce this? Thanks!

@rayane-djouah
Copy link
Contributor

I'm able to reproduce

Screen.Recording.2024-09-11.at.11.48.46.PM.mov

Copy link

melvin-bot bot commented Sep 17, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@melvin-bot melvin-bot bot added the Overdue label Sep 17, 2024
@rayane-djouah
Copy link
Contributor

Reviewing now 👀

Copy link

melvin-bot bot commented Oct 28, 2024

📣 @rayane-djouah 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

Copy link

melvin-bot bot commented Oct 28, 2024

📣 @tushar-a-b You have been assigned to this job!
Please apply to the Upwork job and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Once you apply to this job, your Upwork ID will be stored and you will be automatically hired for future jobs!
Keep in mind: Code of Conduct | Contributing 📖

@tushar-a-b
Copy link
Contributor

@rayane-djouah,
Should I go with main solution where we will remove ListHeader & ListFooter layouts and consider one previous item for viewOffset as explained in my proposal or with alternative one where we will keep ListHeader & ListFooter layouts and calculate viewOffset by considering two previous items like I did in my test branch.
what do you think?

@rayane-djouah
Copy link
Contributor

@tushar-a-b I prefer the alternative solution because it seems to be the safest option

@tushar-a-b
Copy link
Contributor

@rayane-djouah, PR is ready for a review 👍.

@isabelastisser
Copy link
Contributor

@rayane-djouah any updates? Thanks!

@rayane-djouah
Copy link
Contributor

PR looks good to me

@rayane-djouah
Copy link
Contributor

Merged

@garrettmknight garrettmknight moved this to Bugs and Follow Up Issues in [#whatsnext] #expense Nov 11, 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 Nov 11, 2024
@melvin-bot melvin-bot bot changed the title [$250] [Search v2.2] - Chats - Selected chat is hidden when navigating via keyboard [HOLD for payment 2024-11-18] [$250] [Search v2.2] - Chats - Selected chat is hidden when navigating via keyboard Nov 11, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Nov 11, 2024
Copy link

melvin-bot bot commented Nov 11, 2024

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

Copy link

melvin-bot bot commented Nov 11, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.59-3 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-11-18. 🎊

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

Copy link

melvin-bot bot commented Nov 11, 2024

@rayane-djouah @isabelastisser 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]

@garrettmknight garrettmknight moved this from Bugs and Follow Up Issues to Hold for Payment in [#whatsnext] #expense Nov 14, 2024
@rayane-djouah
Copy link
Contributor

rayane-djouah commented Nov 15, 2024

BugZero Checklist:

  • 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
    • 2b. Reported on staging (deploy blocker)
    • 2c. Reported on a PR
    • 2z. Other:

    Who reported the bug:

    • 3a. Expensify user
    • 3b. Expensify employee
    • 3c. Contributor
    • 3d. QA
    • 3z. Other:
  • 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: Implemented chat type in search #47690 (comment)

  • 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

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

  • @isabelastisser Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

    Link to issue:

Regression Test Proposal

#### Precondition:

- The account contains many chats.
- Some messages in the chats are large.


#### Test:

1. Go to "Search" > "Chats".
2. Navigate through the list using the keyboard's up and down buttons.
3. Verify that the selected chat is not hidden when navigating via keyboard.

Do we agree 👍 or 👎

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Nov 18, 2024
@isabelastisser
Copy link
Contributor

isabelastisser commented Nov 18, 2024

Payment summary:

@tushar-a-b requires payment - Offer sent in Upwork - $250
@rayane-djouah requires payment automatic offer (Reviewer) $250 paid

@isabelastisser
Copy link
Contributor

All set!

@github-project-automation github-project-automation bot moved this from Hold for Payment to Done in [#whatsnext] #expense Nov 18, 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 Engineering External Added to denote the issue can be worked on by a contributor
Projects
Archived in project
Development

No branches or pull requests

8 participants