-
Notifications
You must be signed in to change notification settings - Fork 3k
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-07-10] [$250] [Search v1] Apply hover style to row if button is hovered #43233
Comments
Triggered auto assignment to @dylanexpensify ( |
Job added to Upwork: https://www.upwork.com/jobs/~013a5b2e0e021c1c12 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @alitoshmatov ( |
Upwork job price has been updated to $125 |
Contributor details |
✅ Contributor details stored successfully. Thank you for contributing to Expensify! |
ProposalPlease re-state the problem that we are trying to solve in this issue.Row is not highlighted What is the root cause of that problem?When we hover on a What changes do you think we should make in order to solve the problem?In
event.type is pointerenter or mouseenter , that means the hover is lost due to user entering a Pressable inside the current component, early return because the hover is still inside the current component. Alternatively we can add a prop to control this behavior like allowNestedHover .
Then (There're other ways to check like: check the target of the Optionally, we can do the same in
isHovered is already true , early return
What alternative solutions did you explore? (Optional)Add a PR upstream in |
Updated proposal to add an alternative solution |
ProposalPlease re-state the problem that we are trying to solve in this issue.Child hover effect not detected by parent Pressable What is the root cause of that problem?By default, we don't have a system or a feature that let hovered child Pressable, keep the hover style of a parent Pressable What changes do you think we should make in order to solve the problem?On this PR #42823 I created a mouseContext to help elimanate the issue between parent and child when there's a mouseup/moueUp/mouseDown event. We can use the same context and add a new feature for child hover state import type { ReactNode } from 'react';
import React, { createContext, useContext, useMemo, useState } from 'react';
type MouseContextProps = {
isMouseDownOnInput: boolean;
setMouseDown: () => void;
setMouseUp: () => void;
isChildHovered: boolean;
setChildHover: () => void;
setChildLeave: () => void;
};
const MouseContext = createContext<MouseContextProps>({
isMouseDownOnInput: false,
setMouseDown: () => {},
setMouseUp: () => {},
isChildHovered: false,
setChildHover: () => {},
setChildLeave: () => {},
});
type MouseProviderProps = {
children: ReactNode;
};
function MouseProvider({ children }: MouseProviderProps) {
const [isMouseDownOnInput, setIsMouseDownOnInput] = useState(false);
const [isChildHovered, setIsChildHovered] = useState(false);
const setMouseDown = () => setIsMouseDownOnInput(true);
const setMouseUp = () => setIsMouseDownOnInput(false);
const setChildHover = () => setIsChildHovered(true);
const setChildLeave = () => setIsChildHovered(false);
const value = useMemo(
() => ({
isMouseDownOnInput,
setMouseDown,
setMouseUp,
isChildHovered,
setChildHover,
setChildLeave,
}),
[isMouseDownOnInput, isChildHovered]
);
return <MouseContext.Provider value={value}>{children}</MouseContext.Provider>;
}
const useMouseContext = () => useContext(MouseContext);
export { MouseProvider, useMouseContext }; Then with this mouse context, we can fix all the Using the new context, we can use to encapsulate the
onMouseEnter={setChildHover}
onMouseLeave={setChildLeave}
What alternative solutions did you explore? |
Updated proposal to add some details |
@alitoshmatov can you review these proposals, please? Thanks! |
@luacmartins, @alitoshmatov, @dylanexpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
bump @alitoshmatov |
@luacmartins, @alitoshmatov, @dylanexpensify Huh... This is 4 days overdue. Who can take care of this? |
@luacmartins Should this logic applied everywhere - Parent hover should be active when cursor is on pressable element We have similar case Screen.Recording.2024-06-13.at.3.59.49.PM.movWorkspace list: Screen.Recording.2024-06-13.at.4.02.38.PM.mov |
@dominictb Thank you for your proposal, I really like the your first solution but it is not working for me can you recheck it? Applying early return:
|
@dragnoir Thank you for your proposal, I think your solution is not directly solving the problem we should change the behavior of hover element when it contains pressable element. I think your solution is adding a new behavior to each element manually. |
Waiting for regression period! |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.3-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 2024-07-10. 🎊 For reference, here are some details about the assignees on this issue:
|
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
|
Regression Test Proposal
Do we agree 👍 or 👎 |
payment coming up! |
Payment summary:
Please apply/request! |
@dominictb please accept offer! 🙇♂️ |
@luacmartins @dylanexpensify Could we keep the $250 original price for this issue? I saw it being reduced by half, however I believe this is not a simple issue, it requires non-intuitive use of mouse event, and I needed to dig into the library being used to find the RCA. Also there was a request to fix all cases of Pressables across the app and we've done that, it requires a lot of testing to make sure there's no regression. Appreciate your thought on this one! |
Sure, we can keep this one at the regular bounty. |
Upwork job price has been updated to $250 |
Nice, @dominictb accept the offer as it is, and I'll add another $125 as a bonus! @alitoshmatov I'll send a bonus for same amount to you as well! |
Thank you @luacmartins @dylanexpensify I accepted the offer |
Nice, paying! |
all done! |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number:
Reproducible in staging?:
Reproducible in production?:
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by:
Slack conversation:
Action Performed:
Coming from this comment
Expected Result:
Row should be highlighted
Actual Result:
Row is not highlighted
Workaround:
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @dylanexpensifyThe text was updated successfully, but these errors were encountered: