-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[Search v2.3] - Educational tooltip should not show over a dialog #49517
Comments
Triggered auto assignment to Contributor-plus team member for initial proposal review - @dukenv0307 ( |
Should it be hidden permanently, or should it be hidden and then shown again when the receipt dialog is closed? |
If it has shown already, it should not show again when the receipt dialog is closed. |
Edited by proposal-police: This proposal was edited at 2023-10-16T07:28:00Z. ProposalPlease re-state the problem that we are trying to solve in this issue.Educational tooltip should not show over a dialog What is the root cause of that problem?We don't have the logic to check if the modal will be opened in App/src/components/MenuItem.tsx Line 555 in 4c9a3fb
when the tooltip is about to open, user quickly open attachment modal, the modal will be shown along with tooltip What changes do you think we should make in order to solve the problem?
add logic to clean up settimeout if should render change from true to false
With this approach, we can make sure the tooltip can't be open when the modal (attachment modal or right modal) is about to show. If users just switch between tabs (there's no modal), we should preserve the tooltip What alternative solutions did you explore? (Optional) |
ProposalPlease re-state the problem that we are trying to solve in this issue.Educational tooltip shows over a dialog What is the root cause of that problem?the educational tooltip hides after 5 seconds regardless of whether a modal is opened or not
What changes do you think we should make in order to solve the problem?we should refactor the prev const [modal] = useOnyx(ONYXKEYS.MODAL);
const timerIDRef = useRef<NodeJS.Timeout | null>(null);
// Hide the tooltip after 5 seconds or immediately if the modal is open
useEffect(() => {
if (!hideTooltipRef.current || !shouldAutoDismiss) {
return;
}
// Function to clear the timeout
const clearTimer = () => {
if (!timerIDRef.current) {
return;
}
clearTimeout(timerIDRef.current);
timerIDRef.current = null;
};
// If the modal is open, hide the tooltip immediately and clear the timeout
if (modal?.willAlertModalBecomeVisible) {
clearTimer(); // Clear the timeout if the modal opens
hideTooltipRef.current();
return;
}
// Automatically hide tooltip after 5 seconds if shouldAutoDismiss is true
if (shouldAutoDismiss) {
timerIDRef.current = setTimeout(hideTooltipRef.current, 5000);
}
return () => {
clearTimer();
};
}, [shouldAutoDismiss, modal?.willAlertModalBecomeVisible]);
POCScreen.Recording.2024-09-20.at.1.05.38.PM.movWhat alternative solutions did you explore? (Optional)optionally: if we want to make this only applicable on certain usecases we can add a new prop to the |
ProposalPlease re-state the problem that we are trying to solve in this issue.Educational tooltip is shown over the all of the content when the search page is in the background What is the root cause of that problem?We dont have logic to hide the tooltip when user is navigated from the screen we only have logic to autohide when tooltip after 5s
What changes do you think we should make in order to solve the problem?we can setup a navigation listner for navigation state change so as soon as user takes a navigation action tooltip hides, for safety we'll add this change specific when we need with // src/components/Tooltip/EducationalTooltip/BaseEducationalTooltip.tsx
// Automatically hide tooltip after 5 seconds
useEffect(() => {
if (!hideTooltipRef.current || !shouldAutoDismiss) {
return;
}
const timerID = setTimeout(hideTooltipRef.current, 5000);
timerIDRef.current = timerID; // we take timerID in a ref
return () => {
clearTimeout(timerID);
};
}, [shouldAutoDismiss]);
useEffect(() => {
if (!hideTooltipRef.current || !shouldHideOnNavigation) {
return;
}
const listener = () => {
hideTooltipRef.current?.();
if (timerIDRef.current) {
clearTimeout(timerIDRef.current);
}
};
navigationRef.addListener('state', listener);
return () => navigationRef.removeListener('state', listener);
}, [shouldHideOnNavigation]); Screen.Recording.2024-09-22.at.3.38.16.AM.mov |
Updated proposal to cover the navigation logic |
Reviewing... |
Thanks for your proposals We have 3 cases that need to fix here
so I would like to choose @daledah's proposal 🎀👀🎀 C+ reviewed |
Current assignees @luacmartins and @lakchote are eligible for the choreEngineerContributorManagement assigner, not assigning anyone new. |
Thanks for the prompt review @dukenv0307, Is the expected result that it shouldn't be shown in wide models such as the attachment modal or generally any modal such as the RHP? I thought it was only specific for the wide modals, like the receipt modal specified in the issue steps, that's why i used the |
@abzokhattab I believe we shouldn hide the tooltip if the RHP is open cc @lakchote |
The tooltip will be shown at the top of the page (even if the modal is open), so it doesn't make sense if we can interact with the tooltip of the bottom/center pages when the RHP is open |
I'd say yes, but let's wait for @Expensify/design opinion |
@dubielzyk-expensify might have more insight with how the tooltip should work, but from my perspective I think it makes sense to hide it when the RHP is open—especially if it will always sit "on top" of everything else. |
I agree with Danny that I think it makes sense to hide it when you open the RHP. 👍 |
I agree with @dannymcclain and @trjExpensify |
@lakchote We're good to go |
@daledah's proposal LGTM |
@dukenv0307 @lakchote PR is ready. |
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 issue has not been updated in over 15 days. @lakchote, @luacmartins, @dukenv0307, @daledah eroding to Monthly issue. P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do! |
Latest update is here |
I think this is done, right? We just need to process payment? |
Yes, we should process payment. |
Triggered auto assignment to @CortneyOfstad ( |
@CortneyOfstad Can you process payment here? Thanks |
@daledah — offer sent here Please let me know once you both accept and I will get those paid ASAP. Thanks! |
BugZero Checklist:
Bug classificationSource of bug:
Where bug was reported:
Who reported the bug:
Regression Test ProposalTest:
Do we agree 👍 or 👎 |
@CortneyOfstad Offer accepted, thank you! |
Are we still missing anything here? |
I think we're good to close? I'm closing the issue. If we need to reopen it, feel free to do so. |
I don't think we need a separate TC for this. We're adding them all with the project wrap up. I checked off the checkbox in the checklist. Closing. |
The educational tooltip should not show over a dialog.
(note: the educational tooltip shows when you create a saved search for the first time)
Steps:
Issue Owner
Current Issue Owner: @dukenv0307The text was updated successfully, but these errors were encountered: