-
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
Feat: Make it possible to click the element the product training tooltip is pointing to #54710
Merged
puneetlath
merged 35 commits into
Expensify:main
from
rayane-djouah:Make-it-possible-to-click-the-element-the-product-training-tooltip-is-pointing-to-pr
Jan 6, 2025
+151
−169
Merged
Changes from 32 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-djouah ed54b83
use isScreenFocused
rayane-djouah 2d2e16d
Merge branch 'main' into Make-it-possible-to-click-the-element-the-pr…
rayane-djouah 0d49f67
fix bug
rayane-djouah fe4bcb6
fix bug
rayane-djouah 8de62b1
remove shouldHideEducationalTooltip
rayane-djouah 4c13d72
QAB hideProductTrainingTooltip
rayane-djouah 9d578d3
QAB hideProductTrainingTooltip
rayane-djouah 629c8c2
remove console log
rayane-djouah 5e5b74b
Merge branch 'main' into Make-it-possible-to-click-the-element-the-pr…
rayane-djouah 57811e3
Merge branch 'main' into Make-it-possible-to-click-the-element-the-pr…
rayane-djouah c8dc967
fix errors
rayane-djouah b7d5186
correct copy usage
rayane-djouah 2042262
Refactor
rayane-djouah 06f1b75
hideProductTrainingTooltip for RENAME_SAVED_SEARCH tooltip
rayane-djouah 4b2a934
revert a change
rayane-djouah fcaf530
Fix SEARCH_FILTER_BUTTON_TOOLTIP for narrow layout
rayane-djouah b8f68ba
Merge branch 'Expensify:main' into Make-it-possible-to-click-the-elem…
rayane-djouah 1992248
Fix: tooltip does not disappear when navigating away for the first time
rayane-djouah b47997b
Fix bug: when a migrated user logged in and dismiss modal user dont s…
rayane-djouah 127c7f8
Fix lint errors
rayane-djouah 2737c55
add mocks for useNavigationState
rayane-djouah 51eca4a
create useIsCurrentRouteHome hook
rayane-djouah 163bf6a
add useIsCurrentRouteHome mock
rayane-djouah 46da42e
fix ESlint errors
rayane-djouah 0f88b45
Fix: Tooltips not showing on native
rayane-djouah e8a3b75
Fix: Hide the extra "More" tooltip when we have an educational toolti…
rayane-djouah b33e69f
Refactor
rayane-djouah aa2b173
add comment
rayane-djouah 473cad5
Fix bug
rayane-djouah b4187ee
Fix QAB tooltip does not hide immediately
rayane-djouah d11826c
Merge branch 'Expensify:main' into Make-it-possible-to-click-the-elem…
rayane-djouah 1a52149
Fix: bottomtab tooltips (inbox and FAB) only hides on navigation to s…
rayane-djouah ed68330
move prop to most relevant type
rayane-djouah 270a302
Fix: clicking on admin chat dismiss the workspacechat tooltip
rayane-djouah 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 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 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 |
---|---|---|
|
@@ -16,6 +16,7 @@ | |
import Text from '@components/Text'; | ||
import Tooltip from '@components/Tooltip'; | ||
import EducationalTooltip from '@components/Tooltip/EducationalTooltip'; | ||
import useIsCurrentRouteHome from '@hooks/useIsCurrentRouteHome'; | ||
import useLocalize from '@hooks/useLocalize'; | ||
import useResponsiveLayout from '@hooks/useResponsiveLayout'; | ||
import useStyleUtils from '@hooks/useStyleUtils'; | ||
|
@@ -46,22 +47,24 @@ | |
const {shouldUseNarrowLayout} = useResponsiveLayout(); | ||
|
||
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing | ||
const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${optionItem?.reportID || -1}`); | ||
Check failure on line 50 in src/components/LHNOptionsList/OptionRowLHN.tsx GitHub Actions / Changed files ESLint check
|
||
const [activePolicyID] = useOnyx(ONYXKEYS.NVP_ACTIVE_POLICY_ID); | ||
const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED); | ||
const session = useSession(); | ||
const isActiveWorkspaceChat = ReportUtils.isPolicyExpenseChat(report) && activePolicyID === report?.policyID && session?.accountID === report?.ownerAccountID; | ||
const isOnboardingGuideAssigned = introSelected?.choice === CONST.ONBOARDING_CHOICES.MANAGE_TEAM && !session?.email?.includes('+'); | ||
const shouldShowGetStartedTooltip = isOnboardingGuideAssigned ? ReportUtils.isAdminRoom(report) : ReportUtils.isConciergeChatReport(report); | ||
const isActiveRouteHome = useIsCurrentRouteHome(); | ||
|
||
const {tooltipToRender, shouldShowTooltip} = useMemo(() => { | ||
const tooltip = shouldShowGetStartedTooltip ? CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.CONCEIRGE_LHN_GBR : CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.LHN_WORKSPACE_CHAT_TOOLTIP; | ||
|
||
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing | ||
return {tooltipToRender: tooltip, shouldShowTooltip: shouldUseNarrowLayout ? isScreenFocused : true}; | ||
}, [shouldShowGetStartedTooltip, isScreenFocused, shouldUseNarrowLayout]); | ||
return {tooltipToRender: tooltip, shouldShowTooltip: shouldUseNarrowLayout ? isScreenFocused && isActiveRouteHome : isActiveRouteHome}; | ||
}, [shouldShowGetStartedTooltip, isScreenFocused, shouldUseNarrowLayout, isActiveRouteHome]); | ||
|
||
const {shouldShowProductTrainingTooltip, renderProductTrainingTooltip, hideProductTrainingTooltip} = useProductTrainingContext(tooltipToRender, shouldShowTooltip); | ||
|
||
const {translate} = useLocalize(); | ||
const [isContextMenuActive, setIsContextMenuActive] = useState(false); | ||
|
||
|
@@ -165,10 +168,8 @@ | |
horizontal: isActiveWorkspaceChat ? CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.LEFT : CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.RIGHT, | ||
vertical: CONST.MODAL.ANCHOR_ORIGIN_VERTICAL.TOP, | ||
}} | ||
shouldUseOverlay | ||
shiftHorizontal={isActiveWorkspaceChat ? variables.workspaceLHNtooltipShiftHorizontal : variables.gbrTooltipShiftHorizontal} | ||
shiftVertical={isActiveWorkspaceChat ? 0 : variables.composerTooltipShiftVertical} | ||
onHideTooltip={hideProductTrainingTooltip} | ||
wrapperStyle={styles.productTrainingTooltipWrapper} | ||
> | ||
<View> | ||
|
@@ -183,6 +184,7 @@ | |
event?.preventDefault(); | ||
// Enable Composer to focus on clicking the same chat after opening the context menu. | ||
ReportActionComposeFocusManager.focus(); | ||
hideProductTrainingTooltip(); | ||
onSelectRow(optionItem, popoverAnchor); | ||
}} | ||
onMouseDown={(event) => { | ||
|
This file contains 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 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 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 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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import {useIsFocused} from '@react-navigation/native'; | ||
import React, {useMemo, useState} from 'react'; | ||
import {useFocusEffect} from '@react-navigation/native'; | ||
import React, {useCallback, useMemo, useState} from 'react'; | ||
import {InteractionManager, View} from 'react-native'; | ||
import {useOnyx} from 'react-native-onyx'; | ||
import Button from '@components/Button'; | ||
|
@@ -58,14 +58,25 @@ | |
const [isDeleteExpensesConfirmModalVisible, setIsDeleteExpensesConfirmModalVisible] = useState(false); | ||
const [isOfflineModalVisible, setIsOfflineModalVisible] = useState(false); | ||
const [isDownloadErrorModalVisible, setIsDownloadErrorModalVisible] = useState(false); | ||
const isFocused = useIsFocused(); | ||
|
||
const [isScreenFocused, setIsScreenFocused] = useState(false); | ||
|
||
const {renderProductTrainingTooltip, shouldShowProductTrainingTooltip, hideProductTrainingTooltip} = useProductTrainingContext( | ||
CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.SEARCH_FILTER_BUTTON_TOOLTIP, | ||
isFocused, | ||
isScreenFocused, | ||
); | ||
|
||
const {status, hash} = queryJSON; | ||
|
||
useFocusEffect( | ||
useCallback(() => { | ||
setIsScreenFocused(true); | ||
return () => { | ||
setIsScreenFocused(false); | ||
}; | ||
}, []), | ||
); | ||
|
||
const selectedTransactionsKeys = Object.keys(selectedTransactions ?? {}); | ||
|
||
const handleDeleteExpenses = () => { | ||
|
@@ -189,7 +200,7 @@ | |
|
||
const reportIDList = selectedReports?.filter((report) => !!report).map((report) => report.reportID) ?? []; | ||
SearchActions.exportSearchItemsToCSV( | ||
{query: status, jsonQuery: JSON.stringify(queryJSON), reportIDList, transactionIDList: selectedTransactionsKeys, policyIDs: [activeWorkspaceID ?? '']}, | ||
Check failure on line 203 in src/components/Search/SearchPageHeader.tsx GitHub Actions / Changed files ESLint check
|
||
() => { | ||
setIsDownloadErrorModalVisible(true); | ||
}, | ||
|
@@ -334,6 +345,7 @@ | |
} | ||
|
||
const onFiltersButtonPress = () => { | ||
hideProductTrainingTooltip(); | ||
const filterFormValues = SearchQueryUtils.buildFilterFormValuesFromQuery(queryJSON, policyCategories, policyTagsLists, currencyList, personalDetails, cardList, reports, taxRates); | ||
SearchActions.updateAdvancedFilters(filterFormValues); | ||
|
||
|
@@ -362,11 +374,9 @@ | |
vertical: CONST.MODAL.ANCHOR_ORIGIN_VERTICAL.BOTTOM, | ||
horizontal: CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.RIGHT, | ||
}} | ||
shouldUseOverlay | ||
shiftHorizontal={variables.searchFiltersTooltipShiftHorizontal} | ||
wrapperStyle={styles.productTrainingTooltipWrapper} | ||
renderTooltipContent={renderProductTrainingTooltip} | ||
onHideTooltip={hideProductTrainingTooltip} | ||
> | ||
<Button | ||
innerStyles={!isCannedQuery && [styles.searchRouterInputResults, styles.borderNone]} | ||
|
This file contains 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 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 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 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.
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.