You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2025-04-25] [$250] Web- Search - Top-most result in Recent chats is not highlighted #59552
Version Number: V9.1.22-5 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A If this was caught during regression testing, add the test name, ID and link from TestRail:https://github.com/Expensify/Expensify/issues/452028 Email or phone of affected tester (no customers): N/A Issue reported by: Applause Internal Team Device used: Windows 10 chrome App Component: Search
Please re-state the problem that we are trying to solve in this issue.
Top-most result in Recent chats is not highlighted
What is the root cause of that problem?
The first time the search bar is turned on, data from recentReportsOptions that has not been loaded will return empty. So styledRecentReports is empty, styledRecentReports.at(0)?.keyForList return undefined, thus the first recent chat is not highlighted.
Inside useArrowKeyFocusManager, initialFocusedIndex is only used in the initial state setup with useState, and subsequent changes to initiallyFocusedOptionKey don't trigger a state update.
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
N/A
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
changed the title [-]Web- Search - Top-most result in Recent chats is not highlighted[/-][+][$250] Web- Search - Top-most result in Recent chats is not highlighted[/+]on Apr 3, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.29-10 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@shubham1206agra@NicMendonca@shubham1206agra 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]
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.
[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: Not Required
[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
Test:
Open the app or refresh the page on web
Tap the search icon
Verify that the first recent chat is highlighted for large screens (web and desktop only, not for mobile)
Activity
melvin-bot commentedon Apr 2, 2025
Triggered auto assignment to @NicMendonca (
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.ChavdaSachin commentedon Apr 2, 2025
Unable to repro.
thelullabyy commentedon Apr 2, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Top-most result in Recent chats is not highlighted
What is the root cause of that problem?
The first time the search bar is turned on, data from
recentReportsOptionsthat has not been loaded will return empty. SostyledRecentReportsis empty,styledRecentReports.at(0)?.keyForListreturn undefined, thus the first recent chat is not highlighted.App/src/components/Search/SearchAutocompleteList.tsx
Line 542 in 1fb2118
Inside
useArrowKeyFocusManager,initialFocusedIndexis only used in the initial state setup withuseState, and subsequent changes toinitiallyFocusedOptionKeydon't trigger a state update.App/src/components/SelectionList/BaseSelectionList.tsx
Lines 340 to 341 in 1fb2118
App/src/hooks/useArrowKeyFocusManager.ts
Line 56 in 1fb2118
When
recentReportsOptionsis loaded,SelectionListstill retains the state of the originalinitiallyFocusedOptionKeyWhat changes do you think we should make in order to solve the problem?
Add a
useEffectto watch for changes ininitiallyFocusedOptionKeyinsideBaseSelectionListApp/src/components/SelectionList/BaseSelectionList.tsx
Line 40 in 1fb2118
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
NA
What alternative solutions did you explore? (Optional)
Use a key prop to force a complete re-render of the component when
initiallyFocusedOptionKeychangesApp/src/components/Search/SearchAutocompleteList.tsx
Lines 525 to 526 in 1fb2118
key={styledRecentReports.at(0)?.keyForList}Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
samranahm commentedon Apr 2, 2025
@ChavdaSachin can you share a quick video so that we get to know this is regression from PR
samranahm commentedon Apr 2, 2025
🚨 Edited by proposal-police: This proposal was edited at 2025-04-03 15:36:34 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
What is the root cause of that problem?
Here
App/src/components/SelectionList/BaseSelectionList.tsx
Lines 339 to 341 in 9a58e7d
useArrowKeyFocusManager initializes immediately with:
But flattenedSections.allOptions empty during first render (when we first open the search router)
What changes do you think we should make in order to solve the problem?
We should add
useEffectbellow thisuseEffectApp/src/components/SelectionList/BaseSelectionList.tsx
Lines 369 to 375 in 9a58e7d
that runs after options are loaded
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
N/A
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
NicMendonca commentedon Apr 3, 2025
Then after a refresh:
[-]Web- Search - Top-most result in Recent chats is not highlighted[/-][+][$250] Web- Search - Top-most result in Recent chats is not highlighted[/+]melvin-bot commentedon Apr 3, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021907790385956529885
19 remaining items
melvin-bot commentedon Apr 18, 2025
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Apr 18, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.29-10 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-04-25. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Apr 18, 2025
@shubham1206agra @NicMendonca @shubham1206agra 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]
NicMendonca commentedon Apr 25, 2025
BugZero Checklist:
Bug classification
Source of bug:
Where bug was reported:
Who reported the bug:
[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 👎
NicMendonca commentedon Apr 25, 2025
Payment summary
shubham1206agra commentedon Apr 25, 2025
BugZero Checklist:
Bug classification
Source of bug:
Where bug was reported:
Who reported the bug:
[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/53198/files#r2060452367
[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: Not Required
[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
Test:
Do we agree 👍 or 👎
NicMendonca commentedon Apr 28, 2025
#59552 (comment)
garrettmknight commentedon May 13, 2025
$250 approved for @shubham1206agra