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-07-01] [$250] mWeb - Reports - Report preview remain highlighted when closed using device´s back button. #63685
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorWeeklyKSv2
Version Number: 9.1.60-1 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from TestRail: N/A Email or phone of affected tester (no customers):ibellicotest+985@gmail.com Issue reported by: Applause Internal Team Device used: Motorola MotoG60 - Android 12 - Chrome App Component: Search
Action Performed:
Prerequisite: Account has at least one workspace available.
Open the staging.new.expensify.com website.
Open any workspace chat.
Submit a manual expense.
Navigate to "Reports"
Tap on the bookmark icon and select "Reports"
Open the report of the just created expense.
Return using device´s back button.
Note that report preview remains highlighted after returning.
Expected Result:
Report preview, shouldn´t remain highlighted when user returns to reports list.
Actual Result:
When user opens an expense report from "Reports" section and returns using device´s back button, the report preview remains constantly highlighted.
Please re-state the problem that we are trying to solve in this issue.
When a user opens an expense report from the "Reports" section and navigates back using the device's back button, the report preview remains visibly highlighted, even though it should not be.
What is the root cause of that problem?
We use the useHover hook to track hover state and apply the appropriate active styles, as shown here:
On touchscreen devices, although a hover action doesn't technically occur, the hovered state is still set to true, which results in incorrect active styling. Why is hovered being set on touch devices?
In the useHover hook, the onMouseEnter event is expected to trigger only when a mouse pointer enters an element. However, on touch devices, onMouseEnter can be erroneously triggered by a tap, causing hovered to be set to true even though no hover action has occurred.
What changes do you think we should make in order to solve the problem?
However, on mobile devices, after clicking and navigating away, the onMouseLeave event is not triggered, which means hovered remains true and the style stays applied when going back.
What changes do you think we should make in order to solve the problem?
Ensure that after clicking and navigating away, hovered is reset, while all the original behavior is maintained:
If we only want to reset on mobile, we can add a check in useEffect.
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)
N/A
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 [-]mWeb - Reports - Report preview remain highlighted when closed using device´s back button.[/-][+][$250] mWeb - Reports - Report preview remain highlighted when closed using device´s back button.[/+]on Jun 11, 2025
changed the title [-][$250] mWeb - Reports - Report preview remain highlighted when closed using device´s back button.[/-][+][Due for payment 2025-07-01] [$250] mWeb - Reports - Report preview remain highlighted when closed using device´s back button.[/+]on Jun 24, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.70-7 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@ahmedGaber93@abekkala@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]
[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.
This is a straight forward fix, and I don't think we need a regression test here.
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorWeeklyKSv2
Activity
melvin-bot commentedon Jun 6, 2025
Triggered auto assignment to @abekkala (
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.truph01 commentedon Jun 7, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
What is the root cause of that problem?
We use the
useHoverhook to track hover state and apply the appropriate active styles, as shown here:App/src/components/TransactionItemRow/index.tsx
Lines 157 to 165 in e1766ef
On touchscreen devices, although a hover action doesn't technically occur, the
hoveredstate is still set totrue, which results in incorrect active styling. Why ishoveredbeing set on touch devices?In the
useHoverhook, theonMouseEnterevent is expected to trigger only when a mouse pointer enters an element. However, on touch devices,onMouseEntercan be erroneously triggered by a tap, causinghoveredto be set totrueeven though no hover action has occurred.What changes do you think we should make in order to solve the problem?
In the following lines of the
useHoverhook:App/src/hooks/useHover.ts
Lines 8 to 9 in e1766ef
We should add a check for
!canUseTouchScreenbefore calling the setter function, similar to what we already do here:App/src/components/Attachments/AttachmentCarousel/index.tsx
Lines 294 to 295 in e1766ef
This will prevent touch events from incorrectly triggering hover behavior.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
What alternative solutions did you explore? (Optional)
canUseTouchScreen, we can usehasHoverSupportfunction to check whether the current platform can be hovered.dmkt9 commentedon Jun 9, 2025
🚨 Edited by proposal-police: This proposal was edited at 2025-06-09 04:29:42 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
When user opens an expense report from "Reports" section and returns using device´s back button, the report preview remains constantly highlighted.
What is the root cause of that problem?
TransactionItemRowuses theuseHoverhook to add styles to the element.App/src/components/TransactionItemRow/index.tsx
Lines 156 to 165 in e1766ef
App/src/hooks/useHover.ts
Lines 8 to 9 in e1766ef
onMouseLeaveevent is not triggered, which meanshoveredremains true and the style stays applied when going back.What changes do you think we should make in order to solve the problem?
Ensure that after clicking and navigating away,
hoveredis reset, while all the original behavior is maintained:App/src/hooks/useHover.ts
Line 4 in e1766ef
If we only want to reset on mobile, we can add a check in
useEffect.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)
N/A
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.
melvin-bot commentedon Jun 10, 2025
@abekkala Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
[-]mWeb - Reports - Report preview remain highlighted when closed using device´s back button.[/-][+][$250] mWeb - Reports - Report preview remain highlighted when closed using device´s back button.[/+]melvin-bot commentedon Jun 11, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021932821543208672181
melvin-bot commentedon Jun 11, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @ahmedGaber93 (
External)13 remaining items
truph01 commentedon Jun 17, 2025
@ahmedGaber93 PR is ready
abekkala commentedon Jun 18, 2025
@ahmedGaber93 have you began the PR review?
ahmedGaber93 commentedon Jun 19, 2025
@abekkala Done.
[-][$250] mWeb - Reports - Report preview remain highlighted when closed using device´s back button.[/-][+][Due for payment 2025-07-01] [$250] mWeb - Reports - Report preview remain highlighted when closed using device´s back button.[/+]melvin-bot commentedon Jun 24, 2025
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Jun 24, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.70-7 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-07-01. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Jun 24, 2025
@ahmedGaber93 @abekkala @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 commentedon Jul 1, 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/37199/files#r2176490113
[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.
This is a straight forward fix, and I don't think we need a regression test here.
abekkala commentedon Jul 1, 2025
PAYMENT SUMMARY FOR JUL 01
thank you! 🎉
JmillsExpensify commentedon Jul 11, 2025
$250 approved for @ahmedGaber93