-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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 2025-01-15] [$500] Make it possible to click the element the product training tooltip is pointing to. #54068
Comments
Job added to Upwork: https://www.upwork.com/jobs/~021867697197444537249 |
Current assignee @ishpaul777 is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to @twisterdotcom ( |
Upwork job price has been updated to $500 |
Updating the price since this is part of an important migrate initiative. |
The core issue here is that operations that should happen outside of the render cycle are being executed at the wrong time and in the wrong way. Functions like useSharedValue and useState, which manage state, should be properly synchronized using hooks like useEffect. This ensures that side effects are handled outside of the render cycle, preventing unnecessary re-renders and ensuring smoother performance. Using useEffect: Values should not be updated directly during the render cycle. Instead, hooks like useEffect should be used to update values after the component is initially rendered or after specific dependencies change. This ensures that updates are done in a controlled manner and helps avoid unnecessary renders.
This approach ensures that values are updated only after the component has mounted, preventing unnecessary re-renders. Synchronized Value Management: Shared values with Conditional Checks: The |
📣 @storm21-tecn! 📣
|
|
Edited by proposal-police: This proposal was edited at the latest timestamp recorded during the edit. ProposalPlease re-state the problem that we are trying to solve in this issue.Make it possible to click the element the product training tooltip is pointing to. What is the root cause of that problem?New feature What changes do you think we should make in order to solve the problem?
Test branch:Previous solution
const handleOverlayClick = (event?: MouseEvent | KeyboardEvent) => {
// Captures the user’s click coordinates on the transparent overlay.
const clickX = event?.clientX;
const clickY = event?.clientY;
// Check if the click falls within the target element bounds
const isWithinTarget = !!clickX && !!clickY && clickX >= xOffset && clickX <= xOffset + targetWidth && clickY >= yOffset && clickY <= yOffset + targetHeight;
// Hide the tooltip
onDismissTooltip();
// If the click is within target bounds, trigger the children element's press callback
requestAnimationFrame(() => {
if (!isWithinTarget) {
return;
}
onHideTooltip();
onChildrenElementPress?.();
});
}; On native: const handleOverlayClick = (event?: GestureEvent) => {
// Captures the user’s click coordinates on the transparent overlay.
const pageX = event?.nativeEvent.pageX;
const pageY = event?.nativeEvent.pageY;
// Compares these coordinates against the position and dimensions of the target element that the tooltip references.
const isWithinTarget = !!pageX && !!pageY && pageX >= xOffset && pageX <= xOffset + targetWidth && pageY >= yOffset && pageY <= yOffset + targetHeight;
onDismissTooltip();();
requestAnimationFrame(() => {
if (!isWithinTarget) {
return;
}
// the tooltip should not be displayed again
onHideTooltip();
onChildrenElementPress?.();
});
};
const holeStyle = useMemo(
() => ({
position: styles.pFixed,
top: holeY,
left: holeX,
width: holeWidth,
height: holeHeight,
zIndex: 1500,
}),
[holeX, holeY, holeWidth, holeHeight, styles.pFixed],
);
return (
<View
onPointerDown={handlePointerDown}
style={styles.fullScreen}
>
<PressableWithoutFeedback
onPress={onPress}
style={[styles.flex1, styles.cursorDefault, overlay]}
accessibilityLabel={translate('common.close')}
role={CONST.ROLE.BUTTON}
/>
>
{/* "Hole" area with a hand cursor */}
<PressableWithoutFeedback
onPress={onPress}
style={holeStyle}
role={CONST.ROLE.BUTTON}
/>
</PressableWithoutFeedback>
</View>
);
{shouldUseOverlay && (
<TransparentOverlay
onPress={handleOverlayClick}
holeX={xOffset}
holeY={yOffset}
holeWidth={targetWidth}
holeHeight={targetHeight}
/>
)}
Test branch:main...rayane-djouah:z:Make-it-possible-to-click-the-product-training-tooltip-element Result:Screen.Recording.2024-12-14.at.4.56.17.PM.movScreen.Recording.2024-12-14.at.4.53.36.PM.movWhat alternative solutions did you explore? (Optional)On web, we can dispatch the mouse press event to the underlaying element, but we can't do this on native, so // If the click is within the target element, re-dispatch the event to the element
const targetElement = document.elementFromPoint(clickX, clickY) as HTMLElement | null;
if (targetElement) {
// Create a new MouseEvent and dispatch it to simulate a click
const simulatedClick = new MouseEvent('click', {bubbles: true, cancelable: true, clientX: clickX, clientY: clickY});
targetElement.dispatchEvent(simulatedClick);
} |
Updated the proposal with more details |
NOT OVERDUE DISCUSSING HERE https://expensify.slack.com/archives/C02NK2DQWUX/p1733780305744839 |
@puneetlath, @twisterdotcom, @ishpaul777 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results. If a regression has occurred and you are the assigned CM follow the instructions here. If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future. |
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results. If a regression has occurred and you are the assigned CM follow the instructions here. If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future. |
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results. If a regression has occurred and you are the assigned CM follow the instructions here. If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future. |
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results. If a regression has occurred and you are the assigned CM follow the instructions here. If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future. |
This indeed caused a regreession: #54841 |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.81-6 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-01-15. 🎊 For reference, here are some details about the assignees on this issue:
|
BugZero Checklist: The PR adding this new feature has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
|
Okay, sorry for missing this folks. The regression messages certainly caused a bit of confusion. @puneetlath / @iwiznia are we worried about the regressions here enough to reduce payment? Or, now that everything is resolved, can we go ahead with paying out the existing offers? |
I thought all regressions reduced payments, if that's not the case, then I am not sure what the logic is for reducing payment. |
This comment has been minimized.
This comment has been minimized.
Note: My eligibility for NewDot payments began on December 28th, and I was assigned to this GitHub issue on December 31st |
Regression Test Proposal
Do we agree 👍 or 👎 |
This seems fine to me: #54068 (comment) |
Payment Summary:
|
$500 approved for @rayane-djouah |
Part of the Migrate Existing Users to NewDot project
Main issue: https://github.com/Expensify/Expensify/issues/437980
Doc section: https://docs.google.com/document/d/1m8e1ASwG70t651qSO6OfsSvW18RFrcWkO897iUllDLs/edit?tab=t.0#heading=h.yh89nmhpipyt
Project:
Feature Description
Make it possible to click the element the product training tooltip is pointing to.
Ideal Expected Behaviour:
Manual tests scenario:
Note: None of the tooltips should be autodismissed after few seconds
We have 4 tooltips at this time see list here and other 4 will be added in #54064 this should be the expected behavior for all tooltips
Issue Owner
Current Issue Owner: @Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @twisterdotcomThe text was updated successfully, but these errors were encountered: