-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Feat: Make it possible to click the element the product training tooltip is pointing to #54710
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
Merged
puneetlath
merged 35 commits into
Expensify:main
from
rayane-d:Make-it-possible-to-click-the-element-the-product-training-tooltip-is-pointing-to-pr
Jan 6, 2025
Merged
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
6174a6d
Make it possible to click the element the product training tooltip is…
rayane-d ed54b83
use isScreenFocused
rayane-d 2d2e16d
Merge branch 'main' into Make-it-possible-to-click-the-element-the-pr…
rayane-d 0d49f67
fix bug
rayane-d fe4bcb6
fix bug
rayane-d 8de62b1
remove shouldHideEducationalTooltip
rayane-d 4c13d72
QAB hideProductTrainingTooltip
rayane-d 9d578d3
QAB hideProductTrainingTooltip
rayane-d 629c8c2
remove console log
rayane-d 5e5b74b
Merge branch 'main' into Make-it-possible-to-click-the-element-the-pr…
rayane-d 57811e3
Merge branch 'main' into Make-it-possible-to-click-the-element-the-pr…
rayane-d c8dc967
fix errors
rayane-d b7d5186
correct copy usage
rayane-d 2042262
Refactor
rayane-d 06f1b75
hideProductTrainingTooltip for RENAME_SAVED_SEARCH tooltip
rayane-d 4b2a934
revert a change
rayane-d fcaf530
Fix SEARCH_FILTER_BUTTON_TOOLTIP for narrow layout
rayane-d b8f68ba
Merge branch 'Expensify:main' into Make-it-possible-to-click-the-elem…
rayane-d 1992248
Fix: tooltip does not disappear when navigating away for the first time
rayane-d b47997b
Fix bug: when a migrated user logged in and dismiss modal user dont s…
rayane-d 127c7f8
Fix lint errors
rayane-d 2737c55
add mocks for useNavigationState
rayane-d 51eca4a
create useIsCurrentRouteHome hook
rayane-d 163bf6a
add useIsCurrentRouteHome mock
rayane-d 46da42e
fix ESlint errors
rayane-d 0f88b45
Fix: Tooltips not showing on native
rayane-d e8a3b75
Fix: Hide the extra "More" tooltip when we have an educational toolti…
rayane-d b33e69f
Refactor
rayane-d aa2b173
add comment
rayane-d 473cad5
Fix bug
rayane-d b4187ee
Fix QAB tooltip does not hide immediately
rayane-d d11826c
Merge branch 'Expensify:main' into Make-it-possible-to-click-the-elem…
rayane-d 1a52149
Fix: bottomtab tooltips (inbox and FAB) only hides on navigation to s…
rayane-d ed68330
move prop to most relevant type
rayane-d 270a302
Fix: clicking on admin chat dismiss the workspacechat tooltip
rayane-d File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,6 +37,10 @@ function ProductTrainingContextProvider({children}: ChildrenProps) { | |
| const [dismissedProductTraining] = useOnyx(ONYXKEYS.NVP_DISMISSED_PRODUCT_TRAINING); | ||
| const {shouldUseNarrowLayout} = useResponsiveLayout(); | ||
|
|
||
| const [modal] = useOnyx(ONYXKEYS.MODAL); | ||
| // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing | ||
| const isModalVisible = modal?.isVisible || modal?.willAlertModalBecomeVisible; | ||
|
|
||
| const [activeTooltips, setActiveTooltips] = useState<Set<ProductTrainingTooltipName>>(new Set()); | ||
|
|
||
| const unregisterTooltip = useCallback( | ||
|
|
@@ -92,11 +96,16 @@ function ProductTrainingContextProvider({children}: ChildrenProps) { | |
| return false; | ||
| } | ||
|
|
||
| // We need to make an exception for the QAB tooltip because it is shown in a modal, otherwise it would be hidden if a modal is visible | ||
| if (tooltipName !== CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.QUICK_ACTION_BUTTON && isModalVisible) { | ||
| return false; | ||
| } | ||
|
|
||
| return tooltipConfig.shouldShow({ | ||
| shouldUseNarrowLayout, | ||
| }); | ||
| }, | ||
| [dismissedProductTraining, hasBeenAddedToNudgeMigration, isOnboardingCompleted, isOnboardingCompletedMetadata, shouldUseNarrowLayout], | ||
| [dismissedProductTraining, hasBeenAddedToNudgeMigration, isOnboardingCompleted, isOnboardingCompletedMetadata, shouldUseNarrowLayout, isModalVisible], | ||
| ); | ||
|
|
||
| const registerTooltip = useCallback( | ||
|
|
@@ -156,11 +165,10 @@ const useProductTrainingContext = (tooltipName: ProductTrainingTooltipName, shou | |
| useEffect(() => { | ||
| if (shouldShow) { | ||
| registerTooltip(tooltipName); | ||
| return () => { | ||
| unregisterTooltip(tooltipName); | ||
| }; | ||
| } | ||
| return () => {}; | ||
| return () => { | ||
| unregisterTooltip(tooltipName); | ||
| }; | ||
|
Comment on lines
+169
to
+171
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should have un-registered the tooltip if |
||
| }, [tooltipName, registerTooltip, unregisterTooltip, shouldShow]); | ||
|
|
||
| const renderProductTrainingTooltip = useCallback(() => { | ||
|
|
@@ -209,10 +217,13 @@ const useProductTrainingContext = (tooltipName: ProductTrainingTooltipName, shou | |
| }, [shouldRenderTooltip, tooltipName, shouldShow]); | ||
|
|
||
| const hideProductTrainingTooltip = useCallback(() => { | ||
| if (!shouldShowProductTrainingTooltip) { | ||
| return; | ||
| } | ||
| const tooltip = TOOLTIPS[tooltipName]; | ||
| tooltip.onHideTooltip(); | ||
| unregisterTooltip(tooltipName); | ||
| }, [tooltipName, unregisterTooltip]); | ||
| }, [tooltipName, shouldShowProductTrainingTooltip, unregisterTooltip]); | ||
|
|
||
| return { | ||
| renderProductTrainingTooltip, | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NAB, but could we use the same terminology here? Either active route or current route.