Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6806,11 +6806,10 @@ const CONST = {

BASE_LIST_ITEM_TEST_ID: 'base-list-item-',
PRODUCT_TRAINING_TOOLTIP_NAMES: {
// TODO: CONCEIRGE_LHN_GBR tooltip will be replaced by a tooltip in the #admins room
Copy link
Contributor

@ishpaul777 ishpaul777 Mar 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just adding a comment here that it will be renamed to admin room tooltip and with some changed conditions to which user we show

// https://github.com/Expensify/App/issues/57045#issuecomment-2701455668
CONCEIRGE_LHN_GBR: 'conciergeLHNGBR',
RENAME_SAVED_SEARCH: 'renameSavedSearch',
QUICK_ACTION_BUTTON: 'quickActionButton',
WORKSAPCE_CHAT_CREATE: 'workspaceChatCreate',
SEARCH_FILTER_BUTTON_TOOLTIP: 'filterButtonTooltip',
BOTTOM_NAV_INBOX_TOOLTIP: 'bottomNavInboxTooltip',
LHN_WORKSPACE_CHAT_TOOLTIP: 'workspaceChatLHNTooltip',
GLOBAL_CREATE_TOOLTIP: 'globalCreateTooltip',
Expand Down
6 changes: 4 additions & 2 deletions src/components/LHNOptionsList/OptionRowLHN.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ function OptionRowLHN({reportID, isFocused = false, onSelectRow = () => {}, opti
const isReportsSplitNavigatorLast = useRootNavigationState((state) => state?.routes?.at(-1)?.name === NAVIGATORS.REPORTS_SPLIT_NAVIGATOR);

const {tooltipToRender, shouldShowTooltip} = useMemo(() => {
// TODO: CONCEIRGE_LHN_GBR tooltip will be replaced by a tooltip in the #admins room
// https://github.com/Expensify/App/issues/57045#issuecomment-2701455668
const tooltip = shouldShowGetStartedTooltip ? CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.CONCEIRGE_LHN_GBR : CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.LHN_WORKSPACE_CHAT_TOOLTIP;
const shouldShowTooltips = shouldShowWokspaceChatTooltip || shouldShowGetStartedTooltip;
const shouldTooltipBeVisible = shouldUseNarrowLayout ? isScreenFocused && isReportsSplitNavigatorLast : isReportsSplitNavigatorLast && !isFullscreenVisible;
Expand Down Expand Up @@ -194,8 +196,8 @@ function OptionRowLHN({reportID, isFocused = false, onSelectRow = () => {}, opti
horizontal: shouldShowWokspaceChatTooltip ? CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.LEFT : CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.RIGHT,
vertical: CONST.MODAL.ANCHOR_ORIGIN_VERTICAL.TOP,
}}
shiftHorizontal={shouldShowWokspaceChatTooltip ? variables.workspaceLHNtooltipShiftHorizontal : variables.gbrTooltipShiftHorizontal}
shiftVertical={shouldShowWokspaceChatTooltip ? 0 : variables.composerTooltipShiftVertical}
shiftHorizontal={shouldShowWokspaceChatTooltip ? variables.workspaceLHNTooltipShiftHorizontal : variables.gbrTooltipShiftHorizontal}
shiftVertical={shouldShowWokspaceChatTooltip ? 0 : variables.gbrTooltipShiftVertical}
wrapperStyle={styles.productTrainingTooltipWrapper}
onTooltipPress={onOptionPress}
shouldHideOnScroll
Expand Down
38 changes: 3 additions & 35 deletions src/components/ProductTrainingContext/TOOLTIPS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ import type {TranslationPaths} from '@src/languages/types';
const {
CONCEIRGE_LHN_GBR,
RENAME_SAVED_SEARCH,
WORKSAPCE_CHAT_CREATE,
QUICK_ACTION_BUTTON,
SEARCH_FILTER_BUTTON_TOOLTIP,
BOTTOM_NAV_INBOX_TOOLTIP,
LHN_WORKSPACE_CHAT_TOOLTIP,
GLOBAL_CREATE_TOOLTIP,
Expand Down Expand Up @@ -41,7 +38,9 @@ const TOOLTIPS: Record<ProductTrainingTooltipName, TooltipData> = {
onHideTooltip: () => dismissProductTraining(CONCEIRGE_LHN_GBR),
name: CONCEIRGE_LHN_GBR,
priority: 1300,
shouldShow: ({shouldUseNarrowLayout}) => !!shouldUseNarrowLayout,
// TODO: CONCEIRGE_LHN_GBR tooltip will be replaced by a tooltip in the #admins room
// https://github.com/Expensify/App/issues/57045#issuecomment-2701455668
shouldShow: () => false,
},
[RENAME_SAVED_SEARCH]: {
content: [
Expand All @@ -64,37 +63,6 @@ const TOOLTIPS: Record<ProductTrainingTooltipName, TooltipData> = {
priority: 1200,
shouldShow: () => true,
},
[QUICK_ACTION_BUTTON]: {
content: [
{text: 'productTrainingTooltip.quickActionButton.part1', isBold: true},
{text: 'productTrainingTooltip.quickActionButton.part2', isBold: false},
],
onHideTooltip: () => dismissProductTraining(QUICK_ACTION_BUTTON),
name: QUICK_ACTION_BUTTON,
priority: 1150,
shouldShow: () => true,
},
[WORKSAPCE_CHAT_CREATE]: {
content: [
{text: 'productTrainingTooltip.workspaceChatCreate.part1', isBold: false},
{text: 'productTrainingTooltip.workspaceChatCreate.part2', isBold: true},
{text: 'productTrainingTooltip.workspaceChatCreate.part3', isBold: false},
],
onHideTooltip: () => dismissProductTraining(WORKSAPCE_CHAT_CREATE),
name: WORKSAPCE_CHAT_CREATE,
priority: 1100,
shouldShow: () => true,
},
[SEARCH_FILTER_BUTTON_TOOLTIP]: {
content: [
{text: 'productTrainingTooltip.searchFilterButtonTooltip.part1', isBold: true},
{text: 'productTrainingTooltip.searchFilterButtonTooltip.part2', isBold: false},
],
onHideTooltip: () => dismissProductTraining(SEARCH_FILTER_BUTTON_TOOLTIP),
name: SEARCH_FILTER_BUTTON_TOOLTIP,
priority: 1000,
shouldShow: () => true,
},
[BOTTOM_NAV_INBOX_TOOLTIP]: {
content: [
{text: 'productTrainingTooltip.bottomNavInboxTooltip.part1', isBold: true},
Expand Down
3 changes: 1 addition & 2 deletions src/components/ProductTrainingContext/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,8 @@ 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
// We need to make an exception for these tooltips 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 &&
tooltipName !== CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.SCAN_TEST_TOOLTIP &&
tooltipName !== CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.SCAN_TEST_TOOLTIP_MANAGER &&
tooltipName !== CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.SCAN_TEST_CONFIRMATION &&
Expand Down
57 changes: 8 additions & 49 deletions src/components/Search/SearchPageHeader/SearchPageHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import {useFocusEffect} from '@react-navigation/native';
import React, {useCallback, useMemo, useState} from 'react';
import React, {useCallback, useMemo} from 'react';
import {View} from 'react-native';
import {useOnyx} from 'react-native-onyx';
import Button from '@components/Button';
import type {DropdownOption} from '@components/ButtonWithDropdownMenu/types';
import * as Expensicons from '@components/Icon/Expensicons';
import {usePersonalDetails} from '@components/OnyxProvider';
import {useProductTrainingContext} from '@components/ProductTrainingContext';
import {useSearchContext} from '@components/Search/SearchContext';
import type {SearchQueryJSON} from '@components/Search/types';
import EducationalTooltip from '@components/Tooltip/EducationalTooltip';
import useResponsiveLayout from '@hooks/useResponsiveLayout';
import useThemeStyles from '@hooks/useThemeStyles';
import {updateAdvancedFilters} from '@libs/actions/Search';
Expand All @@ -18,7 +15,6 @@ import Navigation from '@libs/Navigation/Navigation';
import {getAllTaxRates} from '@libs/PolicyUtils';
import {buildFilterFormValuesFromQuery} from '@libs/SearchQueryUtils';
import SearchSelectedNarrow from '@pages/Search/SearchSelectedNarrow';
import variables from '@styles/variables';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import ROUTES from '@src/ROUTES';
Expand Down Expand Up @@ -50,62 +46,25 @@ function SearchPageHeader({queryJSON, searchName, searchRouterListVisible, hideS
const [currencyList = {}] = useOnyx(ONYXKEYS.CURRENCY_LIST);
const [policyCategories] = useOnyx(ONYXKEYS.COLLECTION.POLICY_CATEGORIES);
const [policyTagsLists] = useOnyx(ONYXKEYS.COLLECTION.POLICY_TAGS);
const [isScreenFocused, setIsScreenFocused] = useState(false);

const {renderProductTrainingTooltip, shouldShowProductTrainingTooltip, hideProductTrainingTooltip} = useProductTrainingContext(
CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.SEARCH_FILTER_BUTTON_TOOLTIP,
isScreenFocused,
);

useFocusEffect(
useCallback(() => {
setIsScreenFocused(true);
return () => {
setIsScreenFocused(false);
};
}, []),
);

const selectedTransactionsKeys = Object.keys(selectedTransactions ?? {});

const onFiltersButtonPress = useCallback(() => {
hideProductTrainingTooltip();
const filterFormValues = buildFilterFormValuesFromQuery(queryJSON, policyCategories, policyTagsLists, currencyList, personalDetails, allCards, reports, taxRates);
updateAdvancedFilters(filterFormValues);

Navigation.navigate(ROUTES.SEARCH_ADVANCED_FILTERS);
}, [allCards, currencyList, hideProductTrainingTooltip, personalDetails, policyCategories, policyTagsLists, queryJSON, reports, taxRates]);
}, [allCards, currencyList, personalDetails, policyCategories, policyTagsLists, queryJSON, reports, taxRates]);

const InputRightComponent = useMemo(() => {
return (
<EducationalTooltip
shouldRender={shouldShowProductTrainingTooltip}
anchorAlignment={{
vertical: CONST.MODAL.ANCHOR_ORIGIN_VERTICAL.TOP,
horizontal: CONST.MODAL.ANCHOR_ORIGIN_HORIZONTAL.RIGHT,
}}
shiftHorizontal={variables.searchFiltersTooltipShiftHorizontal}
wrapperStyle={styles.productTrainingTooltipWrapper}
renderTooltipContent={renderProductTrainingTooltip}
onTooltipPress={onFiltersButtonPress}
shouldHideOnScroll
>
<Button
innerStyles={[styles.searchAutocompleteInputResults, styles.borderNone, styles.bgTransparent]}
icon={Expensicons.Filters}
onPress={onFiltersButtonPress}
/>
</EducationalTooltip>
<Button
innerStyles={[styles.searchAutocompleteInputResults, styles.borderNone, styles.bgTransparent]}
icon={Expensicons.Filters}
onPress={onFiltersButtonPress}
/>
);
}, [
onFiltersButtonPress,
renderProductTrainingTooltip,
shouldShowProductTrainingTooltip,
styles.bgTransparent,
styles.borderNone,
styles.productTrainingTooltipWrapper,
styles.searchAutocompleteInputResults,
]);
}, [onFiltersButtonPress, styles.bgTransparent, styles.borderNone, styles.searchAutocompleteInputResults]);

if (shouldUseNarrowLayout && selectionMode?.isEnabled) {
return (
Expand Down
15 changes: 2 additions & 13 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5942,6 +5942,8 @@ const translations = {
},
},
productTrainingTooltip: {
// TODO: CONCEIRGE_LHN_GBR tooltip will be replaced by a tooltip in the #admins room
// https://github.com/Expensify/App/issues/57045#issuecomment-2701455668
conciergeLHNGBR: {
part1: 'Get started',
part2: ' here!',
Expand All @@ -5950,19 +5952,6 @@ const translations = {
part1: 'Rename your saved searches',
part2: ' here!',
},
quickActionButton: {
part1: 'Quick action!',
part2: ' Just a tap away',
},
workspaceChatCreate: {
part1: 'Submit your',
part2: ' expenses',
part3: ' here!',
},
searchFilterButtonTooltip: {
part1: 'Customize your search',
part2: ' here!',
},
bottomNavInboxTooltip: {
part1: 'Your to-do list',
part2: '\n🟢 = ready for you',
Expand Down
15 changes: 2 additions & 13 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6464,6 +6464,8 @@ const translations = {
},
},
productTrainingTooltip: {
// TODO: CONCEIRGE_LHN_GBR tooltip will be replaced by a tooltip in the #admins room
// https://github.com/Expensify/App/issues/57045#issuecomment-2701455668
conciergeLHNGBR: {
part1: '¡Comienza',
part2: ' aquí!',
Expand All @@ -6472,19 +6474,6 @@ const translations = {
part1: 'Renombra tus búsquedas guardadas',
part2: ' aquí',
},
quickActionButton: {
part1: '¡Acción rápida!',
part2: ' A solo un toque',
},
workspaceChatCreate: {
part1: 'Envía tus',
part2: ' gastos',
part3: ' aquí',
},
searchFilterButtonTooltip: {
part1: 'Personaliza tu búsqueda',
part2: ' aquí!',
},
bottomNavInboxTooltip: {
part1: 'Tu lista de tareas',
part2: '\n🟢 = listo para ti',
Expand Down
Loading
Loading